Ejemplo n.º 1
0
 //when you long click the map, delete polygon
 public void longClick(object sender, GoogleMap.MapLongClickEventArgs e)
 {
     map.setPolygonPoints(0);
     map.ShapeCoordinates.Clear();
     polygon.Remove();
     clearShapeMarkers();
 }
Ejemplo n.º 2
0
        private void googleMap_MapLongClick(object sender, GoogleMap.MapLongClickEventArgs e)
        {
            ((MapExtension)Element).OnMapLongTouch(new Position(e.Point.Latitude, e.Point.Longitude));

            // display the new pin
            //UpdatePins();
        }
        private async void ShowPOI(object sender, GoogleMap.MapLongClickEventArgs e)
        {
            foreach (var point in pointsOfInterest)
            {
                point.Remove();
            }
            pointsOfInterest.Clear();

            LatLngBounds bounds = e.Point.GetBoundingBox(8000);

            var geocoder = new Geocoder(this);
            var results  = await geocoder.GetFromLocationNameAsync("Starbucks", 5,
                                                                   bounds.Southwest.Latitude, bounds.Southwest.Longitude,
                                                                   bounds.Northeast.Latitude, bounds.Northeast.Longitude);

            foreach (var result in results)
            {
                var markerOptions = new MarkerOptions()
                                    .SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueCyan))
                                    .SetPosition(new LatLng(result.Latitude, result.Longitude))
                                    .SetTitle(result.FeatureName)
                                    .SetSnippet(GetAdress(result));

                pointsOfInterest.Add(map.AddMarker(markerOptions));
            }
        }
Ejemplo n.º 4
0
 void Map_MapLongClick(object sender, GoogleMap.MapLongClickEventArgs e)
 {
     MarkerFactory(e.P0);
     _viewModel.LocationEntity.Add(new LocationEntity()
     {
         Latitude = e.P0.Latitude, Longitude = e.P0.Longitude
     });
 }
Ejemplo n.º 5
0
        /// <summary>
        /// When a long click was performed on the map
        /// </summary>
        /// <param name="sender">Event Sender</param>
        /// <param name="e">Event Arguments</param>
        private void OnMapLongClick(object sender, GoogleMap.MapLongClickEventArgs e)
        {
            if (this.FormsMap == null || this.FormsMap.MapLongPressCommand == null)
            {
                return;
            }

            var position = e.Point.ToPosition();

            this.MapFunctions.RaiseMapLongPress(position);
        }
Ejemplo n.º 6
0
        private void _map_MapLongClick(object sender, GoogleMap.MapLongClickEventArgs e)
        {
            markerPosition = e.Point;

            MarkerOptions markerOptions = new MarkerOptions()
                                          .SetPosition(markerPosition)
                                          .SetTitle("Sleep naar je voertuig")
                                          .Draggable(true);

            map.AddMarker(markerOptions);
        }
Ejemplo n.º 7
0
        private void GoogleMap_MapLongClick(object sender, GoogleMap.MapLongClickEventArgs e)
        {
            MarkerOptions markerOpt1 = new MarkerOptions();

            _markerPosition = new Coordinates
            {
                Latitude   = e.Point.Latitude,
                Longtitute = e.Point.Longitude,
                PlaceName  = "Unknown"
            };
            SetMarker(e.Point);
        }
Ejemplo n.º 8
0
        private void _map_MapLongClick(object sender, GoogleMap.MapLongClickEventArgs e)
        {
            MarkerOptions markerOptions = new MarkerOptions()
                                          .SetPosition(e.Point)
                                          .SetTitle("Hier staat je voertuig")
                                          .SetSnippet($"Lat {e.Point.Latitude} Long {e.Point.Longitude}")
                                          .Draggable(true);

            map.AddMarker(markerOptions);

            markersList.Add(e.Point);
        }
Ejemplo n.º 9
0
        void ClickingLongMap(object sender, GoogleMap.MapLongClickEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("Clicked looogly on the map");
            var marker = new MarkerOptions();

            marker.Draggable(true);
            marker.SetPosition(new LatLng(e.Point.Latitude, e.Point.Longitude));
            formsMap.MarkerPosition = new Position(marker.Position.Latitude, marker.Position.Longitude);
            System.Diagnostics.Debug.WriteLine("pin starting latitude" + e.Point.Latitude);


            NativeMap.AddMarker(marker);
        }
