Skip to content
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

Merged
merged 1 commit into from
Aug 15, 2014
Merged

allow labels to be placed across tile edges #688

merged 1 commit into from
Aug 15, 2014

Conversation

ansis
Copy link
Contributor

@ansis ansis commented Aug 11, 2014

Cross 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.

`"symbol-avoid-edges": true` can be used to let labels cross tile edges
@ansis ansis mentioned this pull request Aug 11, 2014
@mourner
Copy link
Member

mourner commented Aug 12, 2014

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);
Copy link
Member

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?

@kkaefer
Copy link
Contributor

kkaefer commented Aug 12, 2014

Reminder: We need to implement this in native before merging ;)

@mourner
Copy link
Member

mourner commented Aug 12, 2014

@kkaefer but it's not a breaking change, so could be merged before porting to native...

@kkaefer
Copy link
Contributor

kkaefer commented Aug 12, 2014

well, it affects the visual output, so stylesheets will look differently.

@yhahn
Copy link
Member

yhahn commented Aug 12, 2014

+1 for port before merge on these kinds of features

@ansis
Copy link
Contributor Author

ansis commented Aug 13, 2014

native pull request open at mapbox/mapbox-gl-native#419

@kkaefer
Copy link
Contributor

kkaefer commented Aug 15, 2014

Merged in -native

mourner added a commit that referenced this pull request Aug 15, 2014
allow labels to be placed across tile edges
@mourner mourner merged commit 3bf0614 into mb-pages Aug 15, 2014
@mourner mourner deleted the crosstile branch August 15, 2014 14:27
@mourner mourner added this to the v0.3 milestone Aug 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants