Esempio n. 1
0
        public static IEnumerable<ILayer> CreateLayers(string fileName)
        {
            var layers = new List<ILayer>();

            //var countrySource = new ShapeFile(GetAppDir() + "\\GeoData\\World\\countries.shp", true) { CRS = "EPSG:3785" };
            //var citySource = new ShapeFile(GetAppDir() + "\\GeoData\\World\\cities.shp", true) { CRS = "EPSG:3785" };

            //layers.Add(new RasterizingLayer(CreateCountryLayer(countrySource)));
            //layers.Add(new RasterizingLayer(CreateCityLayer(citySource)));
            //layers.Add(new RasterizingLayer(CreateCountryLabelLayer(countrySource)));
            //layers.Add(new RasterizingLayer(CreateCityLabelLayer(citySource)));

            var source = new ShapeFile(fileName, false) { CRS = "EPSG:3785" };

            layers.Add(new RasterizingLayer(new Layer
            {
                Name = "Shapefile",
                DataSource = source,
                Style = new ThemeStyle(f => new VectorStyle { Line = new Pen(Color.Black) }),
                FetchingPostponedInMilliseconds = 100,
                Overscan = 1.5
            }, rasterizer: new Mapsui.Rendering.Gdi.MapRenderer() { HighQuality = true }, delayBeforeRasterize: 300, overscanRatio: 3));

            return layers;
        }
Esempio n. 2
0
        public static IEnumerable<ILayer> CreateLayers()
        {
            var layers = new List<ILayer>();

            var countrySource = new ShapeFile(GetAppDir() + "\\GeoData\\World\\countries.shp", true) { CRS = "EPSG:3785" };
            var citySource = new ShapeFile(GetAppDir() + "\\GeoData\\World\\cities.shp", true) { CRS = "EPSG:3785" };

            layers.Add(new RasterizingLayer(CreateCountryLayer(countrySource)));
            layers.Add(new RasterizingLayer(CreateCityLayer(citySource)));
            layers.Add(new RasterizingLayer(CreateCountryLabelLayer(countrySource)));
            layers.Add(new RasterizingLayer(CreateCityLabelLayer(citySource)));

            return layers;
        }
Esempio n. 3
0
        public static Map CreateMap()
        {
            var map = new Map { BackColor = Color.Blue};
            
            var countrySource = new ShapeFile(GetAppDir() + "\\Resources\\GeoData\\countries.shp", true);
            var citySource = new ShapeFile(GetAppDir() + "\\Resources\\GeoData\\cities.shp", true);

            map.Layers.Add(CreateCountryLayer(countrySource));
            
            map.Layers.Add(CreateCityLayer(citySource));
            
            map.Layers.Add(CreateCountryLabelLayer(countrySource));

            map.Layers.Add(CreateCityLabelLayer(citySource));
            
            return map;
        }