private void UpdateMapView() { var mapReadyCallback = new LocalMapReady(); mapReadyCallback.MapReady += (sender, args) => { // Get the map. _googleMap = (sender as LocalMapReady)?.Map; if (_googleMap == null) { return; } // Add the marker. var markerOptions = new MarkerOptions(); markerOptions.SetPosition(_rayLocation); markerOptions.SetTitle("Ray's Hot Dogs"); _googleMap.AddMarker(markerOptions); // Zoom to location. var cameraUpdate = CameraUpdateFactory.NewLatLngZoom(_rayLocation, 15); _googleMap.MoveCamera(cameraUpdate); }; // Set up the map. _mapFragment.GetMapAsync(mapReadyCallback); }
private void UpdateMapView() { var mapReadyCallback = new LocalMapReady(); mapReadyCallback.MapReady += (sender, args) => { googleMap = (sender as LocalMapReady).Map; if (googleMap != null) { MarkerOptions markerOptions = new MarkerOptions(); markerOptions.SetPosition(rayLocation); markerOptions.SetTitle("Ray's Hot Dogs"); googleMap.AddMarker(markerOptions); CameraUpdate cameraUpdate = CameraUpdateFactory.NewLatLngZoom(rayLocation, 15); googleMap.MoveCamera(cameraUpdate); } }; mapFragment.GetMapAsync(mapReadyCallback); }
private void UpdateMapView() { var mapReadyCallBack = new LocalMapReady(); mapReadyCallBack.MapReady += (sender, args) => { _googleMap = (sender as LocalMapReady).Map; if (_googleMap == null) { return; } var markerOptions = new MarkerOptions(); markerOptions.SetPosition(_rayLocation); markerOptions.SetTitle("Ray's hot dogs"); mapReadyCallBack.Map.AddMarker(markerOptions); var cameraUpdate = CameraUpdateFactory.NewLatLngZoom(_rayLocation, 15); _googleMap.MoveCamera(cameraUpdate); }; _mapFragment.GetMapAsync(mapReadyCallBack); }