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

            pageGps       = new GPS(this);
            pageTransport = new Transport(this);
            pageSearch    = new Search(this);

#if DEBUG
            MainMap.Manager.Mode           = AccessMode.ServerAndCache;
            menuItemServerAndCache.Checked = true;
            menuItemEnableGrid.Checked     = true;
            menuItemGPSenabled.Checked     = false;
            MainMap.ShowTileGridLines      = true;
#else
            MainMap.Manager.Mode      = AccessMode.CacheOnly;
            menuItemCacheOnly.Checked = true;
#endif
            MainMap.MapProvider = GMapProviders.LithuaniaMap;
            MainMap.MaxZoom     = 11;
            MainMap.MinZoom     = 1;
            MainMap.Zoom        = MainMap.MinZoom + 1;
            MainMap.Position    = start;

            MainMap.OnMapTypeChanged += new MapTypeChanged(MainMap_OnMapTypeChanged);
            MainMap.OnMapZoomChanged += new MapZoomChanged(MainMap_OnMapZoomChanged);

            // add custom layers
            {
                routes = new GMapOverlay("routes");
                MainMap.Overlays.Add(routes);

                objects = new GMapOverlay("objects");
                MainMap.Overlays.Add(objects);

                top = new GMapOverlay("top");
                MainMap.Overlays.Add(top);
            }

            // gps pos
            gpsPos           = new GMarkerCross(MainMap.Position);
            gpsPos.IsVisible = false;
            top.Markers.Add(gpsPos);

#if DEBUG
            // transparent marker test
            GMapMarkerTransparentGoogleGreen goo = new GMapMarkerTransparentGoogleGreen(MainMap.Position);
            goo.ToolTipMode = MarkerTooltipMode.Always;
            goo.ToolTipText = "Welcome to Lithuania! ;}";
            objects.Markers.Add(goo);
#endif

            // hook for volume up/down zooming
            hook.HookEvent += new HookKeys.HookEventHandler(hook_HookEvent);

            // test performance
            if (PerfTestEnabled)
            {
                timer.Interval = 111;
                timer.Tick    += new EventHandler(timer_Tick);
                timer.Enabled  = true;
            }
        }
Exemple #2
0
        public MainForm()
        {
            InitializeComponent();

             pageGps = new GPS(this);
             pageTransport = new Transport(this);
             pageSearch = new Search(this);

            #if DEBUG
             MainMap.Manager.Mode = AccessMode.ServerAndCache;
             menuItemServerAndCache.Checked = true;
             menuItemEnableGrid.Checked = true;
             menuItemGPSenabled.Checked = false;
             MainMap.ShowTileGridLines = true;
            #else
             menuItemGPSenabled.Checked = false;
             MainMap.Manager.Mode = AccessMode.CacheOnly;
             menuItemCacheOnly.Checked = true;
            #endif
             MainMap.MapProvider = GMapProviders.LithuaniaMap;
             MainMap.MaxZoom = 11;
             MainMap.MinZoom = 1;
             MainMap.Zoom = MainMap.MinZoom + 1;
             MainMap.Position = start;

             MainMap.OnMapTypeChanged += new MapTypeChanged(MainMap_OnMapTypeChanged);
             MainMap.OnMapZoomChanged += new MapZoomChanged(MainMap_OnMapZoomChanged);
             MainMap.OnPositionChanged += new PositionChanged(MainMap_OnPositionChanged);

             // add custom layers
             {
            objects = new GMapOverlay("objects");
            MainMap.Overlays.Add(objects);

            top = new GMapOverlay("top");
            MainMap.Overlays.Add(top);
             }

             // gps pos
             gpsPos = new GMarkerCross(MainMap.Position);
             gpsPos.IsVisible = false;
             top.Markers.Add(gpsPos);

            #if DEBUG
             // transparent marker test
             GMapMarkerTransparentGoogleGreen goo = new GMapMarkerTransparentGoogleGreen(MainMap.Position);
             goo.ToolTipMode = MarkerTooltipMode.Always;
             goo.ToolTipText = "Welcome to Lithuania! ;}";
             objects.Markers.Add(goo);
            #endif

             // hook for volume up/down zooming
             hook.HookEvent += new HookKeys.HookEventHandler(hook_HookEvent);

             // test performance
             if(PerfTestEnabled)
             {
            timer.Interval = 111;
            timer.Tick += new EventHandler(timer_Tick);
            timer.Enabled = true;
             }
        }
Exemple #3
0
        public MainForm()
        {
            InitializeComponent();

             pageGps = new GPS(this);
             pageTransport = new Transport(this);
             pageSearch = new Search(this);

            #if DEBUG
             MainMap.Manager.Mode = AccessMode.ServerAndCache;
             menuItemServerAndCache.Checked = true;
             menuItemEnableGrid.Checked = true;
             menuItemGPSenabled.Checked = false;
             MainMap.ShowTileGridLines = true;
            #else
             MainMap.Manager.Mode = AccessMode.CacheOnly;
             menuItemCacheOnly.Checked = true;
            #endif
             MainMap.MapType = MapType.MapsLT_Map;
             MainMap.MaxZoom = 11;
             MainMap.MinZoom = 1;
             MainMap.Zoom = MainMap.MinZoom + 1;
             MainMap.CurrentPosition = start;

             MainMap.OnMapTypeChanged += new MapTypeChanged(MainMap_OnMapTypeChanged);
             MainMap.OnCurrentPositionChanged += new CurrentPositionChanged(MainMap_OnCurrentPositionChanged);
             MainMap.OnMapZoomChanged += new MapZoomChanged(MainMap_OnMapZoomChanged);

             // add custom layers
             {
            routes = new GMapOverlay(MainMap, "routes");
            MainMap.Overlays.Add(routes);

            objects = new GMapOverlay(MainMap, "objects");
            MainMap.Overlays.Add(objects);

            top = new GMapOverlay(MainMap, "top");
            MainMap.Overlays.Add(top);
             }

             // map center
             center = new GMapMarkerCross(MainMap.CurrentPosition);
             top.Markers.Add(center);

            #if DEBUG
             // transparent marker test
             GMapMarkerTransparentGoogleGreen goo = new GMapMarkerTransparentGoogleGreen(MainMap.CurrentPosition);
             goo.ToolTipMode = MarkerTooltipMode.Always;
             goo.ToolTipText = "Welcome to Lithuania! ;}";
             objects.Markers.Add(goo);
            #endif

             UnregisterFunc1(0, 0x75); // VOLUME UP
             UnregisterFunc1(0, 0x76); // VOLUME DOWN
             msgW = new MsgWindow(this);
             RegisterHotKey(msgW.Hwnd, 3, 0, 0x75);
             RegisterHotKey(msgW.Hwnd, 4, 0, 0x76);

             // test performance
             if(PerfTestEnabled)
             {
            timer.Interval = 111;
            timer.Tick += new EventHandler(timer_Tick);
            timer.Enabled = true;
             }
        }