private void AddPin(ExtendedPin formsPin) { var androidMapView = (MapView) Control; var markerWithIcon = new MarkerOptions(); markerWithIcon.SetPosition(new LatLng(formsPin.Position.Latitude, formsPin.Position.Longitude)); markerWithIcon.SetTitle(formsPin.Label); markerWithIcon.SetSnippet(formsPin.Address); if (!string.IsNullOrEmpty(formsPin.PinIcon)) { markerWithIcon.InvokeIcon(BitmapDescriptorFactory.FromResource(GetResourceIdByName(formsPin.PinIcon))); } else markerWithIcon.InvokeIcon(BitmapDescriptorFactory.DefaultMarker()); androidMapView.Map.AddMarker(markerWithIcon); }
private void AddPin(ExtendedPin formsPin) { var nativePin = new ExtendedMapAnnotation(new CLLocationCoordinate2D(formsPin.Position.Latitude, formsPin.Position.Longitude), formsPin.Label, formsPin.Address, formsPin.PinIcon); nativePin.Clicked += HandleAnnotationClick; _nativeMapView.AddAnnotation(nativePin); }