Apply repeat group logic to points #424
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have only been applying repeat group logic (
repeat_group
andrepeat_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:
This adds repeat groups to the
points
style, with the following distinctions fromtext
styles: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).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). Forpoints
, the repeat group consists only of fully qualified layer name (the point doesn't have any text or other distinguishing properties to add).text
draw group nested under apoints
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: