Hi,
Is there an example for the best way to reorder either overlays or layers within an overlay?
Is the "OrderBy" the best way to do this?
Thanks,
Greg
Hi,
Is there an example for the best way to reorder either overlays or layers within an overlay?
Is the "OrderBy" the best way to do this?
Thanks,
Greg
Hi Greg,
I think their are many ways to re-order the layers in an overlay. Is their any scenario to re-order your layers? We can figure out a better way for your specific scenario. May be you can copy the layers to a collection. Reorder the new collection; clear the layers in the old overlay; then re-add the layers from the new collection to the overlay.
Hope it helps.
Thanks,
Howard
Hi Howard,
I've had some great success with the "MoveTo" functions in the GeoCollection class.
I did discover one thing that I should bring to your attention.
I've added multiple ShapeFileFeatureLayers to an overlay, one layer contains line shapes and the rest contain polygons (areas). The rendering of the polygon layers is influenced by the index in the GeoCollection, however, the same cannot be said for the shape layer containing the line shapes. It seems that the lines are always drawn last (allways visible, never obscured).
It seems like no matter what I try, I cannot get an area shape to be drawn over a line shape.
Is this a known issue?
Thanks,
Greg
Hi Greg,
When there is an area shape file layer on top of a line shape file layer, the area layer can cover up the line layer; but not entirely, it can only cover the outer pen of the line layer.
We can make the line layer fully-coverable by using code like this:
ShapeFileFeatureLayer lineLayer = new ShapeFileFeatureLayer(@"C:\Program Files\......\Austinstreets.shp");
LineStyle lineStyle = new LineStyle();
lineStyle.OuterPen = new GeoPen(GeoColor.SimpleColors.Black);
lineLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = lineStyle;
lineLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
In the code, we only set the OuterPen property of LineStyle, and left the InnerPen and CenterPen to be empty. This way, any area layer above this line layer can cover it up.
Actually, we are a little bit curious about your scenario, because it doesn’t make much sense to put line data under area data and make the lines invisible.
Would you be kind enough to let us know more about your scenario so that we can provide support more precisely?
Please let us know if you have any more questions.
Thanks,
Tsui