private void OnRequestChanged(MoveToRegionRequest oldValue, MoveToRegionRequest newValue) { if (oldValue != null) { oldValue.MoveToRegionRequested -= OnMoveToRegionRequested; } if (newValue != null) { newValue.MoveToRegionRequested += OnMoveToRegionRequested; } }
private void UpdateMap(Plugin.Geolocator.Abstractions.Position position) { try { var gFormsPos = new Xamarin.Forms.GoogleMaps.Position(position.Latitude, position.Longitude); MyLocation.Clear(); MyLocation.Add(new Pin() { Position = gFormsPos, Label = "My Position" }); MoveToRegionRequest.MoveToRegion(MapSpan.FromCenterAndRadius(gFormsPos, Distance.FromKilometers(1))); } catch (Exception ex) { Console.WriteLine(ex.Message); } }