示例#1
0
        private void RenderFeature(IViewport viewport, IStyle style, IFeature feature)
        {
            var vectorStyle = style as VectorStyle;

            if (feature.Geometry is Point)
            {
                PointRenderer.Render(Graphics, (Point)feature.Geometry, vectorStyle, viewport);
            }
            else if (feature.Geometry is MultiPoint)
            {
                MultiPointRenderer.Render(Graphics, (MultiPoint)feature.Geometry, vectorStyle, viewport);
            }
            else if (feature.Geometry is LineString)
            {
                LineStringRenderer.Render(Graphics, (LineString)feature.Geometry, vectorStyle.Line.ToGdi(), viewport);
            }
            else if (feature.Geometry is MultiLineString)
            {
                MultiLineStringRenderer.Render(Graphics, (MultiLineString)feature.Geometry, vectorStyle.Line.ToGdi(), viewport);
            }
            else if (feature.Geometry is Polygon)
            {
                PolygonRenderer.DrawPolygon(Graphics, (Polygon)feature.Geometry, vectorStyle.Fill.ToGdi(), vectorStyle.Outline.ToGdi(), viewport);
            }
            else if (feature.Geometry is MultiPolygon)
            {
                MultiPolygonRenderer.Render(Graphics, (MultiPolygon)feature.Geometry, vectorStyle.Fill.ToGdi(), vectorStyle.Outline.ToGdi(), viewport);
            }
            else if (feature.Geometry is IRaster)
            {
                RasterRenderer.Render(Graphics, feature.Geometry, vectorStyle, viewport);
            }
        }
示例#2
0
 public static void Render(Graphics graphics, MultiPoint points, IStyle style, IViewport viewport)
 {
     foreach (var point in points.Points)
     {
         PointRenderer.Render(graphics, point, style, viewport);
     }
 }