ThinkGeo.com    |     Documentation    |     Premium Support

Wms obscures dynamic layers

Hi,


I've been working on a small "proof of concept" app, which features a single WMS backdrop layer and a layer which the user draws in. For every drawing, I'm transferring the drawn features to a dynamic layer, that is added to the map with DynamicOverlay. The WMS is of course added via the CustomOverlays.


Both work nicely, independently. When added together, the WMS is drawn over my drawing layer, completely obscuring them. It seems that the rendering order favors customoverlay layers for dynamicoverlay layers, i.e. they're drawn on top.


This seems to be a peculiar choice, since wms is most often used as backdrop, and dynamic layers are usually, at least in my mind, data to be displayed on top of other data. And there seems to be no way in MapSuite to change this rendering order ?


I've even looked at the "IsBaseOverlay" setting on the CustomOverlays Overlay objects, but setting it to true doesn't change the overall rendering order.


I've looked at Nelson's post from late January, and the solution suggested there is to add the vectors as a layer in yet another custom overlay instead of as a dynamic overlay layer. It seems to work, but it is not a good work-around, imho.


All this leads me to forward some questions:



        
  1. What is the rationale for having CustomOverlays being drawn on top of DynamicOverlay ? Oughn't it be vice-versa ?

  2.     
  3. Why can WMS (backdrop) layers only be added as CustomOverlay, if the above cannot be altered ?

  4.     
  5. What kind of rendering order does the CustomOverlay.IsBaseOverlay setting control ? Is it able to reorder wrt. DynamicOverlay, so something like the below order can be achieved:
        

              
    1. (top)

    2.         
    3. CustomOverlays with IsBaseLayer = False

    4.         
    5. DynamicOverlay

    6.         
    7. CustomOverlays with IsBaseLayer = True

    8.         
    9. (bottom)

    10.     

        


 


Best regards


Lars I. Nielsen, GisPro



Lars, 
  
 I don’t think you are using the latest version (3.1.16).  In fact, it will throw an exception with the latest version as you cannot use CustomOverlays and DynamicOverlays at the same time.  
  
 There are 2 modes to setup the overlays. One is to use the preset overlays (DynamicOverlay, StaticOverlay, BackgroundOverlay, MarkerOverlay, …), which is easy to use and suitable for a simple application; the other is to use the custom overlays, which is more advanced and more powerful.  The mode is one or the other, there is no way to use both of them. 
  
 StaticOverlay/DynamicOverlay is with the type of “LayerOverlay”, BackgroundOverlay is with the type of “Overlay”. So if you want to use the “PreSet Mode”, you can set the wmsOverlay to the backgroundOverlay directly (Because wmsOverlay is the sub class of “Overlay”). If you want to use the “Custom Mode”, you just add each of overlay to the CustomOverLays with the order you prefer. CustomOverlay accepts “Overlay” so any type of Overlay can be added.  LayerOverlay’s IsBaseOverlay property is true by default, so you need to set it to false if you want the wmsOverlay to be the background. 
  
 “Custom Mode” is more for advanced scenarios. For example, if you want to have GoogleMap and YahooMap all integrated, you can only use “Custom Mode” as there is no way to add two 3rd part overlays in “Preset Mode”; similarly, Map1.MarkerOverlay is with the type of “InMemoryMarkerOverlay”, if you want to use other marker overlays like “FeatureSoureceMarkerOverlay” or “SimpleMarkerOverlay”, you must use the “Custom Mode”. Custom Mode has a great benefit that you can control it’s order easily, we do not need to guess which one runs first which one runs next, that’s very convenient.  
  
 If you have any issues, please let us know. 
  
 Thanks, 
  
 Ben