Exemple #1
0
        public void Configure()
        {
            _map.MapFrame = new MapFrame(_map, new Extent(0, 0, 0, 0));

            //_resizeEndTimer = new Timer {Interval = 100};
            //_resizeEndTimer.Tick += _resizeEndTimer_Tick;

            IMapFunction info = new MapFunctionIdentify(_map);
            IMapFunction pan = new MapFunctionPan(_map);
            IMapFunction label = new MapFunctionLabelSelect(_map);
            IMapFunction select = new MapFunctionSelect(_map);
            IMapFunction zoomIn = new MapFunctionClickZoom(_map);
            IMapFunction zoomOut = new MapFunctionZoomOut(_map);
            _map.MapFunctions = new List<IMapFunction>
                               {
                                   new MapFunctionKeyNavigation(_map),
                                   pan,
                                   select,
                                   zoomIn,
                                   zoomOut,
                                   label,
                                   info,
                               };
            _map.FunctionLookup = new Dictionary<FunctionMode, IMapFunction>
                                  {
                                      {FunctionMode.Pan, pan},
                                      {FunctionMode.Info, info},
                                      {FunctionMode.Label, label},
                                      {FunctionMode.Select, select},
                                      {FunctionMode.ZoomIn, zoomIn},
                                      {FunctionMode.ZoomOut, zoomOut}
                                  };

            _map.CollisionDetection = false;

            IMapFunction KeyNavigation = _map.MapFunctions.Find(f => f.GetType() == typeof(MapFunctionKeyNavigation));
            _map.ActivateMapFunction(KeyNavigation);
            //changed by Jiri Kadlec - default function mode is none
            _map.FunctionMode = FunctionMode.None;
        }
Exemple #2
0
        private void Configure()
        {
            MapFrame = new MapFrame(this, new Extent(-180, -90, 180, 90));
            //_resizeEndTimer = new Timer {Interval = 100};
            //_resizeEndTimer.Tick += _resizeEndTimer_Tick;

            IMapFunction info = new MapFunctionIdentify(this);
            IMapFunction pan = new MapFunctionPan(this);
            IMapFunction label = new MapFunctionLabelSelect(this);
            IMapFunction select = new MapFunctionSelect(this);
            IMapFunction zoomIn = new MapFunctionClickZoom(this);
            IMapFunction zoomOut = new MapFunctionZoomOut(this);
            MapFunctions = new List<IMapFunction>
                               {
                                   new MapFunctionZoom(this),
                                   pan,
                                   select,
                                   zoomIn,
                                   zoomOut,
                                   label,
                                   info,
                               };
            _functionLookup = new Dictionary<FunctionMode, IMapFunction>
                                  {
                                      {FunctionMode.Pan, pan},
                                      {FunctionMode.Info, info},
                                      {FunctionMode.Label, label},
                                      {FunctionMode.Select, select},
                                      {FunctionMode.ZoomIn, zoomIn},
                                      {FunctionMode.ZoomOut, zoomOut}
                                  };

            CollisionDetection = false;

            //changed by Jiri Kadlec - default function mode is none
            FunctionMode = FunctionMode.None;
        }