gravitystorm / openstreetmap-carto

A general-purpose OpenStreetMap mapnik style, in CartoCSS
Other
1.55k stars 821 forks source link

When label does not fit below icon, render label on top or side #957

Closed kocio-pl closed 8 years ago

kocio-pl commented 10 years ago

In places, where there is a lot of icons and names to display, carto is performing quite bad, because it always try to render icon with text under it, and when there is not enough space, it simply hides them. However HOT does it better - it tries to move the names so they don't overlap and don't have to be hidden.

Example - all 6 names instead of just 4 on the same zoom level (in the centre, top left corner of Francuska nad Walecznych crossing):

http://www.openstreetmap.org/#map=19/52.23517/21.05308 http://www.openstreetmap.org/#map=19/52.23517/21.05308&layers=H

kocio-pl commented 9 years ago

Sometimes it stops at 18. Sometimes 22.

Is it possible to start using variable called "zmax" maybe? Then we would apply smart labeling always at the very end of the zoom scale, no matter which one is used for given service.

pnorman commented 9 years ago

focus on the cartographic reasons to make a decision instead

Circling back to this, is there a reason not to use text-placements on more than one zoom level?

kocio-pl commented 9 years ago

I mentioned one reason already: the fear of the clutter at some zoom levels, especially the entry one for such POIs (namely z17). I could not however say if it's "cartographic" or not.

kocio-pl commented 8 years ago

Is there still some interest in this solution or is it problematic?

daganzdaanda commented 8 years ago

I dislike the big text-dy gap that we need now. So I wouldn't mind changing all the labels to sit on one side (right?) of the icons. I don't think that an automated random placement left/right/below will work very well. It would need a lot of "padding" to make sure that it's always clear what is labeled. In the end, we would probably hide more POIs than necessary.

kocio-pl commented 8 years ago

There is no way to have consistent gap, because icon shape is within certain matrix (usually 14x14 px), but does not always touch the (bottom) border. Changing the side to some other fixed one does not help this problem, because some shapes are tall and don't touch the left/right border too. Or rather there is a way - we would have to change all the icons to touch given border - but those shapes would be then shifted from the centre and it is just a different problem which may be either better or worse.

I also believe that dynamic placing helps show more than with static placing - or at least not less.

matthijsmelissen commented 8 years ago

I have experimented a bit with left/right placement, but the results were not really legible. With left/right placement, it became very unclear which labels were connected to which icons. Sorry, no screenshot anymore. I therefore think alternating bottom/left/right-labelling is not viable, so I'll close this ticket. Feel free to open a new ticket for other ideas, such as right-only labelling.