Skip to content

Implement icon-optional and text-optional - #1568

Open
pjeweb wants to merge 1 commit into
openlayers:mainfrom
pjeweb:symbol-optional-dependencies
Open

pjeweb wants to merge 1 commit into
openlayers:mainfrom
pjeweb:symbol-optional-dependencies

Conversation

@pjeweb

@pjeweb pjeweb commented Oct 30, 2026 •

Copy link
Copy Markdown

Fixes #1566 together with openlayers/openlayers#17723.

Implements the icon-optional and text-optional layout properties. Both default to false in the style specification, so an icon and its text are only shown together.

Until now, ol-mapbox-style ignored them. When an icon collided while its text was allowed to overlap, as with text-allow-overlap: true and icon-allow-overlap: false, the text stayed visible on its own. For example, in a road shield layer styled like this, a route number could appear without its shield, on top of a neighboring shield.

The properties are passed to setOptional() of the OpenLayers image and text styles. With OpenLayers versions that lack setOptional(), nothing changes and the new test is skipped.

@pjeweb
pjeweb force-pushed the symbol-optional-dependencies branch from 7496fdb to 605fd82 Compare November 2, 2026 00:23
@pjeweb pjeweb changed the title Translate optional icon/text dependencies to OL symbolizers Implement icon-optional and text-optional Nov 2, 2026

This branch has not been deployed

No deployments
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.

Motorway numbers can remain visible after their shields are decluttered

1 participant