Skip to content

Scale feature styles according to a reference map scale and generalize rotation/scale handling for text, icon and circle #2210

@MattiasSp

Description

@MattiasSp

Description
Sometimes it is desirable to make icons/text/circles/etc smaller as the user zooms out and larger as they zoom in. This could make the map more readable. Other times users want the style to be locked to a specific size in map units, e g a constant diameter of X meters.

Proposed Solution
Setting style configuration parameters to control:

  • a reference map scale
    • e g "referenceMapScale": 10000 to show the icon in its normal size at map scale 1:10 000
  • a minimum size (scale)
    • e g "minStyleScaleFactor": 0.5 to never show the icon smaller than half its normal size
  • a maximum size (scale)
    • e g "maxStyleScaleFactor": 3 to never show the icon larger than three times its normal size

Alternatives Considered
The users can draw polygons instead to have them keep their true sizes, but this might be much more inconvenient.

Additional context

Image

EDIT: Updated the proposed names for the min- and max icon scale factors.

EDIT 2: Updated the names and description again to extend the issue to also generalize the scale and rotation handling so that it works the same for text, icon, circle and other basic shape styles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR acceptedAnyone can write a PR for this issue

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions