osm-americana / openstreetmap-americana

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

Minimum zoom too high for shields of highways primary and lower #339

Open attilakundev opened 2 years ago

attilakundev commented 2 years ago

My concern regarding rendering route shields:

Right now, this is what I can see in W.Va. at level ~9 zoom: Zoom level 9

at level ~10 zoom: Zoom level 10

jleedev commented 2 years ago

https://github.com/ZeLonewolf/openstreetmap-americana/blob/078755abe95abd78a9527d2557bbe1605fa14481/style/layer/highway_shield.js#L52

This function ignores the minzoom argument.

zekefarwell commented 2 years ago

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.

jleedev commented 2 years ago

The issue appears to be in the source data then, not the style:

image

> 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'}