Esempio n. 1
0
        private void OnCellClick(object sender, DataGridViewCellEventArgs e)
        {
            _layerHandle = (int)layerGrid[0, e.RowIndex].Tag;
            if (e.ColumnIndex == 0)
            {
                bool isVisible = (bool)layerGrid[0, e.RowIndex].Value;
                layerGrid[0, e.RowIndex].Value = !isVisible;
                var layerName = layerGrid[e.ColumnIndex + 1, e.RowIndex].Value.ToString();
                _mapLayersHandler.EditLayer(_layerHandle, layerName, !isVisible);
            }

            if (e.ColumnIndex == 1)
            {
                MarkCurrentLayerName(e.RowIndex);
                _mapLayersHandler.set_MapLayer(_layerHandle);
                itemConvertToGrid25.Enabled = false;
                itemAlwaysKeepOnTop.Checked = _mapLayersHandler.CurrentMapLayer.KeepOnTop;
                if (global.MappingMode == fad3MappingMode.grid25Mode)
                {
                    if (_mapLayersHandler.CurrentMapLayer.LayerType == "ShapefileClass")
                    {
                        var sf = _mapLayersHandler.CurrentMapLayer.LayerObject as Shapefile;
                        itemConvertToGrid25.Enabled = sf.ShapefileType == ShpfileType.SHP_POINT;
                    }
                }
            }
        }
Esempio n. 2
0
        public void CreateGrid25MajorGrid(fadUTMZone utmZone)
        {
            UTMZone                  = utmZone;
            _grid25MajorGrid         = new Grid25MajorGrid(axMap);
            _grid25MajorGrid.UTMZone = utmZone;
            _grid25MajorGrid.GenerateMajorGrids();
            _grid25MajorGrid.MaplayersHandler      = _mapLayersHandler;
            _grid25MajorGrid.MapInterActionHandler = _mapInterActionHandler;
            axMap.GeoProjection.SetWgs84Projection(_grid25MajorGrid.Grid25Geoprojection);
            axMap.MapUnits = tkUnitsOfMeasure.umMeters;

            var h = _mapLayersHandler.AddLayer(Grid25MajorGrid.Grid25Grid, "Grid25", true, true);

            _mapLayersHandler.LoadMapState(false);
            _grid25MajorGrid.MoveToTop();
            _mapLayersHandler.set_MapLayer(h);
        }