2

I'm working to build a dynamic map, which pulls data from GeoServer to get the list of available layers, and then uses Leaflet to allow the user to determine which specific layers to display. Leaflet and OpenLayers both support the context of a base layer, in which the user selects one base, with as many overlays as they then need.

I'm successfully pulling the list of layers from GeoServer's GetCapabilities call. However, I've not determined a way to suggest which layers are good candidates for base, versus which should be considered overlays. I've cross-checked the responses returned for WMS and WFS, as well as version 1.1 versus 1.3. Suspect it's a concept issue on my part. Can someone clarify how to distinguish between base and overlay layers for layer lists returned from GeoServer?

2
  • 1
    Geoserver has no concept of base vs overlay. Any layer could be either. It is simply that OpenLayers/Leaflet expect some layer to be at the bottom. In OpenLayers3 this has been changed somewhat. Generally, an overlay would be something transparent or vector based such that you can see the base layer through it. But, essentially, it is as you say, conceptual, and there are no hard and fast rules. Jul 17, 2015 at 19:46
  • If you are serving out the base layers I would suggest to organize those by either group layer (since many base layers consist of multiple layers) or by workspace. You client logic could then filter by those layer types. For example workspace = 'base' holds all related base layers or group base layers and workspace <> 'base' are all overlays.
    – artwork21
    Jul 17, 2015 at 19:57

1 Answer 1

0

The WMS spec provides the ability to mark a layer as Opaque or not, this is designed to allow client developers to distinguish base layers (which are, or should be, marked opaque) from overlays which aren't.

I'm not sure how common it is for people who set up WMS servers to populate this value - I can't think of a time I ever have. Interestingly this note on the GeoServer code base suggests for some layers this will be set automatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.