Example #1
0
        public static XamlShapes.Path RenderMultiPolygon(MultiPolygon geometry, IStyle style, IViewport viewport)
        {
            if (!(style is VectorStyle))
            {
                throw new ArgumentException("Style is not of type VectorStyle");
            }
            var vectorStyle = style as VectorStyle;
            var path        = CreatePolygonPath(vectorStyle, viewport.Resolution);

            path.Data            = geometry.ToXaml();
            path.RenderTransform = new XamlMedia.MatrixTransform {
                Matrix = CreateTransformMatrix1(viewport)
            };
            return(path);
        }
Example #2
0
        public static System.Windows.Shapes.Path RenderMultiPolygon(MultiPolygon geometry, IStyle style,
                                                                    IViewport viewport, SymbolCache symbolCache)
        {
            if (!(style is VectorStyle))
            {
                throw new ArgumentException("Style is not of type VectorStyle");
            }
            var vectorStyle = (VectorStyle)style;
            var path        = PolygonRenderer.CreatePolygonPath(vectorStyle, viewport.Resolution, symbolCache);

            path.Data = geometry.ToXaml();
            var matrixTransform = new System.Windows.Media.MatrixTransform {
                Matrix = GeometryRenderer.CreateTransformMatrix1(viewport)
            };

            path.RenderTransform = matrixTransform;

            if (path.Fill != null)
            {
                path.Fill.Transform = matrixTransform.Inverse as System.Windows.Media.MatrixTransform;
            }

            return(path);
        }