cyclestreets / bikedata

Cycling-related data platform
https://bikedata.cyclestreets.net
GNU General Public License v3.0
16 stars 2 forks source link

Collision severity appears as undefined in popup #27

Closed si-the-pie closed 1 year ago

si-the-pie commented 4 years ago

In the collisions view the value undefined appears in the popup for severity:

collision_severity_undefined

This is happening because of the following temporary code:

                                       // Remove icon if present in data
                                       if (iconField) {
                                               if (feature.properties.hasOwnProperty(iconField)) {
                                                       delete feature.properties[iconField];
                                               }
                                       }

which is on the live server, injected this location: https://github.com/cyclestreets/Leaflet.LayerViewer/blob/20c9281e64b2ba6b7341eda96af2a3f9bc979311/src/Leaflet.LayerViewer.js#L2097

I don't know why that extra code is there (and I don't think I added it), but the severity does appear in the popup if it is removed.

mvl22 commented 4 years ago

It's because the site is currently assuming that iconField is a field that you wouldn't normally then also show.

This assumption is clearly wrong, or needs to be configurable.

mvl22 commented 1 year ago

The monkey-patched code is no longer present on the server, so this issue got resolved.