void amap_Loaded(object sender, RoutedEventArgs e) { // amap.MoveCamera(CameraUpdateFactory.NewLatLng(amap.Center)); CameraUpdate cu = CameraUpdateFactory.ZoomTo(13); Debug.WriteLine(amap.Center); }
private void updateZoomLevel(int zoomLevel) { if (map != null) { map.AnimateCamera(CameraUpdateFactory.ZoomTo(zoomLevel)); } }
/// <summary> /// IOnMapReadyCallback Interface Function /// </summary> /// <param name="googleMap">The Map Yo!</param> public void OnMapReady(GoogleMap googleMap) { if (googleMap != null) { MyMap = googleMap; MyMap.MapType = GoogleMap.MapTypeHybrid; MyMap.MyLocationEnabled = true; MyMap.UiSettings.MapToolbarEnabled = true; MyMap.UiSettings.MyLocationButtonEnabled = true; MyMap.UiSettings.ZoomGesturesEnabled = true; apiClient.Connect(); Location location = LocationServices.FusedLocationApi.GetLastLocation(apiClient); if (location != null) { CameraUpdate center = CameraUpdateFactory.NewLatLng(new LatLng(location.Latitude, location.Longitude)); CameraUpdate zoom = CameraUpdateFactory.ZoomTo(15); MyMap.MoveCamera(center); MyMap.AnimateCamera(zoom); } // The GoogleMap object is ready to go. mapTimer.Enabled = true; mapTimer.Start(); } }
protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { base.OnElementPropertyChanged(sender, e); System.Diagnostics.Debug.WriteLine("MapViewRenderer:" + e.PropertyName); if (e.PropertyName == MapView.RegionProperty.PropertyName) { OnMapRegionChanged(); return; } if (e.PropertyName == MapView.CenterProperty.PropertyName) { if (Element.Center == null) { return; } FocustoLocation(Element.Center.ToLatLng()); } else if (e.PropertyName == MapView.MapStyleProperty.PropertyName && map != null) { UpdateMapStyle(); } else if (e.PropertyName == MapView.PitchEnabledProperty.PropertyName) { if (map != null) { map.UiSettings.TiltGesturesEnabled = Element.PitchEnabled; } } else if (e.PropertyName == MapView.PitchProperty.PropertyName) { map?.AnimateCamera(CameraUpdateFactory.TiltTo(Element.Pitch)); } else if (e.PropertyName == MapView.RotateEnabledProperty.PropertyName) { if (map != null) { map.UiSettings.RotateGesturesEnabled = Element.RotateEnabled; } } else if (e.PropertyName == MapView.RotatedDegreeProperty.PropertyName) { map?.AnimateCamera(CameraUpdateFactory.BearingTo(Element.RotatedDegree)); } else if (e.PropertyName == MapView.ZoomLevelProperty.PropertyName && map != null) { var dif = Math.Abs(map.CameraPosition.Zoom - Element.ZoomLevel); System.Diagnostics.Debug.WriteLine($"Current zoom: {map.CameraPosition.Zoom} - New zoom: {Element.ZoomLevel}"); if (dif >= 0.01 && cameraBusy == false) { System.Diagnostics.Debug.WriteLine("Updating zoom level"); map.AnimateCamera(CameraUpdateFactory.ZoomTo(Element.ZoomLevel)); } } }
protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { base.OnElementPropertyChanged(sender, e); if (e.PropertyName == MapView.CenterProperty.PropertyName) { if (!ReferenceEquals(Element.Center, currentCamera)) { if (Element.Center == null) { return; } FocustoLocation(Element.Center.ToLatLng()); } } else if (e.PropertyName == MapView.MapStyleProperty.PropertyName && map != null) { UpdateMapStyle(); } else if (e.PropertyName == MapView.PitchEnabledProperty.PropertyName) { if (map != null) { map.UiSettings.TiltGesturesEnabled = Element.PitchEnabled; } } else if (e.PropertyName == MapView.RotateEnabledProperty.PropertyName) { if (map != null) { map.UiSettings.RotateGesturesEnabled = Element.RotateEnabled; } } else if (e.PropertyName == MapView.AnnotationsProperty.PropertyName) { RemoveAllAnnotations(); if (Element.Annotations != null) { AddAnnotations(Element.Annotations.ToArray()); var notifyCollection = Element.Annotations as INotifyCollectionChanged; if (notifyCollection != null) { notifyCollection.CollectionChanged += OnAnnotationsCollectionChanged; } } } else if (e.PropertyName == MapView.ZoomLevelProperty.PropertyName && map != null) { var dif = Math.Abs(map.CameraPosition.Zoom - Element.ZoomLevel); System.Diagnostics.Debug.WriteLine($"Current zoom: {map.CameraPosition.Zoom} - New zoom: {Element.ZoomLevel}"); if (dif >= 0.01) { System.Diagnostics.Debug.WriteLine("Updating zoom level"); map.AnimateCamera(CameraUpdateFactory.ZoomTo(Element.ZoomLevel)); } } }
private async void zoomToLocation() { var locator = CrossGeolocator.Current; locator.DesiredAccuracy = 50; var position = await locator.GetPositionAsync(timeoutMilliseconds : 10000); map.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(position.Latitude, position.Longitude), 12)); map.AnimateCamera(CameraUpdateFactory.ZoomTo(12), 2000, null); }
public void OnMapReady(GoogleMap googleMap) { _map = googleMap; _map.MapType = GoogleMap.MapTypeSatellite; if (_currentLocation != null) { _map.AddMarker(new MarkerOptions().SetPosition(new LatLng(_currentLocation.Latitude, _currentLocation.Longitude)).SetTitle("Vasa trenutna pozicija")); _map.MoveCamera(CameraUpdateFactory.NewLatLng(new LatLng(_currentLocation.Latitude, _currentLocation.Longitude))); _map.AnimateCamera(CameraUpdateFactory.ZoomTo(16)); } }
public void OnMapReady(GoogleMap googleMap) { PontosClass Ponto = new PontosClass(); googleMap.UiSettings.ZoomControlsEnabled = true; googleMap.UiSettings.CompassEnabled = true; googleMap.MoveCamera(CameraUpdateFactory.ZoomTo(googleMap.MaxZoomLevel)); googleMap.MoveCamera(CameraUpdateFactory.NewLatLng(new LatLng(-26.3193264, -48.8553668))); googleMap.MarkerClick += GoogleMap_MarkerClick; Ponto.CarregaPontosMapa(googleMap); }
public void OnLocationChanged(Location location) { Mvx.Trace(MvxTraceLevel.Diagnostic, "OnLocationChanged"); ViewModel.UpdateUserLocation(location.Longitude, location.Latitude); var latng = new LatLng(location.Latitude, location.Longitude); UpdateMarkers(latng, true); CameraUpdate zoom = CameraUpdateFactory.ZoomTo(15); MapView.Map.MoveCamera(CameraUpdateFactory.NewLatLng(latng)); MapView.Map.AnimateCamera(zoom); }
private void MoveCamera(Location location) { if (_googleMap != null) { _googleMap.MoveCamera(CameraUpdateFactory.NewLatLng(LocationToLatLong(location))); _googleMap.AnimateCamera(CameraUpdateFactory.ZoomTo(_cameraZoom)); if (_myOverlay != null) { _myOverlay.Position = LocationToLatLong(location); } } }
protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { base.OnElementPropertyChanged(sender, e); if (e.PropertyName == MapView.CenterProperty.PropertyName) { if (!ReferenceEquals(Element.Center, currentCamera)) { if (Element.Center == null) { return; } FocustoLocation(new LatLng(Element.Center.Lat, Element.Center.Long)); } } else if (e.PropertyName == MapView.MapStyleProperty.PropertyName && map != null) { UpdateMapStyle(); } else if (e.PropertyName == MapView.PitchEnabledProperty.PropertyName) { if (map != null) { map.UiSettings.TiltGesturesEnabled = Element.PitchEnabled; } } else if (e.PropertyName == MapView.RotateEnabledProperty.PropertyName) { if (map != null) { map.UiSettings.RotateGesturesEnabled = Element.RotateEnabled; } } else if (e.PropertyName == MapView.AnnotationsProperty.PropertyName) { RemoveAllAnnotations(); if (Element.Annotations != null) { AddAnnotations(Element.Annotations.ToArray()); var notifyCollection = Element.Annotations as INotifyCollectionChanged; if (notifyCollection != null) { notifyCollection.CollectionChanged += OnAnnotationsCollectionChanged; } } } else if (e.PropertyName == MapView.ZoomLevelProperty.PropertyName) { map?.AnimateCamera(CameraUpdateFactory.ZoomTo(Element.ZoomLevel)); } }
public void OnMapReady(GoogleMap googleMap) { this.googleMap = googleMap; //Setup and customize your Google Map this.googleMap.UiSettings.CompassEnabled = false; this.googleMap.UiSettings.MyLocationButtonEnabled = false; this.googleMap.UiSettings.MapToolbarEnabled = false; MapsInitializer.Initialize(this); var me = new LatLng(40.759010, -73.984474); googleMap.MoveCamera(CameraUpdateFactory.NewLatLng(me)); googleMap.MoveCamera(CameraUpdateFactory.ZoomTo(15)); }
public void OnStyleLoaded(Style style) { this.style = style; MostrarUbicacionTiempoReal(); FindViewById <View>(Resource.Id.fabStyles).Click += MainActivity_Click; mapboxMap.MoveCamera(CameraUpdateFactory.ZoomTo(2.0)); markerViewManager = new MarkerViewManager(mapView, mapboxMap); createCustomMarker(); //createRandomMarkers() //mapboxMap.addOnMapLongClickListener(this@MarkerViewActivity) //mapboxMap.addOnMapClickListener(this@MarkerViewActivity) }
public void OnLocationChanged(Location location) { var latitude = location.Latitude; var longitude = location.Longitude; if (mMap != null) { // Create a LatLng object for the current location var latLng = new LatLng(latitude, longitude); // Show the current location in Google Map mMap.MoveCamera(CameraUpdateFactory.NewLatLng(latLng)); mMap.AnimateCamera(CameraUpdateFactory.ZoomTo(20)); } }
private void setUpMapIfNeeded() { // Do a null check to confirm that we have not already instantiated the map. if (mMap == null) { mMap = ((MapFragment)GetFragmentManager().FindFragmentById(R.Ids.map)).GetMap(); // Check if we were successful in obtaining the map. if (mMap != null) { // The Map is verified. It is now safe to manipulate the map. mMap.SetMapType(GoogleMap.MAP_TYPE_SATELLITE); mMap.SetMyLocationEnabled(true); // Zoom in the Google Map mMap.AnimateCamera(CameraUpdateFactory.ZoomTo(20)); } } }
public void OnMapReady(GoogleMap googleMap) { MarkerOptions markerOptions = new MarkerOptions(); // TODO: Allow app to ask permission for user to get LATLANG. LatLng myPos = new LatLng(10.340360, 123.909882); markerOptions.SetPosition(myPos); markerOptions.SetTitle("You are here!"); googleMap.AddMarker(markerOptions); // Optional googleMap.UiSettings.ZoomControlsEnabled = true; googleMap.UiSettings.CompassEnabled = true; // Update Camera googleMap.MoveCamera(CameraUpdateFactory.NewLatLng(myPos)); googleMap.AnimateCamera(CameraUpdateFactory.ZoomTo(17)); }
private void _pozitioneazaCamera(object ob, GoogleMap.MarkerClickEventArgs ev) { ev.Handled = true; _harta.MoveCamera(CameraUpdateFactory.NewLatLng(_coordonate)); _harta.AnimateCamera(CameraUpdateFactory.ZoomTo(17)); Geocoder _geolocatie = new Geocoder(this); IList <Address> _listaAdrese = _geolocatie.GetFromLocation(_curent.Latitude, _curent.Longitude, 4); Address _adresa = _listaAdrese.FirstOrDefault(); latEdit.Text = _adresa.Latitude.ToString(); longEdit.Text = _adresa.Longitude.ToString(); StringBuilder _stradaTaraCodPostal = new StringBuilder(); for (int i = 0; i < _adresa.MaxAddressLineIndex; i++) { _stradaTaraCodPostal.AppendLine(_adresa.GetAddressLine(i)); } tvAddress.Text = _stradaTaraCodPostal.ToString(); dataGPS.Text = sdf.Format(d); }
public void OnMapReady(GoogleMap map) { if (needsInit) { CameraUpdate center = CameraUpdateFactory.NewLatLng(new LatLng(40.76793169992044, -73.98180484771729)); CameraUpdate zoom = CameraUpdateFactory.ZoomTo(15); map.MoveCamera(center); map.AnimateCamera(zoom); } AddMarker(map, 40.748963847316034, -73.96807193756104, Resource.String.un, Resource.String.united_nations); AddMarker(map, 40.76866299974387, -73.98268461227417, Resource.String.lincoln_center, Resource.String.lincoln_center_snippet); AddMarker(map, 40.765136435316755, -73.97989511489868, Resource.String.carnegie_hall, Resource.String.practice_x3); AddMarker(map, 40.70686417491799, -74.01572942733765, Resource.String.downtown_club, Resource.String.heisman_trophy); }
public void OnMapReady(GoogleMap googleMap) { GMap = googleMap; // GMap.SetLocationSource(followMeLocationSource); // Set default zoom GMap.MoveCamera(CameraUpdateFactory.ZoomTo(15f)); // LatLng latlng = new LatLng(32.668849781762106, -115.40940821170807); // CameraUpdate camera = CameraUpdateFactory.NewLatLngZoom(latlng, 15); // GMap.MoveCamera(camera); // MarkerOptions options = new MarkerOptions().SetPosition(latlng).SetTitle("Chennai"); // GMap.AddMarker(options); GMap.MyLocationEnabled = true; GMap.UiSettings.MyLocationButtonEnabled = true; MarkerOptions Estacion1 = new MarkerOptions(); Estacion1.SetPosition(new LatLng(32.668531, -115.40853300000003)); Estacion1.SetTitle("Estacion Policia Pimsa 1"); Estacion1.SetSnippet("Numero telefonico: 01 686 558 1600"); Estacion1.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.poli_opt)); MarkerOptions Estacion2 = new MarkerOptions(); Estacion2.SetPosition(new LatLng(32.65649090000001, -115.46213390000003)); Estacion2.SetTitle("Estación de Policía Industrial"); Estacion2.SetSnippet("Numero telefonico: 01 686 554 7958"); Estacion2.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.poli_opt)); MarkerOptions Estacion3 = new MarkerOptions(); Estacion3.SetPosition(new LatLng(32.64598600000001, -115.44252899999998)); Estacion3.SetTitle("ESTACIÓN DE POLICÍA PRIMERO DE DICIEMBRE"); Estacion3.SetSnippet("Numero telefonico: 01 686 564 9130"); Estacion3.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.poli_opt)); GMap.AddMarker(Estacion1); GMap.AddMarker(Estacion2); GMap.AddMarker(Estacion3); }
public void OnMapReady(GoogleMap googleMap) { CameraUpdate center = CameraUpdateFactory.NewLatLng(new LatLng(40.5187, -74.4121)); CameraUpdate zoom = CameraUpdateFactory.ZoomTo(12); googleMap.MoveCamera(center); googleMap.AnimateCamera(zoom); googleMap.MapType = GoogleMap.MapTypeNormal; googleMap.UiSettings.ZoomControlsEnabled = true; googleMap.UiSettings.CompassEnabled = true; MarkerOptions Doctor1 = new MarkerOptions(); Doctor1.SetPosition(new LatLng(40.597470, -74.359500)); Doctor1.SetTitle("Janine Jamieson,D.O"); Doctor1.SetSnippet("Number:(908) 834-8343"); googleMap.AddMarker(Doctor1); MarkerOptions Doctor2 = new MarkerOptions(); Doctor2.SetPosition(new LatLng(40.571550, -74.355140)); Doctor2.SetTitle("Dr. Hitesh R. Patel, MD"); Doctor2.SetSnippet("Number:(732) 744-0634"); googleMap.AddMarker(Doctor2); MarkerOptions Doctor3 = new MarkerOptions(); Doctor3.SetPosition(new LatLng(40.541870, -74.394900)); Doctor3.SetTitle("Edison Wellness Medical Group: Hao Zhang, MD"); Doctor3.SetSnippet("Number:(732) 201-6985"); googleMap.AddMarker(Doctor3); }
private void ZoomToDefaultView() { // LiveViewModel viewModel = (LiveViewModel)this.ViewModel; this.Map.AnimateCamera(CameraUpdateFactory.ZoomTo(8)); // this.UpdateMap(viewModel.Vehicles, animated: false); }
protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { base.OnElementPropertyChanged(sender, e); if (e.PropertyName == MapView.VisibleBoundsProperty.PropertyName) { OnMapRegionChanged(); } else if (e.PropertyName == MapView.CenterProperty.PropertyName) { FocustoLocation(new LatLng(Element.Center.Lat, Element.Center.Long)); } else if (e.PropertyName == MapView.MapStyleProperty.PropertyName && map != null) { UpdateMapStyle(); } else if (e.PropertyName == MapView.PitchEnabledProperty.PropertyName) { if (map != null) { map.UiSettings.TiltGesturesEnabled = Element.PitchEnabled; } } else if (e.PropertyName == MapView.PitchProperty.PropertyName) { map?.AnimateCamera(CameraUpdateFactory.TiltTo(Element.Pitch)); } else if (e.PropertyName == MapView.RotateEnabledProperty.PropertyName) { if (map != null) { map.UiSettings.RotateGesturesEnabled = Element.RotateEnabled; } } else if (e.PropertyName == MapView.RotatedDegreeProperty.PropertyName) { map?.AnimateCamera(CameraUpdateFactory.BearingTo(Element.RotatedDegree)); } else if (e.PropertyName == MapView.ZoomLevelProperty.PropertyName && map != null) { if (Element.ZoomLevel.HasValue == false) { return; } var dif = Math.Abs(map.CameraPosition.Zoom - Element.ZoomLevel.Value); System.Diagnostics.Debug.WriteLine( $"Current zoom: {map.CameraPosition.Zoom} - New zoom: {Element.ZoomLevel}"); if (dif >= double.Epsilon && cameraBusy == false) { System.Diagnostics.Debug.WriteLine("Updating zoom level"); map.AnimateCamera(CameraUpdateFactory.ZoomTo(Element.ZoomLevel.Value)); } } else if (e.PropertyName == MapView.AnnotationsProperty.PropertyName) { } else if (e.PropertyName == MapView.RenderTextureModeProperty.PropertyName) { // TODO Set RenderTextureModeProperty } else if (e.PropertyName == MapView.RenderTextureTranslucentSurfaceProperty.PropertyName) { // TODO Set RenderTextureTranslucentSurfaceProperty } }
public void OnMapReady(GoogleMap map) { pinproccessor(map); map.MyLocationEnabled = true; map.MyLocationChange += (latitude, longitude) => { var latitude1 = latitude; var longitude1 = longitude; }; map.MoveCamera( CameraUpdateFactory.NewLatLng( new LatLng(39.8283, -98.5795))); map.AnimateCamera( CameraUpdateFactory.ZoomTo(3)); Button button = FindViewById <Button>(Resource.Id.button); Button button2 = FindViewById <Button>(Resource.Id.button_2); button2.Visibility = ViewStates.Invisible; Button button3 = FindViewById <Button>(Resource.Id.button_3); button3.Visibility = ViewStates.Invisible; Button button4 = FindViewById <Button>(Resource.Id.button_4); button4.Visibility = ViewStates.Invisible; Button button5 = FindViewById <Button>(Resource.Id.button_5); button5.Visibility = ViewStates.Invisible; Button button6 = FindViewById <Button>(Resource.Id.safehouse); EditText supplies = FindViewById <EditText>(Resource.Id.supplies); supplies.Visibility = ViewStates.Invisible; TextView supplies_text = FindViewById <TextView>(Resource.Id.supplies_text); supplies_text.Visibility = ViewStates.Invisible; TextView pins = FindViewById <TextView>(Resource.Id.pins); TextView water = FindViewById <TextView>(Resource.Id.water); water.Visibility = ViewStates.Invisible; TextView fire = FindViewById <TextView>(Resource.Id.fire); fire.Visibility = ViewStates.Invisible; TextView debris = FindViewById <TextView>(Resource.Id.debris); debris.Visibility = ViewStates.Invisible; TextView road = FindViewById <TextView>(Resource.Id.road); road.Visibility = ViewStates.Invisible; button.Click += (o, e) => { if (pins.Visibility == ViewStates.Invisible) { pins.Visibility = ViewStates.Visible; } else { pins.Visibility = ViewStates.Invisible; } if (button2.Visibility == ViewStates.Invisible) { button2.Visibility = ViewStates.Visible; } else { button2.Visibility = ViewStates.Invisible; } if (water.Visibility == ViewStates.Invisible) { water.Visibility = ViewStates.Visible; } else { water.Visibility = ViewStates.Invisible; } if (fire.Visibility == ViewStates.Invisible) { fire.Visibility = ViewStates.Visible; } else { fire.Visibility = ViewStates.Invisible; } if (button3.Visibility == ViewStates.Invisible) { button3.Visibility = ViewStates.Visible; } else { button3.Visibility = ViewStates.Invisible; } if (debris.Visibility == ViewStates.Invisible) { debris.Visibility = ViewStates.Visible; } else { debris.Visibility = ViewStates.Invisible; } if (button4.Visibility == ViewStates.Invisible) { button4.Visibility = ViewStates.Visible; } else { button4.Visibility = ViewStates.Invisible; } if (road.Visibility == ViewStates.Invisible) { road.Visibility = ViewStates.Visible; } else { road.Visibility = ViewStates.Invisible; } if (button5.Visibility == ViewStates.Invisible) { button5.Visibility = ViewStates.Visible; } else { button5.Visibility = ViewStates.Invisible; } }; var markerlist = new List <Marker>(); button2.Click += (o, e) => { MarkerOptions markerOpt1 = new MarkerOptions(); markerOpt1.SetPosition(new LatLng(latitude, longitude)); Title = "Water Hazard"; markerOpt1.SetTitle(Title); var bmDescriptor = BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueAzure); markerOpt1.SetIcon(bmDescriptor); markerOpt1.Visible(true); markerOpt1.Draggable(true); Marker newe = map.AddMarker(markerOpt1); markerlist.Append(newe); string email = Intent.GetStringExtra("email") ?? "0"; string url = "http://35.22.42.160:3000/pins?name=" + Title + "&lat=" + latitude + "&lon=" + longitude + "&type=water&email=" + email; FetchDBAsync(url, "GET"); }; button3.Click += (o, e) => { MarkerOptions markerOpt1 = new MarkerOptions(); markerOpt1.SetPosition(new LatLng(latitude, longitude)); Title = "Fire Hazard"; markerOpt1.SetTitle(Title); var bmDescriptor = BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueRed); markerOpt1.SetIcon(bmDescriptor); markerOpt1.Visible(true); markerOpt1.Draggable(true); Marker newe = map.AddMarker(markerOpt1); markerlist.Append(newe); string email = Intent.GetStringExtra("email") ?? "0"; string url = "http://35.22.42.160:3000/pins?name=" + Title + "&lat=" + latitude + "&lon=" + longitude + "&type=fire&email=" + email; FetchDBAsync(url, "GET"); Console.Out.Write(markerlist.ToString()); }; button4.Click += (o, e) => { MarkerOptions markerOpt1 = new MarkerOptions(); markerOpt1.SetPosition(new LatLng(latitude, longitude)); Title = "Debris Hazard"; markerOpt1.SetTitle(Title); var bmDescriptor = BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueYellow); markerOpt1.SetIcon(bmDescriptor); markerOpt1.Visible(true); markerOpt1.Draggable(true); Marker newe = map.AddMarker(markerOpt1); markerlist.Append(newe); string email = Intent.GetStringExtra("email") ?? "0"; string url = "http://35.22.42.160:3000/pins?name=" + Title + "&lat=" + latitude + "&lon=" + longitude + "&type=debris&email=" + email; FetchDBAsync(url, "GET"); }; button5.Click += (o, e) => { MarkerOptions markerOpt1 = new MarkerOptions(); markerOpt1.SetPosition(new LatLng(latitude, longitude)); Title = "Closed Road"; markerOpt1.SetTitle(Title); var bmDescriptor = BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueOrange); markerOpt1.SetIcon(bmDescriptor); markerOpt1.Visible(true); markerOpt1.Draggable(true); Marker newe = map.AddMarker(markerOpt1); markerlist.Append(newe); string email = Intent.GetStringExtra("email") ?? "0"; string url = "http://35.22.42.160:3000/pins?name=" + Title + "&lat=" + latitude + "&lon=" + longitude + "&type=safehouse&email=" + email; FetchDBAsync(url, "GET"); }; button6.Click += (o, e) => { //supplies.Visibility = ViewStates.Visible; //supplies_text.Visibility = ViewStates.Visible; MarkerOptions markerOpt1 = new MarkerOptions(); markerOpt1.SetPosition(new LatLng(latitude, longitude)); Title = "Safe House"; markerOpt1.SetTitle(Title); var bmDescriptor = BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueGreen); markerOpt1.SetIcon(bmDescriptor); markerOpt1.Visible(true); markerOpt1.Draggable(true); Marker newe = map.AddMarker(markerOpt1); markerlist.Append(newe); string email = Intent.GetStringExtra("email") ?? "0"; string url = "http://35.22.42.160:3000/pins?name=" + Title + "&lat=" + latitude + "&lon=" + longitude + "&type=safehouse&email=" + email; FetchDBAsync(url, "GET"); }; }