Beispiel #1
0
 /// <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);
     }
 }
Beispiel #2
0
 /// <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);
 }
Beispiel #3
0
        /// <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);
            }
        }
Beispiel #4
0
        /// <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);
        }
Beispiel #5
0
        /// <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);
            }
        }
Beispiel #6
0
        /// <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;
        }
Beispiel #7
0
        /// <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();
            }
        }
Beispiel #8
0
 /// <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;
 }
Beispiel #9
0
        /// <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);
            }
        }
Beispiel #10
0
        /// <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);
            }
        }
Beispiel #11
0
        /// <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);
            }
        }
Beispiel #12
0
 /// <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())
 {
 }
Beispiel #13
0
 /// <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())
 {
 }
Beispiel #14
0
 /// <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())
 {
 }