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

Enable variable label placement when {text|icon}-allow-overlap properties are set to true #8527

Closed
tristen opened this issue Jul 22, 2019 · 7 comments · Fixed by #8620
Closed
Assignees
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) feature 🍏
Milestone

Comments

@tristen
Copy link
Member

tristen commented Jul 22, 2019

In the example below, if text-allow-overlap is set to true I would still expect variable label placement to work on finding the optimal display. Instead, it appears clustered like this:

variable placement

Here's what my layer looks like:

{
  id: 'foo',
  type: 'symbol',
  source: 'composite',
  'source-layer': 'housenum_label',
  layout: {
    'text-field': 'I am a label',
    'text-size': 12.5,
    'text-allow-overlap': true,
    'text-variable-anchor': [
      'center',
      'left',
      'right',
      'top',
      'bottom',
      'top-left',
      'top-right',
      'bottom-left',
      'bottom-right'
    ],
    'text-justify': 'auto'
  }
}

Mapbox GL JS Version: v1.1.1
And a link to the demo: https://jsfiddle.net/tristen/tpaygf4w/

@tristen tristen changed the title Don't disable variable label placement if text-allow-overlap is set to true Enable variable label placement when text-allow-overlap is set to true Jul 22, 2019
@chloekraw chloekraw added this to the release-queso milestone Jul 22, 2019
@tristen tristen changed the title Enable variable label placement when text-allow-overlap is set to true Enable variable label placement when {text|icon}-allow-overlap properties are set to true Jul 22, 2019
@mourner mourner added needs discussion 💬 cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) feature 🍏 labels Jul 22, 2019
@ansis
Copy link
Contributor

ansis commented Jul 25, 2019

Are you expecting it to try different positions looking for one without collisions and only allow a collision if there is no position without a collision?

@tristen
Copy link
Member Author

tristen commented Jul 26, 2019

Are you expecting it to try different positions looking for one without collisions and only allow a collision if there is no position without a collision?

@ansis right. Even if *-allow-overlap is true I would expect variable label placement to still try and find an optimized position before concluding there will be overlap.

@chloekraw
Copy link
Contributor

chloekraw commented Aug 5, 2019

cc: @pozdnyakov @alexshalamov, for visibility

@pozdnyakov
Copy link
Contributor

Implementation for gl-native mapbox/mapbox-gl-native#15354

@tristen
Copy link
Member Author

tristen commented Aug 12, 2019

Whoa! Amazing @pozdnyakov. Should this be left open for the GL JS portion of the work?

@pozdnyakov
Copy link
Contributor

Should this be left open for the GL JS portion of the work?

Is it fine, if I make a separate issue in GL Native to track mapbox/mapbox-gl-native#15354

@chloekraw
Copy link
Contributor

@tristen #8620 is in gl-js!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) feature 🍏
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants