/// <summary> /// Notifies the map change. /// </summary> /// <param name="pixelWidth"></param> /// <param name="pixelsHeight"></param> /// <param name="view"></param> /// <param name="projection"></param> /// <param name="mapMarker"></param> internal void NotifyMapChangeToMarker(double pixelsWidth, double pixelsHeight, View2D view, IProjection projection, MapMarker mapMarker) { if (mapMarker != null) { mapMarker.SetLayout(pixelsWidth, pixelsHeight, view, projection); } }
/// <summary> /// Removes the given map marker. /// </summary> /// <param name="marker"></param> public bool RemoveMarker(MapMarker marker) { if (marker == null) { marker.DetachFrom(this); // remove the map view. marker.RemoveFromSuperview(); return(_markers.Remove(marker)); } return(false); }
/// <summary> /// Notifies this MapView that a map marker has changed. /// </summary> /// <param name="mapMarker"></param> internal void NotifyMarkerChange(MapMarker mapMarker) { RectangleF rect = this.Frame; // notify map layout of changes. if (rect.Width > 0 && rect.Height > 0) { View2D view = this.CreateView(rect); this.NotifyMapChangeToMarker(rect.Width, rect.Height, view, this.Map.Projection, mapMarker); } }
/// <summary> /// Adds the marker. /// </summary> /// <returns>The marker.</returns> /// <param name="location">Location.</param> public MapMarker AddMarker(GeoCoordinate location) { if (location == null) { throw new ArgumentNullException("location"); } ; MapMarker marker = new MapMarker(location); this.AddMarker(marker); return(marker); }
/// <summary> /// Returns the mapmarkers list. /// </summary> /// <value>The markers.</value> public void AddMarker(MapMarker marker) { if (marker == null) { throw new ArgumentNullException("marker"); } ; marker.AttachTo(this); // attach this view to the marker. _markers.Add(marker); // add to markers list. this.Add(marker); // add to this view. RectangleF rect = this.Frame; if (rect.Width > 0 && rect.Height > 0) { View2D view = this.CreateView(rect); this.NotifyMapChangeToMarker(rect.Width, rect.Height, view, this.Map.Projection, marker); } }
/// <summary> /// Adds the marker. /// </summary> /// <returns>The marker.</returns> /// <param name="location">Location.</param> public MapMarker AddMarker(GeoCoordinate location) { if (location == null) { throw new ArgumentNullException("location"); } ; MapMarker marker = new MapMarker(location); this.AddMarker(marker); return marker; }
/// <summary> /// Returns the mapmarkers list. /// </summary> /// <value>The markers.</value> public void AddMarker(MapMarker marker) { if (marker == null) { throw new ArgumentNullException("marker"); } marker.AttachTo(this); // attach this view to the marker. _markers.Add(marker); // add to markers list. this.Add(marker.View); // add to this view. CGRect rect = this.Frame; if (rect.Width > 0 && rect.Height > 0) { View2D view = this.CreateView(rect); this.NotifyOnBeforeSetLayout(); this.NotifyMapChangeToControl(rect.Width, rect.Height, view, this.Map.Projection, marker); this.NotifyOnAfterSetLayout(); } }
/// <summary> /// Removes the given map marker. /// </summary> /// <param name="marker"></param> public bool RemoveMarker(MapMarker marker) { if (marker != null) { marker.DetachFrom(this); // remove the map view. marker.View.RemoveFromSuperview(); return _markers.Remove(marker); } return false; }
/// <summary> /// Initializes a new instance of the <see cref="SomeTestProject.MapMarker"/> class. /// </summary> /// <param name="location">Coordinate.</param> /// <param name="marker">Alignment.</param> public MapMarker(GeoCoordinate location, MapControlAlignmentType alignment) : this(location, alignment, MapMarker.GetDefaultImage()) { }
/// <summary> /// Initializes a new instance of the <see cref="SomeTestProject.MapMarker"/> class. /// </summary> /// <param name="location">Coordinate.</param> public MapMarker(GeoCoordinate location) : this(location, MapControlAlignmentType.CenterBottom, MapMarker.GetDefaultImage()) { }
/// <summary> /// Initializes a new instance of the <see cref="SomeTestProject.MapMarker"/> class. /// </summary> /// <param name="point">Point.</param> /// <param name="marker">Alignment.</param> public MapMarker(CGPoint point, MapControlAlignmentType alignment) : this(point, alignment, MapMarker.GetDefaultImage()) { }