Canadian-Geospatial-Platform / geoview

Canadian Geospatial Platform Viewer / Visualiseur de la Plateforme Géospatiale Canadienne
Other
20 stars 31 forks source link

[BUG] BasemapPanle fails the Map #2333

Closed jolevesq closed 2 days ago

jolevesq commented 3 days ago

Is there an existing issue for this?

Current Behavior

When we change basemap on geo, ca we have this error and the map disappears

cgpv-main.js?ver=1719511990:268 DOMException: Failed to execute 'querySelector' on 'Element': '#disaster-events-since-1900/-basemapPanelButton' is not a valid selector.
    at I (https://geo.ca/wp-content/geoview/cgpv-main.js?ver=1719511990:80:176236)
    at https://geo.ca/wp-content/geoview/cgpv-main.js?ver=1719511990:80:178471
    at https://geo.ca/wp-content/geoview/cgpv-main.js?ver=1719511990:80:180013
    at rl (https://geo.ca/wp-content/geoview/cgpv-main.js?ver=1719511990:268:93033)
    at xc (https://geo.ca/wp-content/geoview/cgpv-main.js?ver=1719511990:268:112988)
    at https://geo.ca/wp-content/geoview/cgpv-main.js?ver=1719511990:268:111765
    at Ac (https://geo.ca/wp-content/geoview/cgpv-main.js?ver=1719511990:268:111825)
    at lc (https://geo.ca/wp-content/geoview/cgpv-main.js?ver=1719511990:268:105637)
    at Go (https://geo.ca/wp-content/geoview/cgpv-main.js?ver=1719511990:268:46639)
    at https://geo.ca/wp-content/geoview/cgpv-main.js?ver=1719511990:268:103063
ds @ cgpv-main.js?ver=1719511990:268Understand this error
cgpv-main.js?ver=1719511990:268 Uncaught DOMException: Failed to execute 'querySelector' on 'Element': '#disaster-events-since-1900/-basemap

Map id may be the problem... disaster-events-since-1900/

Expected Behavior

There should be no error

Steps To Reproduce

  1. https://geo.ca/emergency/disaster-events-since-1900/
  2. Open Basemap panel
  3. Close the panel, you will have the error

Anything else?

No response

jaredkinger commented 2 days ago

The slash in the ID was the issue here. This has been removed and the basemap panel is working as expected.