/// <summary>
 /// execute this code if the user taps the info window.
 /// Note that we make use of the INavigationService that was passed
 /// through a binding in the view model.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnMapInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
 {
     if (_customMap.NavigationService != null)
     {
         _customMap.NavigationService.NavigateAsync(DevDaysSpeakers.PageKeys.Speakers);
     }
 }
示例#2
0
        private void MapOnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            Marker marker = e.Marker;

            var placemarks = _Placemarks.Where(x => x["id"] == marker.Id);

            if (placemarks != null && placemarks.Count() > 0)
            {
                var placemark = placemarks.First();

                Intent i = new Intent();
                i.SetClass(Application.Context, typeof(MappaDetailsScreen));

                i.PutExtra("placemark", JsonConvert.SerializeObject(placemark));

                //ActivitiesBringe.SetObject(placemark);

                StartActivity(i);
            }

            /*string lat = marker.Position.Latitude.ToString().Replace(".", "").Replace(",", ".");
             * string lon = marker.Position.Longitude.ToString().Replace(".", "").Replace(",", ".");
             *
             * Intent intent = new Intent(Intent.ActionView,  Android.Net.Uri.Parse("google.navigation:q=" + lat + "," + lon));
             *
             * StartActivity(intent);*/


            //this.OverridePendingTransition(Resource.Animation.SlideInRight, Resource.Animation.SlideOutLeft);
        }
        void OnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            var customPin = GetCustomPin(e.Marker);

            if (customPin == null)
            {
                throw new Exception("Custom pin not found");
            }

            //draw route
            _finalPolyline = null;
            if (customPin.RouteCoordinates.Any())
            {
                var polylineOptions = new PolylineOptions();
                polylineOptions.InvokeColor(0x66FF0000);
                foreach (var coordinate in customPin.RouteCoordinates)
                {
                    polylineOptions.Add(new LatLng(coordinate.Latitude, coordinate.Longitude));
                }
                _finalPolyline = base.NativeMap.AddPolyline(polylineOptions);
            }

            if (!string.IsNullOrWhiteSpace(customPin.Url))
            {
                var url    = Android.Net.Uri.Parse(customPin.Url);
                var intent = new Intent(Intent.ActionView, url);
                intent.AddFlags(ActivityFlags.NewTask);
                Android.App.Application.Context.StartActivity(intent);
            }
        }
示例#4
0
        private void HandleInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            // Draw a circle on the map
            CircleOptions circleOptions = new CircleOptions();

            circleOptions.InvokeCenter(Location_NewYork);
            circleOptions.InvokeRadius(100000.0);
            circleOptions.InvokeFillColor(Android.Graphics.Color.White);
            _map.AddCircle(circleOptions);

            // Draw a polygon (Wyoming) on the map
            PolygonOptions polygonOptions = new PolygonOptions();

            polygonOptions.Add(new LatLng[]
            {
                new LatLng(45.00, -111.00),
                new LatLng(45, -104),
                new LatLng(41, -104),
                new LatLng(41, -111)
            });

            polygonOptions.InvokeFillColor(Android.Graphics.Color.Purple);
            polygonOptions.InvokeStrokeWidth(2);
            _map.AddPolygon(polygonOptions);
        }
示例#5
0
 private void OnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
 {
     Xamarin.Forms.MessagingCenter.Send <MapOpenPointMessage>(new MapOpenPointMessage()
     {
         Latitude = e.Marker.Position.Latitude, Longitude = e.Marker.Position.Longitude
     }, string.Empty);
 }
        /// <summary>
        ///     Add three markers to the map.
        /// </summary>


        void HandleInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            var circleOptions = new CircleOptions();

            circleOptions.InvokeCenter(InMaui);
            circleOptions.InvokeRadius(100.0);
        }
示例#7
0
 /// <summary>
 /// When the info window gets clicked
 /// </summary>
 /// <param name="sender">Event Sender</param>
 /// <param name="e">Event Arguments</param>
 private void OnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
 {
     if (this.FormsMap.CalloutClickedCommand != null && this.FormsMap.CalloutClickedCommand.CanExecute(null))
     {
         this.FormsMap.CalloutClickedCommand.Execute(null);
     }
 }
示例#8
0
 public void InfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
 {
     if (e.Marker.Id == markerChicago.Id)
     {
         e.Marker.SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueRose));
     }
 }
示例#9
0
        private void onInfoWindowClicked(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            Marker myMarker = e.Marker;

            try {
                ParkGroup park = (ParkGroup)Services.getPark(int.Parse(myMarker.Title));
                foreach (Park item in park.Parques)
                {
                    Console.WriteLine(item.Name);
                }
                theMap.UiSettings.SetAllGesturesEnabled(false);
                CameraPosition.Builder builder = CameraPosition.InvokeBuilder();
                builder.Target(myMarker.Position);
                builder.Zoom(17.2f);

                theMap.AnimateCamera(CameraUpdateFactory.NewCameraPosition(builder.Build()));
                theMap.Clear();
                theMap.MapType = GoogleMap.MapTypeSatellite;
                theMap.UiSettings.MyLocationButtonEnabled = false;
                Services.activeParks = park.Parques;
                MarkParks();
                isInsideMarker = true;
            }
            catch (Exception ex) {
                var newActivity = new Intent(this, typeof(ParksSingleView));
                newActivity.PutExtra("MyData", myMarker.Title);
                StartActivity(newActivity);
            }
        }
