Exemple #1
0
        private void PrintLayer(IMapLayer layer, MapArgs args)
        {
            MapLabelLayer.ClearAllExistingLabels();  //need to do this or labels not drawn on refresh
            IMapGroup group = layer as IMapGroup;

            if (group != null)
            {
                foreach (IMapLayer subLayer in group.Layers)
                {
                    PrintLayer(subLayer, args);
                }
            }

            IMapLayer geoLayer = layer;

            if (geoLayer != null)
            {
                if (geoLayer.UseDynamicVisibility)
                {
                    if (ViewExtents.Width > geoLayer.DynamicVisibilityWidth)
                    {
                        return;  // skip the geoLayer if we are zoomed out too far.
                    }
                }

                if (geoLayer.IsVisible == false)
                {
                    return;
                }

                geoLayer.DrawRegions(args, new List <Extent> {
                    args.GeographicExtents
                });

                IMapFeatureLayer mfl = geoLayer as IMapFeatureLayer;
                if (mfl != null)
                {
                    if (mfl.UseDynamicVisibility)
                    {
                        if (ViewExtents.Width > mfl.DynamicVisibilityWidth)
                        {
                            return;
                        }
                    }
                    if (mfl.ShowLabels && mfl.LabelLayer != null)
                    {
                        if (mfl.LabelLayer.UseDynamicVisibility)
                        {
                            if (ViewExtents.Width > mfl.LabelLayer.DynamicVisibilityWidth)
                            {
                                return;
                            }
                        }
                        mfl.LabelLayer.DrawRegions(args, new List <Extent> {
                            args.GeographicExtents
                        });
                    }
                }
            }
        }