basemaps icon indicating copy to clipboard operation
basemaps copied to clipboard

city labels should be biased towards a direction (east/west?) based on bodies of water or proximity to other cities

Open bdon opened this issue 5 years ago • 5 comments

This needs to be done in a general way i.e. without regards to localization, as the names may be different lengths in different languages. Think about a slimmed down version of the https://github.com/migurski/Dymo approach.

bdon avatar Aug 30 '20 00:08 bdon

This doesn't actually work once you factor in map rotation, unless the rotation is available through the Style Spec.

bdon avatar Aug 21 '23 01:08 bdon

I'm make an unsupported claim that more than 90% of users don't actually rotate the map...

nvkelso avatar Aug 23 '23 06:08 nvkelso

Some more detail about what this would look like in practice:

When post-processing the places layer we have access to other data in memory, we can use that data to modify the default value of text-variable-anchor in the style

Cities on the west coast of California can have ['left','right'], Cities on the east coast of Florida have ['right',left'], etc

Can help the labels look a bit more cleaned up at low zooms

bdon avatar Aug 23 '23 06:08 bdon

Another option, if this is just for low zooms, is to add the city label text orientation to Natural Earth?

nvkelso avatar Aug 23 '23 06:08 nvkelso

@nvkelso yeah, that could work too! Otherwise we would need some weighting algorithm - probably based on position relative to water bodies

bdon avatar Aug 23 '23 06:08 bdon