none
GMap.Net 离线加载gmdb文件 RRS feed

  • 问题

  • 大家好,我目前在使用GMap.NET.Core.dll,GMap.NET.WindowsForms.dll,GMap.NET.WindowsPresentation.dll等3个开发包,在WPF中加载离线地图,可是,离线地图怎么也显示不了,相关代码:

     mapControl = new GMapControl();
     MapBorder.Child = mapControl;

    mapControl.Loaded += (s, ee) =>
                {

                    mapControl.Manager.Mode = AccessMode.CacheOnly;
                    mapControl.MapType = MapType.GoogleMapChina;
                    mapControl.MinZoom = 8;  //最小缩放
                    mapControl.MaxZoom = 18; //最大缩放
                    mapControl.Zoom = 12;     //当前缩放
                    mapControl.ShowCenter = false; //不显示中心十字点
                    mapControl.DragButton = MouseButton.Left; //左键拖拽地图
                    mapControl.Position = new PointLatLng(32.064, 118.704); //地图中心位置:南京

    GMaps.Instance.ImportFromGMDB(System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, "Data.gmdb"));               

                };     

    public class MapManagerLoader
        {
            private static readonly MapManagerLoader _instance = new MapManagerLoader();

            public static MapManagerLoader Instance
            {
                get { return _instance; }
            }

            private MapManagerLoader()
            {
            }

            private bool _isLoaded;

            public bool Load(string fileName)
            {
                if (!_isLoaded)
                {
                    new Thread(() => GMaps.Instance.ImportFromGMDB(fileName)).Start();
                    _isLoaded = true;
                }
                return _isLoaded;
            }

        }

    请高人指点一下,谢谢
    • 已编辑 Ocean He 2015年7月27日 10:35
    2015年7月27日 10:34

答案

  • 你好,

    我建议你把相关的问题提到GMap的相关论坛,他们的一些类怎么使用我们也不是很熟悉:

    http://greatmaps.codeplex.com/discussions


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2015年7月28日 5:40
    版主