openstreetmap-americana icon indicating copy to clipboard operation
openstreetmap-americana copied to clipboard

Minimum zoom too high for shields of highways primary and lower

Open attilakundev opened this issue 2 years ago • 3 comments

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 or highway=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: Zoom level 9

  • 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: Zoom level 10

  • Here I should see the shields of PA 18, WV 86, WV 88 etc. shields

attilakundev avatar May 21 '22 12:05 attilakundev

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

This function ignores the minzoom argument.

jleedev avatar May 21 '22 14:05 jleedev

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.

zekefarwell avatar May 21 '22 14:05 zekefarwell

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

jleedev avatar May 21 '22 14:05 jleedev