Skip to content

[UX Map] Use color attribute on a Polygon with leaflet bridge #2872

Closed Answered by Kocal
michelcourtade asked this question in Questions & Answers
Discussion options

You must be logged in to vote

Hi, the purpose to the extra data (extra property) is to pass some Map/Map elements related data from PHP to a custom Stimulus controller. In your case, you want to pass the color red for a specific Polygon.

You must use extra data aside low-level options as mentioned in the documentation: https://symfony.com/bundles/ux-map/current/index.html#advanced-low-level-options

Combining with extra data, it should looks like this:

        _onPolygonBeforeCreate(event) {
            const { color } = event.detail.definition.extra;

            if (!color) { 
                return;
            }

            // When using Google Maps, to configure a `google.maps.Polygon`
            event.detail.de…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@michelcourtade
Comment options

Answer selected by michelcourtade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants
Converted from issue

This discussion was converted from issue #2869 on June 27, 2025 13:25.