Beispiel #1
0
        private void init()
        {
            //Read map data into map data object
            _mapData = MapReader.Read(@"..\..\..\data\world3.map", @"..\..\..\data\world.dbf");

            //Create map layers and add them to choropleth map
            _polygonLayer.MapData = _mapData;

            indexMapper = new StringIndexMapper(_mapData.AllDbfFields["GMI_CNTRY"], _mainWindow.DataHandler.RawDataProvider.RowIds);
            _polygonLayer.IndexMapper = indexMapper;


            _mainChoroplethMap.AddLayer(_polygonLayer);

            _borderLayer.MapData = _mapData;
            _mainChoroplethMap.AddLayer(_borderLayer);

            _polygonLayer.ColorMap = _mainWindow.ColorMapHandler.MainColorMap;

            _mainChoroplethMap.Position = mapInitPos;
            _mainChoroplethMap.Zoom     = mapInitZoom;


            // index visibility manager
            _polygonLayer.IndexVisibilityManager = _mainWindow.SharedVisibilityManager;

            // selection colors
            _polygonLayer.SelectedPolygonColor = _mainWindow.ColorMapHandler.SelectionColor;

            // add tooltip to the map
            _gavToolTip                = new GavToolTip(_mainWindow);
            _gavToolTip.FadeTime       = 150;
            _hoverController           = new MouseHoverController(_mainWindow.getMapPanel(), 1, 5);
            _hoverController.Hover    += new EventHandler(_hoverController_Hover);
            _hoverController.HoverEnd += new EventHandler(_hoverController_HoverEnd);

            _mainWindow.SaPManager.AddComponent(_mainChoroplethMap);
            _mainWindow.SaPManager.AddComponent(_polygonLayer);

            _mainChoroplethMap.VizComponentMouseDown += new EventHandler <VizComponentMouseEventArgs>(_mainChoroplethMap_VizComponentMouseDown);
            _mainWindow.mapReset.Click += new EventHandler(mapReset_Click);

            //Add objects to view manager
            _mainWindow.ViewManager.Add(_mainChoroplethMap, _mainWindow.getMapPanel());
        }
 private void InitializeStringIndexMapper()
 {
     //throw new NotImplementedException();
     stringIndexMapper = new StringIndexMapper(mapData.RegionFullNames, excelDataProvider.RowIds);
     this.stringIndexMapper.TryBackwardMapIndex(this.dataSelectedIndex, out this.__mapSelectedIndex);
 }