Example #1
0
        /// <summary>
        /// 添加标记 线程安全
        /// </summary>
        /// <param name="marker"></param>
        public void AddMarker(MarkerBase marker, bool ifExitsUpdate = false)
        {
            if (marker != null && !string.IsNullOrEmpty(marker.Name))
            {
                marker.Owner = this;

                lock (_dicMarker)
                {
                    if (_dicMarker.ContainsKey(marker.Name))
                    {
                        if (ifExitsUpdate)
                        {
                            _dicMarker[marker.Name] = marker;
                            AddToolTipEvent(marker.ToolTip);
                        }
                    }
                    else
                    {
                        _dicMarker.Add(marker.Name, marker);
                        AddToolTipEvent(marker.ToolTip);
                    }
                }
            }
            else
            {
                throw new Exception("marker.Name不能为空!");
            }
        }
Example #2
0
        /// <summary>
        /// 获取标记 线程安全
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public MarkerBase GetMarker(string name)
        {
            MarkerBase m = null;

            lock (_dicMarker)
            {
                _dicMarker.TryGetValue(name, out m);
            }
            return(m);
        }
Example #3
0
        private void RefreshMarker(MarkerBase m)
        {
            if (m.ScreenArea.IsEmpty)
            {
                MapObject.Refresh();
            }
            else
            {
                MapObject.Invalidate(m.ScreenArea);

                //if (m.ToolTip!=null)
                //{
                //    MapObject.Invalidate(m.ToolTip.ViewRect);
                //}

                MapObject.Update();
            }
        }
Example #4
0
 public MarkerToolTip(MarkerBase m)
 {
     Marker = m;
     //Stroke = new Pen(new SolidBrush(Color.FromArgb(0xee, 0xff, 0x83, 0xfa)), 1);
 }
Example #5
0
 public MarkerRoundedToolTip(MarkerBase m) : base(m)
 {
 }