osm-americana / openstreetmap-americana

A quintessentially American map style
https://americanamap.org
Creative Commons Zero v1.0 Universal
185 stars 61 forks source link

overrideByName causes legend to omit shields #1165

Open 1ec5 opened 1 month ago

1ec5 commented 1 month ago

If a network uses overrideByName, its entry in the legend shows a blank space instead of any matching shields. For example, the legend for this view should show a shield beside the entry for Merritt Parkway:

Legend: Merritt Parkway without a shield beside it.

This network’s definition relies on overrideByName:

https://github.com/osm-americana/openstreetmap-americana/blob/b50ef87edd165240c119e49cb939d8d532ffe800/src/js/shield_defs.js#L1106-L1113

We need to add something similar to the special case for overrideByRef, which is working correctly:

https://github.com/osm-americana/openstreetmap-americana/blob/b50ef87edd165240c119e49cb939d8d532ffe800/src/js/legend_control.js#L474-L478 https://github.com/osm-americana/openstreetmap-americana/blob/b50ef87edd165240c119e49cb939d8d532ffe800/src/js/legend_control.js#L503