green3g / cmv-widgets

Dojo Widgets to extend the functionality of CMV
https://roemhildtg.github.io/cmv-widgets/
MIT License
19 stars 29 forks source link

Fixed metadata issue when service has 1 layer #42

Closed cmosnick closed 5 years ago

cmosnick commented 6 years ago

When a service is added that has only 1 layer, the layer control adds it as a flat item- as if it were a layer. But the added url is still lacking a layerid. This enables the metadata toggle to show, but when it is clicked no sublayer id is passed. This causes the metadata toggle to not work in this instance.

I added extra logic to account for this case. If a sublayer id is passed, it is appended to the request url (as it was before). If no id is passed, and number of layers is 1, then append a /0 to the request url to fetch the single layer.

green3g commented 5 years ago

Thanks! Sorry I took so long to merge...