コード例 #1
0
        public static void IterateLayer(Graphics graphics, IViewport viewport, ILayer layer,
                                        Action <IViewport, IStyle, IFeature> callback)
        {
            if (layer.Enabled == false)
            {
                return;
            }
            if (layer.MinVisible > viewport.RenderResolution)
            {
                return;
            }
            if (layer.MaxVisible < viewport.RenderResolution)
            {
                return;
            }

            if (layer is LabelLayer)
            {
                GdiLabelRenderer.Render(graphics, viewport, layer as LabelLayer);
            }
            else
            {
                IterateVectorLayer(viewport, layer, callback);
            }
        }
コード例 #2
0
 private static void Render(Graphics graphics, IViewport viewport, IEnumerable <ILayer> layers)
 {
     foreach (var layer in layers)
     {
         if (layer.Enabled &&
             layer.MinVisible <= viewport.Resolution &&
             layer.MaxVisible >= viewport.Resolution)
         {
             if (layer is LabelLayer)
             {
                 GdiLabelRenderer.Render(graphics, viewport, layer as LabelLayer);
             }
             else
             {
                 RenderLayer(graphics, viewport, layer);
             }
         }
     }
 }