Map pin
Inheritance: BindableObject
Beispiel #1
0
        private void RemovePin(MapPin pin)
        {
            var pinToRemove = _dict.Pins.GetNative(pin);

            if (pinToRemove == null)
            {
                return;
            }

            _renderer.RemoveNativePin(pinToRemove);
            _dict.Pins.Remove(pin);
            UnbindPin(pin);
        }
Beispiel #2
0
 private void UnbindPin(MapPin pin)
 {
     pin.PropertyChanged -= pin_PropertyChanged;
 }
Beispiel #3
0
        private void RemoveMarker(MapPin pin)
        {
            if (Markers.ContainsKey(pin) == false)
                return;

            var markerToRemove = Markers[pin];

            markerToRemove.Remove();
            markerToRemove.Dispose();
            UnbindPin(pin);
            Markers.Remove(pin);
        }
Beispiel #4
0
 private void BindPin(MapPin pin)
 {
     pin.PropertyChanged += pin_PropertyChanged;
 }
Beispiel #5
0
 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);
     }
 }
Beispiel #6
0
 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();
     }
 }
Beispiel #7
0
        private void AddPin(MapPin pin)
        {
            var nativePin = _renderer.AddNativePin(pin);

            _dict.Pins.AddOrUpdate(pin, nativePin);
        }
Beispiel #8
0
 private void UnbindPin(MapPin pin)
 {
     pin.PropertyChanged -= pin_PropertyChanged;
 }
Beispiel #9
0
 private void BindPin(MapPin pin)
 {
     pin.PropertyChanged += pin_PropertyChanged;
 }