public CustomMap CreateMap() { Position centre = new Position(57.1499749, -2.1950675); if (Locations.Any()) { var midPoint = Locations.Midpoint(); centre = new Position(midPoint.Latitude, midPoint.Longitude); } map = new CustomMap(MapSpan.FromCenterAndRadius(centre, Distance.FromMiles(.5)), isReadOnly); map.IsShowingUser = false; map.SetBinding(Map.MapTypeProperty, nameof(MapType), BindingMode.TwoWay); map.InputTransparent = isReadOnly; map.MapClicked += (s, e) => { if (!goToMapPageOnClick) { MapTapped?.Invoke(null, e); } }; CreatePolylinesFromLocations(); return(map); }
public CustomMap CreateMap() { Position centre = new Position(Centre.Latitude, Centre.Longitude); map = new CustomMap(MapSpan.FromCenterAndRadius(centre, Distance.FromMiles(.5)), IsReadOnly); map.IsShowingUser = false; map.SetBinding(Map.MapTypeProperty, nameof(MapType), BindingMode.TwoWay); map.InputTransparent = IsReadOnly; map.MapClicked += (s, e) => { MapTapped?.Invoke(s, e); }; CreatePolylines(); CreatePins(); return(map); }
public override async void DidDeselectAnnotationView(MKMapView mapView, MKAnnotationView view) { //Call reset with delay in case another pin is selected await Task.Delay(TimeSpan.FromMilliseconds(100)).ContinueWith((result) => { Device.BeginInvokeOnMainThread(() => { if (_previouslySelectedNativePin != null && view == _previouslySelectedNativePin) { if (MapTapped != null) { MapTapped.Invoke(this, new EventArgs()); } ResetPrevioslySelectedPin(); } }); }); }
private void DigiTransitMapControl_MapTapped(MapControl sender, MapInputEventArgs args) { System.Diagnostics.Debug.WriteLine("MapControl tapped."); MapTapped?.Invoke(sender, args); }
public void OnMapTapped(MapTappedEventArgs e) { MapTapped?.Invoke(this, e); }