Canadian-Geospatial-Platform / geoview

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

[BUG] GeoView crashes when selecting feature from GeoJSON from Canadian Geographical Names Database (CGNDB) #2584

Open bo-lu opened 1 week ago

bo-lu commented 1 week ago

Is there an existing issue for this?

Current Behavior

When I add a CGNDB GeoJSON, it loads but when I click/select a feature, GeoView will crash

Expected Behavior

Returns the feature info when clicked

Steps To Reproduce

  1. Go to https://canadian-geospatial-platform.github.io/geoview/public/add-layers.html
  2. Go to Layer pane and in the URL box, put https://geogratis.gc.ca/services/geoname/en/geonames.geojson?q=ottawa&category=O,P,M&expand=items.status,items.concise,items.generic,items.province&select=items.status.term,items.concise.term,items.generic.term,items.province.description
  3. Change type to GeoJSON > Any name for the layer > Finish
  4. Let the GeoJSON load.
  5. Click any feature and then GeoView crashes

Anything else?

No response

jolevesq commented 3 days ago

@bo-lu How big is this query in GeoJSON, it freeze my whole Chrome browser. But in the viewer it loads quick.

Problem came from reprojection... Failed in MapViewer.#handleMapSingleClick TypeError: coordinates must be finite numbers

Will need investigation

bo-lu commented 2 days ago

Hi Johann, the response is 260kb. It loads fine on my browser (Firefox, Edge and Chrome).

image

Maybe relevant stackoverflow post: https://stackoverflow.com/questions/38242808/openlayers3-get-map-coordinates-on-change-event