Exemple #1
0
        public TrackControl()
        {
            InitializeComponent();

            if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)
                return;

            _Bitmap = null;
            _Zoom = 1;
            _XCategory = DrawCategory.LongitudeKm;
            _YCategory = DrawCategory.LatitudeKm;
            _UseEqualScale = false;
            _Selecting = false;
            _DrawWaypoints = false;
            _DrawTrackLine = false;
            _ShowAllPointsOfSegment = true;
            _IndexOfFirstPointShown = 1;
            _IndexOfLastPointShown = 100000;

            //For maps
            {
                timer1 = new Timer(this.components);
                timer1.Interval = 2500;
                timer1.Tick += new System.EventHandler(this.timer1_Tick);

                GMap.NET.CacheProviders.FilePureImageCache imageCache = new GMap.NET.CacheProviders.FilePureImageCache();
                string cacheLocation = Defaults.GMapsFileCacheLocation;
                imageCache.CacheLocation = cacheLocation;
                GMap.NET.Internals.Cache.Instance.ImageCache = imageCache;

                GMap.NET.GMaps.Instance.ImageProxy = new GMap.NET.WindowsForms.WindowsFormsImageProxy();
                GMap.NET.GMaps.Instance.UseGeocoderCache = true;
                GMap.NET.GMaps.Instance.UseMemoryCache = true;
                GMap.NET.GMaps.Instance.UsePlacemarkCache = true;

                _Core = GMap.NET.Internals.Core.Instance;
                _Core.MapType = GMap.NET.MapType.GoogleSatellite;
                _Core.Projection = new GMap.NET.Projections.MercatorProjection();

                _Core.OnNeedInvalidation += new GMap.NET.NeedInvalidation(Core_OnNeedInvalidation);
                _Core.StartSystem();
            }
        }