protomaps / protomaps-leaflet

Lightweight vector map rendering + labeling and symbology for Leaflet
https://protomaps.com/docs/frontends/leaflet
BSD 3-Clause "New" or "Revised" License
764 stars 43 forks source link

No labels on roads, features when zoomed in; smart deduped polygon labeling + smart & repeated line labels #24

Closed tarngerine closed 3 years ago

tarngerine commented 3 years ago

Curious when you might add more detailed labels :) makes it hard to find things when zoomed in. Thanks!

image
samhashemi commented 3 years ago

unknown

another example of label weirdness - lake merrit appears three times, the park appears on top of the lake (also three times)

bdon commented 3 years ago
Screen Shot 2021-06-30 at 11 48 58 AM

Lake Merritt labels are at the meeting point of 4 different "data tiles", and right now the labeler works in isolation on each data tile, so the labels will be tripled.

  1. One approach is to de-duplicate labels so it won't label a feature that is seen already, the drawback here is the label may be non-optimal and non-deterministic depending on which tile is labeled first.
  2. Another option is for me to move the optimal label placement to the backend, so the polygon is labeled via point geometry in the data
  3. The issue of the park label appearing over the water is tricky, since the labeling for these two feature classes is independent; this can either be solved by doing preprocessing like 2) above or by creating some custom collider in the frontend (haven't thought through exactly how this can work)

The line labeling absence will be addressed in #1

Keep em coming!

bdon commented 3 years ago

@tarngerine please upgrade to version 0.6.1 on npm

map link: https://protomaps.com/map/#16/40.7401/-73.9835

screenshot:

Screen Shot 2021-07-04 at 9 09 27 PM

Linear labels are not placed in any intelligent way now, working on refining that (needs to interact well with highway shields too)