Example #1
0
        public void Init(GMAP mapCtl)
        {
            m_mapCtl = mapCtl;


            //System.Net.IPHostEntry e = System.Net.Dns.GetHostEntry("ditu.google.cn");
            //mapControl.MapProvider = GMapProviders.GoogleChinaMap;

            m_mapCtl.MapProvider = AMapProvider.Instance;

            //m_mapCtl.Manager.Mode = AccessMode.CacheOnly;
            m_mapCtl.Manager.Mode = AccessMode.ServerAndCache;

            m_mapCtl.Position = new PointLatLng(39, 115);

            m_mapCtl.MinZoom = 4;  //最小缩放
            m_mapCtl.MaxZoom = 18; //最大缩放
            m_mapCtl.Zoom    = 11; //当前缩放


            m_mapCtl.ShowCenter = false;            //不显示中心十字点
            m_mapCtl.DragButton = MouseButton.Left; //左键拖拽地图

            //new Thread(() => GMaps.Instance.ImportFromGMDB(@"C:\Data.gmdb")).Start();

            m_mapCtl.MouseRightButtonDown += mapControl_MouseLeftButtonDown;
        }
Example #2
0
        public RedMarker(GMAP gmap,GMapMarker marker, string title)
        {
            this.InitializeComponent();
            this.gmap = gmap;
            //this.MapTest = window;
            this.Marker = marker;

            Popup = new Popup();
            Label = new Label();

            this.Loaded += new RoutedEventHandler(CustomMarkerDemo_Loaded);
            this.SizeChanged += new SizeChangedEventHandler(CustomMarkerDemo_SizeChanged);
            this.MouseEnter += new MouseEventHandler(MarkerControl_MouseEnter);
            this.MouseLeave += new MouseEventHandler(MarkerControl_MouseLeave);
            this.MouseMove += new MouseEventHandler(CustomMarkerDemo_MouseMove);
            this.MouseLeftButtonUp += new MouseButtonEventHandler(CustomMarkerDemo_MouseLeftButtonUp);
            this.MouseLeftButtonDown += new MouseButtonEventHandler(CustomMarkerDemo_MouseLeftButtonDown);
            this.TouchMove += new System.EventHandler<TouchEventArgs>(CustomMarkerDemo_TouchMove);
            this.TouchDown += new System.EventHandler<TouchEventArgs>(CustomMarkerDemo_TouchDown);

            Popup.Placement = PlacementMode.Mouse;
            {
                Label.Background = Brushes.Blue;
                Label.Foreground = Brushes.White;
                Label.BorderBrush = Brushes.WhiteSmoke;
                Label.BorderThickness = new Thickness(2);
                Label.Padding = new Thickness(5);
                Label.FontSize = 22;
                Label.Content = title;
            }
            Popup.Child = Label;
        }
Example #3
0
        public void Add_Empty_Path(Waypoint_Path_Gen wpg, GMAP gmap, string name, string type)
        {
            _wpg  = wpg;
            _gmap = gmap;
            int id = wpg.PathCount();

            Models.Path new_path = new Models.Path();
            new_path.id        = id;
            new_path.name      = name;
            new_path.type      = type;
            new_path.selected  = false;
            new_path.visible   = true;
            new_path.waypoints = null;
            _wpg.AddPath(new_path);
            //Update_GMapTree();
            _gmap.Add_gMapPath(new_path, true);
        }