mapbox / geojson.io

A quick, simple tool for creating, viewing, and sharing spatial data
http://geojson.io/
ISC License
1.91k stars 567 forks source link

fix popup buttons #825

Closed chriswhong closed 1 year ago

chriswhong commented 1 year ago

Fixes a regression introduced in #819 which broke buttons and within the popups. Features are given an id property after being added to the map based on its position in the FeatureCollection, but this property may not exist on the data in the datastore.

819 gets the id from queryRenderedFeatures, then uses it to look up the full feature from the datastore (by its index). However, the retrieved feature does not include an id itself, so the "save" and "add simplestyle properties" buttons do not know which feature to update and an error is thrown.

Fixes #823 and #824