Exemple #1
0
        private static void RenderLayer(Canvas target, IViewport viewport, ILayer layer)
        {
            if (layer.Enabled == false)
            {
                return;
            }

            if (layer is LabelLayer)
            {
                var labelLayer = layer as LabelLayer;
                target.Children.Add(labelLayer.UseLabelStacking
                    ? LabelRenderer.RenderStackedLabelLayer(viewport, labelLayer)
                    : LabelRenderer.RenderLabelLayer(viewport, labelLayer));
            }
            else
            {
                target.Children.Add(RenderVectorLayer(viewport, layer));
            }
        }
Exemple #2
0
 private static void RenderFeature(Canvas canvas, IViewport viewport, IStyle style, Providers.IFeature feature)
 {
     if (style is LabelStyle)
     {
         canvas.Children.Add(LabelRenderer.RenderLabel(feature.Geometry.GetBoundingBox().GetCentroid(), new Offset(), style as LabelStyle, viewport));
     }
     else
     {
         var renderedGeometry = feature.RenderedGeometry.ContainsKey(style) ? feature.RenderedGeometry[style] as UIElement : null;
         if (renderedGeometry == null)
         {
             renderedGeometry = RenderGeometry(viewport, style, feature);
             feature.RenderedGeometry[style] = renderedGeometry;
         }
         else
         {
             PositionGeometry(renderedGeometry, viewport, style, feature);
         }
         canvas.Children.Add(renderedGeometry);
     }
 }