openstreetmap-americana
openstreetmap-americana copied to clipboard
Minimum zoom too high for shields of highways primary and lower
My concern regarding rendering route shields:
- it's good that the interstate shields render on lower zoom levels like 6-7, and the trunk roads that are not interstate do on >= 8
- what about those routes which are classified as
highway=primary
orhighway=secondary
? In my opinion, primary routes should render also at zoom level >=9, and secondary routes from level 10, because in my opinion that's more natural, or that's what you can see in the maps like GMaps or even paper maps (eg. Rand McNally) usually display the state routes on a low scale.
Right now, this is what I can see in W.Va. at level ~9 zoom:
- here I should see the major routes like U.S. 250, WV 2 and PA 21's shields (those are classified as primary)
at level ~10 zoom:
- Here I should see the shields of PA 18, WV 86, WV 88 etc. shields
https://github.com/ZeLonewolf/openstreetmap-americana/blob/078755abe95abd78a9527d2557bbe1605fa14481/style/layer/highway_shield.js#L52
This function ignores the minzoom
argument.
I 100% agree and have tried to make the shields show up sooner for primary and secondary roads. Unfortunately, the required data is not available in the vector tiles at lower zooms and the style is currently showing them as early as possible. A change to OpenMapTiles (or a future custom PlaneTiler config) is needed for this.
The issue appears to be in the source data then, not the style:
> new Set(
map.querySourceFeatures('openmaptiles',{sourceLayer:'transportation_name'})
.flatMap(x=>Object.entries(x.properties))
.filter(x=>x[0].startsWith('route_'))
.map(x=>x[1]))
Set(2) {'US:OH=7', 'US:US=22'}