Esempio n. 1
0
 private static ILayer CreateLayerWithStyleOnLayer(BoundingBox envelope, int count = 25)
 {
     return(new Layer("Style on Layer")
     {
         DataSource = new MemoryProvider(PointsSample.GenerateRandomPoints(envelope, count)),
         Style = CreateBitmapStyle("Mapsui.Samples.Common.Images.ic_place_black_24dp.png")
     });
 }
Esempio n. 2
0
 private static ILayer CreateHoverInfoLayer(BoundingBox envelope)
 {
     return new Layer(HoverInfoLayerName)
     {
         DataSource = PointsSample.CreateProviderWithRandomPoints(envelope, 25),
         Style = CreateHoverSymbolStyle()
     };
 }
Esempio n. 3
0
        public static Map CreateMap()
        {
            var map = new Map();

            map.Layers.Add(OsmSample.CreateLayer());
            var provider = PointsSample.CreateRandomPointsProvider(map.Envelope);

            map.Layers.Add(CreateLabelLayer(provider));
            map.Layers.Add(CreateLayer(provider));
            return(map);
        }
Esempio n. 4
0
        public static Map CreateMap()
        {
            var map = new Map();

            map.Layers.Add(OpenStreetMap.CreateTileLayer());
            var provider = PointsSample.CreateProviderWithRandomPoints(map.Envelope);

            map.Layers.Add(CreateStackedLabelLayer(provider, LabelColumn));
            map.Layers.Add(CreateLayer(provider));
            return(map);
        }
Esempio n. 5
0
        public static Map CreateMap()
        {
            var map = new Map();

            map.Layers.Add(OsmSample.CreateLayer());
            var randomPointLayer = CreateRandomPointLayer(PointsSample.CreateRandomPointsProvider(map.Envelope));

            map.Layers.Add(randomPointLayer);
            map.InfoLayers.Add(randomPointLayer);
            return(map);
        }
Esempio n. 6
0
        private static IEnumerable <IFeature> GenerateRandomFeatures(BoundingBox envelope, int count, IStyle style)
        {
            var result = new List <Feature>();
            var points = PointsSample.GenerateRandomPoints(envelope, count);

            foreach (var point in points)
            {
                result.Add(new Feature {
                    Geometry = point, Styles = new List <IStyle> {
                        style
                    }
                });
            }
            return(result);
        }
Esempio n. 7
0
        public static Map CreateMap()
        {
            var map = new Map();

            map.Layers.Add(new TileLayer(KnownTileSources.Create())
            {
                Name = "OSM"
            });
            map.Layers.Add(LineStringSample.CreateLineStringLayer(LineStringSample.CreateLineStringStyle()));
            map.Layers.Add(PointsSample.CreateRandomPointLayer(map.Envelope,
                                                               style: PointsSample.CreateBitmapStyle("Mapsui.Samples.Common.Images.ic_place_black_24dp.png")));
            map.Layers.Add(PointsSample.CreateBitmapPointLayer());
            map.Viewport.RenderResolutionMultiplier = 2;

            map.Layers.Add(new MemoryLayer {
                DataSource = CreateLineProvider()
            });


            return(map);
        }
Esempio n. 8
0
            public override IEnumerable <IFeature> GetFeaturesInView(BoundingBox box, double resolution)
            {
                var features   = new List <IFeature>();
                var geometries = PointsSample.GenerateRandomPoints(box, 10).ToList();
                var count      = 0;
                var random     = _random.Next(geometries.Count);

                foreach (var geometry in geometries)
                {
                    if (count != random) // skip a random element to test robustness
                    {
                        var feature = new Feature
                        {
                            Geometry = geometry,
                            ["ID"]   = count.ToString(CultureInfo.InvariantCulture)
                        };
                        features.Add(feature);
                    }
                    count++;
                }
                return(features);
            }
Esempio n. 9
0
 public static MemoryProvider CreateMemoryProviderWithDiverseSymbols(BoundingBox envelope, int count = 100)
 {
     return(new MemoryProvider(CreateDiverseFeatures(PointsSample.GenerateRandomPoints(envelope, count, 3))));
 }