Example #1
0
 private static Shape RenderGeometry(IReadOnlyViewport viewport, IStyle style, IFeature feature,
                                     SymbolCache symbolCache)
 {
     if (feature.Geometry is Geometries.Point)
     {
         return(PointRenderer.RenderPoint(feature.Geometry as Geometries.Point, style, viewport, symbolCache));
     }
     if (feature.Geometry is MultiPoint)
     {
         return(GeometryRenderer.RenderMultiPoint(feature.Geometry as MultiPoint, style, viewport, symbolCache));
     }
     if (feature.Geometry is LineString)
     {
         return(LineStringRenderer.RenderLineString(feature.Geometry as LineString, style, viewport));
     }
     if (feature.Geometry is MultiLineString)
     {
         return(MultiLineStringRenderer.Render(feature.Geometry as MultiLineString, style, viewport));
     }
     if (feature.Geometry is Polygon)
     {
         return(PolygonRenderer.RenderPolygon(feature.Geometry as Polygon, style, viewport, symbolCache));
     }
     if (feature.Geometry is MultiPolygon)
     {
         return(MultiPolygonRenderer.RenderMultiPolygon(feature.Geometry as MultiPolygon, style, viewport, symbolCache));
     }
     if (feature.Geometry is IRaster)
     {
         return(GeometryRenderer.RenderRaster(feature.Geometry as IRaster, style, viewport));
     }
     return(null);
 }
        public static System.Windows.Shapes.Shape Render(MultiLineString multiLineString, IStyle style, IViewport viewport)
        {
            if (!(style is VectorStyle))
            {
                throw new ArgumentException("Style is not of type VectorStyle");
            }
            var vectorStyle = style as VectorStyle;

            System.Windows.Shapes.Path path = LineStringRenderer.CreateLineStringPath(vectorStyle);
            path.Data            = multiLineString.ToXaml();
            path.RenderTransform = new System.Windows.Media.MatrixTransform {
                Matrix = GeometryRenderer.CreateTransformMatrix1(viewport)
            };
            GeometryRenderer.CounterScaleLineWidth(path, viewport.Resolution);
            return(path);
        }
Example #3
0
 private static Shape RenderGeometry(IViewport viewport, IStyle style, IFeature feature,
     SymbolCache symbolCache)
 {
     if (feature.Geometry is Geometries.Point)
         return PointRenderer.RenderPoint(feature.Geometry as Geometries.Point, style, viewport, symbolCache);
     if (feature.Geometry is MultiPoint)
         return GeometryRenderer.RenderMultiPoint(feature.Geometry as MultiPoint, style, viewport, symbolCache);
     if (feature.Geometry is LineString)
         return LineStringRenderer.RenderLineString(feature.Geometry as LineString, style, viewport);
     if (feature.Geometry is MultiLineString)
         return MultiLineStringRenderer.Render(feature.Geometry as MultiLineString, style, viewport);
     if (feature.Geometry is Polygon)
         return PolygonRenderer.RenderPolygon(feature.Geometry as Polygon, style, viewport, symbolCache);
     if (feature.Geometry is MultiPolygon)
         return MultiPolygonRenderer.RenderMultiPolygon(feature.Geometry as MultiPolygon, style, viewport, symbolCache);
     if (feature.Geometry is IRaster)
         return GeometryRenderer.RenderRaster(feature.Geometry as IRaster, style, viewport);
     return null;
 }