Пример #1
0
        private void CreateLayer()
        {
            var sf = new Shapefile();

            sf.CreateNewWithShapeID("", ShpfileType.SHP_POLYGON);

            var shp = new Shape();

            shp.Create(sf.ShapefileType);
            // 24.0, 57.0
            shp.AddPoint(23.8, 56.8);
            shp.AddPoint(23.8, 57.2);
            shp.AddPoint(24.2, 57.2);
            shp.AddPoint(24.2, 56.8);
            shp.AddPoint(23.8, 56.8);
            Assert.IsTrue(shp.IsValid, "Shape is invalid");

            sf.EditAddShape(shp);
            _axMap1.AddLayer(sf, true);
            _axMap1.ZoomToShape(0, 0);
            _axMap1.ZoomOut(0.5);
            _axMap1.ZoomToTileLevel(_axMap1.Tiles.CurrentZoom);
        }