koopjs / FeatureServer

An open source Geoservices Implementation (deprecated)
https://geoservices.github.io
Other
101 stars 32 forks source link

Layers metadata returning same id for every layer #240

Closed schmidtk closed 1 year ago

schmidtk commented 1 year ago

When creating the layers list here: https://github.com/koopjs/FeatureServer/blob/878c38ffd3ec65870a22df0ee209f3015cf8866d/lib/layers-metadata.js#L10-L12

The create options specify layerId as a direct property of options. In the normalizeInput function, layerId is retrieved from req.params.layer which is not what we want given the above. https://github.com/koopjs/FeatureServer/blob/878c38ffd3ec65870a22df0ee209f3015cf8866d/lib/helpers/table-layer-metadata.js#L27-L32

This causes layerId to be undefined and each layer is assigned id: 0.