public static Draw ( |
||
canvas | ||
viewport | IViewport | |
style | IStyle | |
feature | IFeature | |
skBitmapCache | SKBitmapInfo>.IDictionary | |
currentIteration | long | |
return | void |
private void RenderFeature(SKCanvas canvas, IReadOnlyViewport viewport, IStyle style, IFeature feature, float layerOpacity) { if (feature.Geometry is Point) { PointRenderer.Draw(canvas, viewport, style, feature, feature.Geometry, _symbolCache, layerOpacity * style.Opacity); } else if (feature.Geometry is MultiPoint) { MultiPointRenderer.Draw(canvas, viewport, style, feature, feature.Geometry, _symbolCache, layerOpacity * style.Opacity); } else if (feature.Geometry is LineString) { LineStringRenderer.Draw(canvas, viewport, style, feature, feature.Geometry, layerOpacity * style.Opacity); } else if (feature.Geometry is MultiLineString) { MultiLineStringRenderer.Draw(canvas, viewport, style, feature, feature.Geometry, layerOpacity * style.Opacity); } else if (feature.Geometry is Polygon) { PolygonRenderer.Draw(canvas, viewport, style, feature, feature.Geometry, layerOpacity * style.Opacity, _symbolCache); } else if (feature.Geometry is MultiPolygon) { MultiPolygonRenderer.Draw(canvas, viewport, style, feature, feature.Geometry, layerOpacity * style.Opacity, _symbolCache); } else if (feature.Geometry is IRaster) { RasterRenderer.Draw(canvas, viewport, style, feature, layerOpacity * style.Opacity, _tileCache, _currentIteration); } }
private void RenderFeature(SKCanvas canvas, IViewport viewport, IStyle style, IFeature feature) { if (feature.Geometry is Point) { PointRenderer.Draw(canvas, viewport, style, feature, feature.Geometry, _symbolTextureCache); } else if (feature.Geometry is MultiPoint) { MultiPointRenderer.Draw(canvas, viewport, style, feature, feature.Geometry, _symbolTextureCache); } else if (feature.Geometry is LineString) { LineStringRenderer.Draw(canvas, viewport, style, feature.Geometry); } else if (feature.Geometry is MultiLineString) { MultiLineStringRenderer.Draw(canvas, viewport, style, feature.Geometry); } else if (feature.Geometry is Polygon) { PolygonRenderer.Draw(canvas, viewport, style, feature.Geometry); } else if (feature.Geometry is MultiPolygon) { MultiPolygonRenderer.Draw(canvas, viewport, style, feature.Geometry); } else if (feature.Geometry is IRaster) { RasterRenderer.Draw(canvas, viewport, style, feature, _tileTextureCache, _currentIteration); } }
private void RenderFeature(SKCanvas canvas, IReadOnlyViewport viewport, ILayer layer, IStyle style, IFeature feature, float layerOpacity) { // Check, if we have a special renderer for this style if (StyleRenderers.ContainsKey(style.GetType())) { // Save canvas canvas.Save(); // We have a special renderer, so try, if it could draw this var result = ((ISkiaStyleRenderer)StyleRenderers[style.GetType()]).Draw(canvas, viewport, layer, feature, style, _symbolCache); // Restore old canvas canvas.Restore(); // Was it drawn? if (result) { // Yes, special style renderer drawn correct return; } } // No special style renderer handled this up to now, than try standard renderers if (feature.Geometry is Point) { PointRenderer.Draw(canvas, viewport, style, feature, feature.Geometry, _symbolCache, layerOpacity * style.Opacity); } else if (feature.Geometry is MultiPoint) { MultiPointRenderer.Draw(canvas, viewport, style, feature, feature.Geometry, _symbolCache, layerOpacity * style.Opacity); } else if (feature.Geometry is LineString) { LineStringRenderer.Draw(canvas, viewport, style, feature, feature.Geometry, layerOpacity * style.Opacity); } else if (feature.Geometry is MultiLineString) { MultiLineStringRenderer.Draw(canvas, viewport, style, feature, feature.Geometry, layerOpacity * style.Opacity); } else if (feature.Geometry is Polygon) { PolygonRenderer.Draw(canvas, viewport, style, feature, feature.Geometry, layerOpacity * style.Opacity, _symbolCache); } else if (feature.Geometry is MultiPolygon) { MultiPolygonRenderer.Draw(canvas, viewport, style, feature, feature.Geometry, layerOpacity * style.Opacity, _symbolCache); } else if (feature.Geometry is IRaster) { RasterRenderer.Draw(canvas, viewport, style, feature, layerOpacity * style.Opacity, _tileCache, _currentIteration); } }
private void RenderFeature(SKCanvas canvas, IReadOnlyViewport viewport, ILayer layer, IStyle style, IFeature feature, float layerOpacity) { // Check, if we have a special renderer for this style if (StyleRenderers.ContainsKey(style.GetType())) { // Save canvas canvas.Save(); // We have a special renderer, so try, if it could draw this var styleRenderer = (ISkiaStyleRenderer)StyleRenderers[style.GetType()]; var result = styleRenderer.Draw(canvas, viewport, layer, feature, style, _symbolCache); // Restore old canvas canvas.Restore(); // Was it drawn? if (result) { // Yes, special style renderer drawn correct return; } } // No special style renderer handled this up to now, than try standard renderers if (feature is GeometryFeature geometryFeatureNts) { GeometryRenderer.Draw(canvas, viewport, style, layerOpacity, geometryFeatureNts, _symbolCache); } if (feature is PointFeature pointFeature) { PointRenderer.Draw(canvas, viewport, style, pointFeature, pointFeature.Point.X, pointFeature.Point.Y, _symbolCache, layerOpacity * style.Opacity); } else if (feature is RectFeature rectFeature) { RectRenderer.Draw(canvas, viewport, style, rectFeature, layerOpacity * style.Opacity); } else if (feature is RasterFeature rasterFeature) { RasterRenderer.Draw(canvas, viewport, style, rasterFeature, rasterFeature.Raster, layerOpacity * style.Opacity, _tileCache, _currentIteration); } }