public DatelineCrossingMap() { _geoSlaveMapFrame = new MapFrame(this, new Extent(0, 0, 0, 0)); // give the slave frame something to draw. _geoSlaveMapFrame.Layers = MapFrame.Layers; // Changing layers causes a resize event to be fired. If that event reaches the slave frame after the main frame, // then it can get misaligned. So, re-assign the layers to the main frame, causing the main frame to re-register its event handlers so that the main frame resize happens second. // Note that the fact that events are fired in order is an implementation detail of C#; if that changes, we might get misaligned frames after adding layers. MapFrame.Layers = MapFrame.Layers; _viewExtentsBeingChanged = false; }
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; }