示例#10
0
        void OnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            var customPin = GetCustomPin(e.Marker);

            if (customPin == null)
            {
                throw new Exception("Custom pin not found");
            }

            if (customPin.CustomType == ODMSPinType.DONOR)
            {
                // Find MainActivity and then launch a new activity to show the user overview
                Activity mainActivity = CrossCurrentActivity.Current.Activity;
                String   organString  = customPin.donatableOrgans.ToJson();

                Intent intent = new Intent(mainActivity.BaseContext, typeof(BottomSheetListActivity));
                intent.PutExtra("name", customPin.Label);
                intent.PutExtra("address", customPin.Address);
                intent.PutExtra("profilePicture", customPin.userPhoto);
                intent.PutExtra("organs", organString);
                intent.PutExtra("donorLat", customPin.Position.Latitude.ToString());
                intent.PutExtra("donorLong", customPin.Position.Longitude.ToString());
                mainActivity.StartActivity(intent);
            }
        }
 private static void OnNativeMapInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs ev)
 {
     if (!Equals(ev.Marker, null))
     {
         ev.Marker.HideInfoWindow();
     }
 }
示例#12
0
 void OnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
 {
     //var customPin = GetCustomPin(e.Marker);
     //if (customPin == null)
     //{
     //    throw new Exception("Custom pin not found");
     //}
 }
示例#13
0
        private void MapOnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            Marker clickedMarker = e.Marker;
            // Find the matchin item
            var formsMap = (CustomMap)Element;

            formsMap.ShowDetailCommand.Execute(formsMap.SelectedPin);
        }
        // handle info popup tap
        private void HandleInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            // TODO: Step 5a - Query for a location and map them
//			RunAddressQuery();

            // TODO: Step 5b - Query for point of interest at a given location
//            FindNearestPlace();
        }
示例#15
0
        void OnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            // lookup pin
            var targetPin = LookupPin(e.Marker);

            // only consider event handled if a handler is present.
            // Else allow default behavior of displaying an info window.
            targetPin?.SendTap();
        }
示例#16
0
        private void InfoWindow_Click(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            var customPin = GetCustomPin(e.Marker);

            if (customPin == null)
            {
                throw new Exception("Custom pin not found");
            }
        }
示例#17
0
        private void Gmap_InfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            Marker marker = e.Marker;

            var questionAnswer = new Intent(this, typeof(AuditQuesAnswersActivity));

            questionAnswer.PutExtra("auditId", marker.Alpha.ToString());
            questionAnswer.PutExtra("isNewAudit", false.ToString());
            StartActivity(questionAnswer);
        }
示例#18
0
        private void OnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            CustomPin customPin = GetCustomPin(e.Marker);

            if (customPin == null)
            {
                throw new Exception("Custom pin not found");
            }
            customPin.OnInfoTapped(e);
        }
示例#19
0
        private void GoogleMap_InfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            var    selectedPlaceName = e.Marker.Title.ToString();
            Place  selectedPlace     = _placeDatabase.GetPlaceByName(selectedPlaceName);
            var    selectedPlaceId   = selectedPlace.PlaceId;
            Intent detailIntent      = new Intent(Application.Context, typeof(PlaceDetailActivity));

            detailIntent.PutExtra("selectedPlaceId", selectedPlaceId);
            StartActivity(detailIntent);
        }
示例#20
0
        private void MapOnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            Marker myMarker = e.Marker; //e.P0;
            // Do something with marker.
            var Name   = myMarker.Title;
            var intent = new Intent(this, typeof(BirdDetailActivity));

            intent.PutExtra("Name", Name);
            intent.PutExtra("IncomingPage", "Seen");
            StartActivityForResult(intent, 0);
        }
示例#21
0
        private void MapOnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            Marker myMarker = e.Marker;

            // Do something with marker.
            Intent intent = new Intent(Application.Context, typeof(MeterReportActivity));

            intent.PutExtra(MeterReportActivity.KEY_METER_NAME, myMarker.Title);
            intent.PutExtra(MeterReportActivity.KEY_METER_SERIAL, myMarker.Snippet);
            StartActivity(intent);
        }
示例#22
0
        private void GoogleMap_InfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            Step step = markerSteps[e.Marker.Id];

            Intent intent = new Intent(Activity, typeof(StopActivity));

            intent.PutExtra("Stop", step.Stop.Id);
            intent.PutExtra("Line", step.Route.Line.Id);

            Activity.StartActivity(intent);
        }
