tilemill-project / tilemill

TileMill is a modern map design studio
https://tilemill-project.github.io/tilemill/
BSD 3-Clause "New" or "Revised" License
3.12k stars 528 forks source link

Text/marker overlap - only overlap other layers, but not other objects on the same layer #2627

Closed dannyuk1982 closed 6 years ago

dannyuk1982 commented 6 years ago

Hi all, anyone know how to action this, or can functionality be added?

I basically have this issue: https://gis.stackexchange.com/questions/220890/mapnik-cartocss-make-text-labels-overlap-other-layers-but-not-each-other

I have a couple of layers (subways stations being one) where I need the labels/markers to not overlap each other (but only for this later), otherwise there e.g. are 4-5 exits for a station and it's unreadable as they all overlap. However, they DO need to overlap (or at least always take priority) over other laters such as road names and area names. Even with the e.g. subway layer being on top, with the style for its markers/text declared before anything, things like area names stop it being rendered sometimes.

The workaround in that link is to pass MapNik clear-label-cache="on", I have tried this as a string in project.mml and also a JSON object. I can't do within the TileMill GUI as setting anything in the advanced box gives an Error: Page no found

csytsma commented 6 years ago

In regard to passing Mapnik options, have you tried exporting to XML, then manually editing the XML file? Tilemill will supposedly then use that XML file the next time you export.

http://tilemill-project.github.io/tilemill/docs/manual/exporting/#mapnik-xml-export http://tilemill-project.github.io/tilemill/docs/manual/exporting/#mapnik-xml-export

On Aug 17, 2018, at 9:26 AM, Danny Richardson notifications@github.com wrote:

Hi all, anyone know how to action this, or can functionality be added?

I basically have this issue: https://gis.stackexchange.com/questions/220890/mapnik-cartocss-make-text-labels-overlap-other-layers-but-not-each-other https://gis.stackexchange.com/questions/220890/mapnik-cartocss-make-text-labels-overlap-other-layers-but-not-each-other I have a couple of layers (subways stations being one) where I need the labels/markers to not overlap each other (but only for this later), otherwise there e.g. are 4-5 exits for a station and it's unreadable as they all overlap. However, they DO need to overlap (or at least always take priority) over other laters such as road names and area names. Even with the e.g. subway layer being on top, with the style for its markers/text declared before anything, things like area names stop it being rendered sometimes.

The workaround in that link is to pass MapNik clear-label-cache="on", I have tried this as a string in project.mml and also a JSON object. I can't do within the TileMill GUI as setting anything in the advanced box gives an Error: Page no found

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tilemill-project/tilemill/issues/2627, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH3RBi2VduaU27dCje71kAP1hbiGbMTks5uRu6fgaJpZM4WB1_N.

dannyuk1982 commented 6 years ago

Hey @csytsma, that actually works great, nice one, thank you! So I ended up with:

<Layer name="stations" clear-label-cache="on"