-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow labels to be placed across tile edges #688
Conversation
`"symbol-avoid-edges": true` can be used to let labels cross tile edges
Wow, nice! Where would you want to explicitly disable cross-tile labels — do you need it for symbols that are so big that padded data is not enough to prevent a symbol from colliding differently on adjacent tiles? |
@@ -6,12 +6,14 @@ var mat4 = require('../lib/glmatrix.js').mat4; | |||
module.exports = drawSymbols; | |||
|
|||
function drawSymbols(gl, painter, bucket, layerStyle, posMatrix, params, imageSprite) { | |||
gl.disable(gl.STENCIL_TEST); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noob question, why we need this here?
Reminder: We need to implement this in native before merging ;) |
@kkaefer but it's not a breaking change, so could be merged before porting to native... |
well, it affects the visual output, so stylesheets will look differently. |
+1 for port before merge on these kinds of features |
native pull request open at mapbox/mapbox-gl-native#419 |
Merged in -native |
allow labels to be placed across tile edges
symbol-avoid-edges
to spec addsymbol-avoid-edges
mapbox-gl-style-spec#141Cross tile labels will work the same way they do in mapnik maps. The vectortiles are padded with extra data that gets used to prevent most collisions. symbol-avoid-edges can be used to disable cross-tile labels in the cases this approach does not work well enough.
Labels that exceed tile boundaries may still get clipped during rendering because we're rendering tile-by-tile instead of layer-by-layer labels. #193 will fix this. Native already draws layer-by-layer.