public void ConvertLayerProperties_MapPointDataWithStyle_ConvertsStyleToMapPointLayer(
            [Values(KnownColor.AliceBlue, KnownColor.Azure)]
            KnownColor color,
            [Values(1, 5)] int width,
            [Values(PointSymbol.Circle, PointSymbol.Square)]
            PointSymbol pointStyle)
        {
            // Setup
            var   converter     = new MapPointDataConverter();
            var   mapPointLayer = new MapPointLayer();
            Color expectedColor = Color.FromKnownColor(color);
            var   mapPointData  = new MapPointData("test", new PointStyle
            {
                Color           = expectedColor,
                Size            = width,
                Symbol          = pointStyle,
                StrokeColor     = expectedColor,
                StrokeThickness = 1
            });

            // Call
            converter.ConvertLayerProperties(mapPointData, mapPointLayer);

            // Assert
            PointShape expectedPointShape = pointStyle == PointSymbol.Circle
                                                ? PointShape.Ellipse
                                                : PointShape.Rectangle;

            var expectedSymbolizer = new PointSymbolizer(expectedColor, expectedPointShape, width);

            expectedSymbolizer.SetOutline(expectedColor, 1);

            AssertAreEqual(expectedSymbolizer, mapPointLayer.Symbolizer);
        }
        private static PointSymbolizer CreateExpectedSymbolizer(PointStyle expectedPointStyle)
        {
            PointShape expectedPointShape = MapDataHelper.Convert(expectedPointStyle.Symbol);

            var expectedSymbolizer = new PointSymbolizer(expectedPointStyle.Color, expectedPointShape, expectedPointStyle.Size);

            expectedSymbolizer.SetOutline(expectedPointStyle.StrokeColor, expectedPointStyle.StrokeThickness);

            return(expectedSymbolizer);
        }
Beispiel #3
0
        private PointSymbolizer GetPointSymbolizer(Color symbolColor, DotSpatial.Symbology.PointShape symbolShape, double symbolSize)
        {
            IList <ISymbol> symbolsList = new CopyList <ISymbol>();

            symbolsList.Add(new SimpleSymbol(symbolColor, symbolShape, symbolSize)
            {
                UseOutline = true, OutlineColor = Color.Black
            });
            return(new PointSymbolizer(symbolsList)
            {
                Smoothing = true
            });
        }