Пример #1
0
        /// <summary>
        /// Returns the mapmarkers list.
        /// </summary>
        /// <value>The markers.</value>
        public void AddMarker(MapMarker marker)
        {
            if (marker == null)
            {
                throw new ArgumentNullException("marker");
            }
            ;

            _markers.Add(marker);              // add to marker list.
            marker.AttachTo(this);             // attach to this view.

            var layoutParams = new FrameLayout.LayoutParams(marker.Image.Width, marker.Image.Height + 5);

            layoutParams.LeftMargin = -1;
            layoutParams.TopMargin  = -1;
            layoutParams.Gravity    = GravityFlags.Top | GravityFlags.Left;
            this.AddView(marker, layoutParams);

            _mapView.Change();
        }
Пример #2
0
        /// <summary>
        /// Returns the mapmarkers list.
        /// </summary>
        /// <value>The markers.</value>
        public void AddMarker(MapMarker marker)
        {
            if (marker == null)
            {
                throw new ArgumentNullException("marker");
            }

            lock (_markers)
            {
                if (marker.Image == null)
                {
                    return;
                }

                _markers.Add(marker);  // add to marker list.
                marker.AttachTo(this); // attach to this view.

                this.AddView(marker.View, marker.View.LayoutParameters);
            }
            this.NotifyControlChange(marker);
            _mapView.TriggerRendering();
        }
Пример #3
0
        /// <summary>
        /// Returns the mapmarkers list.
        /// </summary>
        /// <value>The markers.</value>
        public void AddMarker(MapMarker marker)
        {
            if (marker == null)
            {
                throw new ArgumentNullException("marker");
            }

            lock (_markers)
            {
                if (marker.Image == null)
                    return;

                _markers.Add(marker); // add to marker list.
                marker.AttachTo(this); // attach to this view.

                this.AddView(marker.View, marker.View.LayoutParameters);
            }
            this.NotifyControlChange(marker);
            _mapView.TriggerRendering();
        }
Пример #4
0
        /// <summary>
        /// Returns the mapmarkers list.
        /// </summary>
        /// <value>The markers.</value>
        public void AddMarker(MapMarker marker)
        {
            if (marker == null) { throw new ArgumentNullException("marker"); };

            _markers.Add (marker); // add to marker list.
            marker.AttachTo (this); // attach to this view.

            var layoutParams = new FrameLayout.LayoutParams (marker.Image.Width, marker.Image.Height + 5);
            layoutParams.LeftMargin = -1;
            layoutParams.TopMargin = -1;
            layoutParams.Gravity = GravityFlags.Top | GravityFlags.Left;
            this.AddView (marker, layoutParams);

            _mapView.Change ();
        }