示例#23
0
        private void MapOnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            Marker                   myMarker = e.Marker;
            ISharedPreferences       prefs    = PreferenceManager.GetDefaultSharedPreferences(Android.App.Application.Context);
            ISharedPreferencesEditor editor   = prefs.Edit();
            KeyValuePair <Building, List <Workplace> > buildingInstance = CompositeMarkers[myMarker.Id];
            TextView  markerMenu = FindViewById <TextView>(Resource.Id.marker_menu);
            PopupMenu menu       = new PopupMenu(this, markerMenu);

            foreach (Workplace workplace in buildingInstance.Value)
            {
                FindedWorkplace finded = findedWorkplaces.FirstOrDefault(x => x.WorkplaceId == workplace.Id);
                menu.Menu.Add("Workplace number:" + workplace.Id.ToString() + ",\nWorkplace cost: " + workplace.Cost.ToString()
                              + ",\nAppropriation: " + finded.AppropriationPercentage.ToString() + ",\nCost approp: " + finded.CostColor
                              + ", Address: " + buildingInstance.Key.Country + ", " + buildingInstance.Key.City + ", "
                              + buildingInstance.Key.Street + ", " + buildingInstance.Key.House.ToString() + ", " + buildingInstance.Key.Flat.ToString());
            }
            menu.MenuItemClick += (s1, arg1) =>
            {
                AlertDialog.Builder alert = new AlertDialog.Builder(this);
                alert.SetTitle("Workplace");
                alert.SetMessage(arg1.Item.TitleFormatted.ToString());
                alert.SetPositiveButton("Visit", async(senderAlert, arg) =>
                {
                    ISharedPreferences prefs1        = PreferenceManager.GetDefaultSharedPreferences(Android.App.Application.Context);
                    ISharedPreferencesEditor editor1 = prefs1.Edit();
                    string workplId = arg1.Item.TitleFormatted.ToString().Split(':', ',')[1];
                    editor1.PutString("workplaceId", workplId);
                    editor1.Apply();

                    var intent = new Intent(this, typeof(WorkplaceActivity));
                    StartActivity(intent);
                });

                alert.SetNegativeButton("Cancel", (senderAlert, arg) =>
                {
                    Toast.MakeText(this, "Cancelled!", ToastLength.Short).Show();
                });

                Dialog dialog = alert.Create();
                dialog.Show();
            };

            menu.DismissEvent += (s2, arg2) =>
            {
                Console.WriteLine("menu dismissed");
            };
            menu.Show();
            //editor.PutString("restaurant", Markers[myMarker.Id].ToString());
            //editor.Apply();

            //var intent = new Intent(this, typeof(RestaurantActivity));
            //StartActivity(intent);
        }
        void OnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            var customPin = GetCustomPin(e.Marker);

            if (customPin == null)
            {
                throw new Exception("Custom pin not found");
            }

            // Do custom stuff here
        }
示例#25
0
        void OnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            var pin = GetPin(e.Marker);

            if (pin == null)
            {
                throw new Exception("Custom pin not found");
            }

            MapControl.FireWindowClicked(pin);
        }
示例#26
0
        public void OnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            var customPin = GetCustomPin(e.Marker);

            if (customPin == null)
            {
                throw new Exception("Custom pin not found");
            }
            var page = new EatNearMobile.RestaurantPage(customPin.Restaurant) as RestaurantPage;

            Xamarin.Forms.Application.Current.MainPage.Navigation.PushModalAsync(page);
        }
示例#27
0
        /// <summary>
        /// When cafe name is clicked, takes to next page
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private async void MapOnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            Marker myMarker = e.Marker;

            // Do something with marker.
            Console.WriteLine("Marker Clicked");
            if (myMarker.Title != "My Position")
            {
                finalOrder.Cafe = myMarker.Title;
                var intent = new Intent(this, typeof(CoffeeList));
                this.StartActivity(intent);
            }
        }
示例#28
0
        private void GoogleMap_InfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            Stop stop;

            if (markerStops.TryGetValue(e.Marker.Id, out stop))
            {
                Intent intent = new Intent(Activity, typeof(StopActivity));

                intent.PutExtra("Stop", stop.Id);
                intent.PutExtra("Line", stop.Line.Id);

                StartActivity(intent);
            }
        }
示例#29
0
        //CLICK na FOTO
        void OnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            var PIN = GETPinoFoto(e.Marker);

            if (PIN == null)
            {
                throw new Exception("Pino Não encontrado");
            }

            if (PIN.POST != null)
            {
                PIN.ClicaPino();
            }
        }
        void OnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            var customPin = GetCustomPin(e.Marker);

            if (customPin == null)
            {
                throw new Exception("Custom pin not found");
            }


            //Go to the Chat
            TutorScout24.ViewModels.MasterDetailViewModel vM = (TutorScout24.ViewModels.MasterDetailViewModel)Xamarin.Forms.Application.Current.MainPage.BindingContext;
            vM.OpenChat(customPin.UserName);
        }