Ejemplo n.º 10
0
        private void MapLongClick(object sender, GoogleMap.MapLongClickEventArgs e)
        {
            var pin = new CustomPin
            {
                Type     = PinType.Place,
                Address  = "Test address",
                Label    = "Test Lable",
                Position = new Position(e.Point.Latitude, e.Point.Longitude),
                Id       = "Xamarin",
                Url      = "http://xamarin.com/about/"
            };

            customPins.Add(pin);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// When a long click was performed on the map
        /// </summary>
        /// <param name="sender">Event Sender</param>
        /// <param name="e">Event Arguments</param>
        private void OnMapLongClick(object sender, GoogleMap.MapLongClickEventArgs e)
        {
            if (this.FormsMap == null || this.FormsMap.MapLongPressCommand == null)
            {
                return;
            }

            var position = e.Point.ToPosition();

            if (this.FormsMap.MapLongPressCommand.CanExecute(position))
            {
                this.FormsMap.MapLongPressCommand.Execute(position);
            }
        }
Ejemplo n.º 12
0
        void OnMapLongClick(object sender, GoogleMap.MapLongClickEventArgs e)
        {
            var shouldAdd = PreferenceManager.GetDefaultSharedPreferences(this)
                            .GetBoolean(SettingsScreen.AddMarkerOnLongTap, SettingsScreen.AddMarkerOnLongTapDefaultValue);

            if (shouldAdd && Mode == Mode.None)
            {
                Mode = Mode.Add;
                MapClickWhileAddMode(e.Point);

                GoogleAnalyticsManager.ReportEvent(GACategory.MainScreen, GAAction.Click,
                                                   "map long click used to add alarm");
            }
        }
Ejemplo n.º 13
0
        private void OnMapLongClick(object sender, GoogleMap.MapLongClickEventArgs e)
        {
            _map.Clear();
            var position = new Position(e.Point.Latitude, e.Point.Longitude);

            ((CustomMap)Element).OnTap(position);
            ((CustomMap)Element).IsNetworkConnected(MainActivity.IsNetworkConnected());

            var marker = CreateMarker(new Pin()
            {
                Position = position
            });

            _map.AddMarker(marker);
        }
Ejemplo n.º 14
0
 private void GMapLongClickEvent(object sender, GoogleMap.MapLongClickEventArgs e)
 {
     if (STATUS_GUI == StatusGUI.DesenhandoCaminho)
     {
         if (UltimoPontoInteracao == null)
         {
             //Colocar novo ponto
             ColocarNovoPontoMapa(e.Point, (LatLng)null, EstacionamentoSelecionado);
         }
         else
         {
             //colocar novo ponto a partir do ultimo interagido
             ColocarNovoPontoMapa(e.Point, UltimoPontoInteracao.Position, EstacionamentoSelecionado);
         }
     }
 }
Ejemplo n.º 15
0
        async void MarkAddress(object sender, GoogleMap.MapLongClickEventArgs e)
        {
            markedAddresses.ForEach(m => m.Remove());
            markedAddresses.Clear();

            var geocoder = new Geocoder(this);
            var results  = await geocoder.GetFromLocationNameAsync(addressSearchTerm, 5);

            foreach (var result in results)
            {
                var markerOptions = new MarkerOptions()
                                    .SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueCyan))
                                    .SetPosition(new LatLng(result.Latitude, result.Longitude))
                                    .SetTitle(result.FeatureName)
                                    .SetSnippet(GetAddress(result));
                markedAddresses.Add(map.AddMarker(markerOptions));
            }
        }
 private void GoogleMap_MapLongClick(object sender, GoogleMap.MapLongClickEventArgs e)
 {
     MapLongClicked?.Invoke(this, new MapClickedEventArgs(
                                new Position(e.Point.Latitude,
                                             e.Point.Longitude)));
 }
Ejemplo n.º 17
0
 protected void MapLongClick(object sender, GoogleMap.MapLongClickEventArgs e)
 {
 }
Ejemplo n.º 18
0
 void OnMapLongClick(object sender, GoogleMap.MapLongClickEventArgs e)
 {
     AddMarker($"{e.Point.Latitude},{e.Point.Longitude}", e.Point);
 }