Hi…
I wanted to confirm a few things…
This is how I added a new layer to my map:
-----------------------------------------------------------
strdateTimeNow = DateTime.Now.ToString("ddMMyyyyhhmmssffff");
LayerOverlay layerOverlay = new LayerOverlay();
layerOverlay.Layers.Add("ShapeLayer" + strdateTimeNow, ShapeFileLayer1);
wpfMap1.Overlays.Add("ShapeOverlay" + strdateTimeNow, layerOverlay);
wpfMap1.Overlays[wpfMap1.Overlays.Count - 1].Name = "ShapeOverlay" + strdateTimeNow;
-----------------------------------------------------------
For adding another layer I repeated the same steps (Added overlay+layer again).
1) Is it the recommended way? Or should I have been adding more layers to the already existing layerOverlay?
I am confused now as I came across re-ordering of layers, as it seems to be only about reordering layers and not overlays.
MovetoBottom(int index);
What does the string in MovetoBottom(string) represent?
The link wiki.thinkgeo.com/wiki/ThinkGeo.MapSuite.WpfDesktopEdition.MapTools#MoveToBottom.28String.29 has very little info.
2) Is it possible to re-order/change display order of LayerOverlay? If so how do I do it?
Right now I am removing the LayerOverlay and again inserting it at another index using wpfMap1.Overlays.Insert(0,layerOverlay);
But I am not sure how I can get the specific index value (instead of 0).
3) Do you have a working example of a layers list/ treeview
which enables drag-drop, changing display order of layers/overviews in maps?
Thanks,
Aji
LayerOverlay/Layer change display order
Hi Aji,
1. Your link is not work for Overlays or Layers, it’s for MapTools on map. I think you can adjust the order by layerOverlay.Layers.MoveToBottom(“Key”) or wpfMap1.Overlays.MoveToBottom(“Key”).
2. You can see our wpfMap1.Overlays contains a group function for example MoveUp MoveDown MoveTo MoveToTop MoveToButtom, and if you want to know the index of overlay, please use this API: wpfMap1.Overlays.IndexOf
3. Sorry I haven’t found a sample for adjust the order of layers, but I think if the Movexx API works well, you can implement that easily for your scenario.
Regards,
Don