Map pin
Inheritance: BindableObject
示例#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);
        }
示例#2
0
 private void UnbindPin(MapPin pin)
 {
     pin.PropertyChanged -= pin_PropertyChanged;
 }
示例#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);
        }
示例#4
0
 private void BindPin(MapPin pin)
 {
     pin.PropertyChanged += pin_PropertyChanged;
 }
示例#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);
     }
 }
示例#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();
     }
 }
示例#7
0
        private void AddPin(MapPin pin)
        {
            var nativePin = _renderer.AddNativePin(pin);

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