geonetwork / core-geonetwork

GeoNetwork is a catalog application to manage spatially referenced resources. It provides powerful metadata editing and search functions as well as an interactive web map viewer. It is currently used in numerous Spatial Data Infrastructure initiatives across the world.
http://geonetwork-opensource.org/
GNU General Public License v2.0
404 stars 482 forks source link

WMTS Layers #8189

Open AlexanderSolovov opened 3 weeks ago

AlexanderSolovov commented 3 weeks ago

The map viewer seem to have a number of issues with WMTS layers.

1) When I publish a record with WMTS API reference, this record is not displayed in the Add layer form and cannot be searched. 2) Even if I add WMTS layer through the Services tab or by searching in the catalogue, it is not displayed in the legend. 3) If I try to save or download the map with WMTS layers, nothing happens and JavaScript console shows the error "TypeError: b.getParams is not a function" 4) If application/vnd.mapbox-vector-tile format is available from the server, the map seem to pick it up automatically (cannot change to image/png for instance), but the layer is not displayed. After removing application/vnd.mapbox-vector-tile from available formats, the layer is displayed.

As a simple case to reproduce some of these issues, open the map and add WMTS layer through the Services tab using this URL - http://opencache.statkart.no/gatekeeper/gk/gk.open_wmts and selecting "Bakgrunnskart forenklet" layer. The console shows an error. Same error if I try to download the map. The legend is empty.

AddLayer Legend DownloadMap

josegar74 commented 2 weeks ago

The code is failing in:

https://github.com/geonetwork/core-geonetwork/blob/9378975832f3fd70d29f9cd90176f1d86306b580/web-ui/src/main/resources/catalog/components/viewer/layermanager/LayerManagerDirective.js#L358

Related to this PR: https://github.com/geonetwork/core-geonetwork/pull/6820 to manage WMS time dimension, probably needs to be updated to only execute that code for WMS layers.