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

Apply repeat group logic to points #424

Closed
wants to merge 1 commit into from
Closed

Apply repeat group logic to points #424

wants to merge 1 commit into from

Conversation

bcamper
Copy link
Member

@bcamper bcamper commented Oct 12, 2016

We have only been applying repeat group logic (repeat_group and repeat_distance) to text labels (both point and line labels).

This behavior is also useful for points themselves. For example, this can be used to "thin out" shields at lower zooms:

shield-thinning

This adds repeat groups to the points style, with the following distinctions from text styles:

  • Repeat logic is off by default (repeat_distance defaults to zero). While generally expected for labels, I think repeat rules for standalone points/icons is something that users should opt into (or it can unintentionally obscure data).
  • For text, the default repeat group name is a concatenation of fully qualified layer name (e.g. roads:highways:labels) and the label string. This means that repeat restrictions are applied to labels in the same layer with the same text (e.g. we don't want a "5th Ave" label to repeat over and over). For points, the repeat group consists only of fully qualified layer name (the point doesn't have any text or other distinguishing properties to add).
  • A text draw group nested under a points draw group can have different repeat group settings.

The above behavior was arrived at while working through the shield example above, where the desire is to have reduced spacing for shields generally, while maintaining the default label spacing on shields with the same text. Having to apply the same spacing to both led to cases that were either too sparse or too dense, or with a reasonable overall density but too many of the same shield repeating next to itself.

The above example is styled similar to this:

draw:
  icons:
    sprite: shield
    repeat_distance: 75px # set repeat distance for shields generally
    text:
      anchor: center
      text_source: shield_text
      # default repeat distance will additionally be applied for shields with the same text

@bcamper
Copy link
Member Author

bcamper commented Oct 12, 2016

@karimnaaji let's discuss re: ES, I think the current behavior is mostly the same, but also seeing some oddities with my shield example, maybe we can resolve both at the same time.

@dmvaldman
Copy link
Contributor

This is something I did in a separate pull request that hasn't been merged yet here: 7c120e0

@dmvaldman
Copy link
Contributor

In the LabelMultipoint PR #409

@bcamper
Copy link
Member Author

bcamper commented Oct 12, 2016

Haha whoops. Short memory :)

@bcamper
Copy link
Member Author

bcamper commented Oct 17, 2016

Closing in favor of #409.

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.

2 participants