private void RemovePin(MapPin pin) { var pinToRemove = _dict.Pins.GetNative(pin); if (pinToRemove == null) { return; } _renderer.RemoveNativePin(pinToRemove); _dict.Pins.Remove(pin); UnbindPin(pin); }
private void UnbindPin(MapPin pin) { pin.PropertyChanged -= pin_PropertyChanged; }
private void RemoveMarker(MapPin pin) { if (Markers.ContainsKey(pin) == false) return; var markerToRemove = Markers[pin]; markerToRemove.Remove(); markerToRemove.Dispose(); UnbindPin(pin); Markers.Remove(pin); }
private void BindPin(MapPin pin) { pin.PropertyChanged += pin_PropertyChanged; }
private void AddMarker(MapPin pin) { using (var op = new MarkerOptions()) { op.SetTitle(pin.Label); op.SetPosition(pin.Position.ToLatLng()); op.SetIcon(BitmapDescriptorFactory.DefaultMarker(pin.Color.ToAndroidMarkerHue())); var marker = NativeMap.AddMarker(op); pin.Id = marker.Id; Markers.Add(pin, marker); } }
protected virtual void OnPinPropertyChanged(MapPin pin, Marker marker, PropertyChangedEventArgs e) { if (e.PropertyName == MapPin.ColorProperty.PropertyName) { marker.SetIcon(BitmapDescriptorFactory.DefaultMarker(pin.Color.ToAndroidMarkerHue())); } else if (e.PropertyName == MapPin.PositionProperty.PropertyName) { marker.Position = pin.Position.ToLatLng(); } }
private void AddPin(MapPin pin) { var nativePin = _renderer.AddNativePin(pin); _dict.Pins.AddOrUpdate(pin, nativePin); }