Mapsui.Rendering.Xaml.PointRenderer.CreateSymbolFromVectorStyle C# (CSharp) Method

CreateSymbolFromVectorStyle() private static method

private static CreateSymbolFromVectorStyle ( VectorStyle style, double opacity = 1, SymbolType symbolType = SymbolType.Ellipse ) : System.Windows.Shapes.Shape
style Mapsui.Styles.VectorStyle
opacity double
symbolType SymbolType
return System.Windows.Shapes.Shape
        private static XamlShapes.Shape CreateSymbolFromVectorStyle(VectorStyle style, double opacity = 1,
            SymbolType symbolType = SymbolType.Ellipse)
        {
            // The SL StrokeThickness default is 1 which causes blurry bitmaps
            var path = new XamlShapes.Path
            {
                StrokeThickness = 0,
                Fill = ToXaml(style.Fill)
            };

            if (style.Outline != null)
            {
                path.Stroke = new XamlMedia.SolidColorBrush(style.Outline.Color.ToXaml());
                path.StrokeThickness = style.Outline.Width;
                path.StrokeDashArray = style.Outline.PenStyle.ToXaml();
            }

            if (symbolType == SymbolType.Ellipse)
                path.Data = CreateEllipse(SymbolStyle.DefaultWidth, SymbolStyle.DefaultHeight);
            else
                path.Data = CreateRectangle(SymbolStyle.DefaultWidth, SymbolStyle.DefaultHeight);

            path.Opacity = opacity;

            return path;
        }