internal void GetMvxBindingMarker(Marker marker, IBindingMapAnnotation annotation) { MvxBindingMarker result = GetMvxBindingMarker(); result.Marker = marker; result.DataContext = annotation; }
public MarkerOptions GetMarkerOptionsForPin(IBindingMapAnnotation pin) { MarkerOptions markerOptions = null; if (pin is ExampleBindingAnnotation mPin) { markerOptions = new MarkerOptions(); markerOptions.SetPosition(new LatLng(pin.Location.Latitude, pin.Location.Longitude)) .SetTitle(mPin.Id.ToString()) .Draggable(true); switch (mPin.Id) { case 1: markerOptions.SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueBlue)); break; case 2: markerOptions.SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueRed)); break; case 3: markerOptions.SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueGreen)); break; case 4: markerOptions.SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueYellow)); break; case 5: markerOptions.SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueViolet)); break; } } return(markerOptions); }
public override MarkerOptions GetMarkerOptionsForPin(IBindingMapAnnotation pin) { MarkerOptions markerOptions = null; if (pin is ExampleBindingAnnotation mPin) { markerOptions = new MarkerOptions(); markerOptions.SetPosition(new LatLng(pin.Location.Latitude, pin.Location.Longitude)) .SetTitle(mPin.Id.ToString()) .SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.sphere)); } return(markerOptions); }
public override void AddAnnotation(IBindingMapAnnotation annotation) { if (annotation is IBindingMapAnnotation mMarker) { using (MarkerOptions markerOptions = GetMarkerOptionsForPin(annotation)) if (markerOptions != null) { MvxBindingMarker result = GetMvxBindingMarker(); result.DataContext = annotation; markerOptions.SetIcon(result.GetIcon()); Marker marker = MapView.GoogleMap.AddMarker(markerOptions); result.Marker = marker; marker.Tag = new AnnotationTag { Annotation = annotation }; if (_markers == null) { _markers = new List <Marker>(); } _markers.Add(marker); } } }
public virtual MKAnnotationView GetViewForBindingAnnotation(MKMapView mapView, IBindingMapAnnotation bindingMapAnnotation) => null;
public override MKAnnotationView GetViewForBindingAnnotation(MKMapView mapView, IBindingMapAnnotation bindingMapAnnotation) { if (bindingMapAnnotation is ExampleBindingAnnotation eAnno) { var view = mapView.DequeueReusableAnnotation(eAnno.Id + ""); var annotation = new BindingMKAnnotation(bindingMapAnnotation); annotation.SetTitle(eAnno.Id + ""); annotation.SetSubtitle(eAnno.Id + ""); if (view == null) { view = new MKAnnotationView(annotation, eAnno.Id + ""); } else { view.Annotation = annotation; } view.Image = UIImage.FromBundle("Images/sphere"); return(view); } return(null); }
public override MarkerOptions GetMarkerOptionsForPin(IBindingMapAnnotation pin) { return(new MarkerOptions().SetPosition(pin.Location.ToLatLng())); }
public BindingMKAnnotation(IBindingMapAnnotation anno) { Annotation = anno; SetBindingCoordinate(anno.Location.ToCLLocationCoordinate2D()); }
public abstract MarkerOptions GetMarkerOptionsForPin(IBindingMapAnnotation pin);
public override int?GetViewIdForInfoContent(IBindingMapAnnotation annotation) => Resource.Layout.item_info_window;
public virtual int?GetViewIdForInfoContent(IBindingMapAnnotation annotation) => null;
public BindingMKAnnotation(IBindingMapAnnotation anno) { Annotation = anno; }
public override MKAnnotationView GetViewForBindingAnnotation(MKMapView mapView, IBindingMapAnnotation bindingMapAnnotation) { if (bindingMapAnnotation is ExampleBindingAnnotation eAnno) { MKAnnotationView view = mapView.DequeueReusableAnnotation(eAnno.Id + ""); var annotation = new BindingMKAnnotation(bindingMapAnnotation); annotation.SetTitle(eAnno.Id + ""); annotation.SetSubtitle(eAnno.Id + ""); if (view == null) { view = new MKAnnotationView(annotation, eAnno.Id + ""); } else { view.Annotation = annotation; } view.CanShowCallout = false; view.Draggable = true; switch (eAnno.Id) { case 1: view.Image = UIImage.FromBundle("Images/marker_a"); break; case 2: view.Image = UIImage.FromBundle("Images/marker_b"); break; case 3: view.Image = UIImage.FromBundle("Images/marker_c"); break; case 4: view.Image = UIImage.FromBundle("Images/marker_d"); break; case 5: view.Image = UIImage.FromBundle("Images/marker_e"); break; } return(view); } return(null); //Lets the map default behavior take over if the annotation isnt a BindingMKAnnotation. }
public sealed override BindingMKCalloutView GetViewForCallout(MKMapView mapView, IBindingMapAnnotation bindingMapAnnotation) { var view = GetViewForCallout(mapView); if (view != null) { view.DataContext = bindingMapAnnotation; } return(view); }
public sealed override BindingMKAnnotationView GetViewForBindingAnnotation(MKMapView mapView, IBindingMapAnnotation bindingMapAnnotation) { var anno = GetViewForBindingAnnotation(mapView); anno.DataContext = bindingMapAnnotation; return(anno); }