[Map] How to change circle colors ? #3141
-
|
Hello, I'm using symfony/ux-map v2.30.0 (with symfony/ux-leaflet-map) I want to draw a circle and customize his colors : fill color and border color. And why not opacity. $circle = new Circle(
center: new Point(48.8566, 2.3522),
radius: 15_000,
infoWindow: new InfoWindow(
content: 'Circle centered on Paris',
),
color: 'red', // <---- fails
);Looking https://github.com/symfony/ux/blob/2.x/src/Map/src/Circle.php there is no parameter dealing with colors. How is it possible to do that ? Thanks ! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi, indeed there is no option for the color, it has been discussed in #2869/#2872. I suggest you to read https://symfony.com/bundles/ux-map/current/index.html#advanced-low-level-options and https://symfony.com/bundles/ux-map/current/index.html#advanced-passing-extra-data-from-php-to-the-stimulus-controller, the principe is to use Note that if your color/opacity/etc... will stays the same, you don't need to pass it in |
Beta Was this translation helpful? Give feedback.
Hi, indeed there is no option for the color, it has been discussed in #2869/#2872.
I suggest you to read https://symfony.com/bundles/ux-map/current/index.html#advanced-low-level-options and https://symfony.com/bundles/ux-map/current/index.html#advanced-passing-extra-data-from-php-to-the-stimulus-controller, the principe is to use
extrakey fromCircleto pass data from PHP to JavaScript, and use the events to color the circle by yourself by using the value retrieved fromextrakey.Note that if your color/opacity/etc... will stays the same, you don't need to pass it in
extrakey, you can directly use your color/opacity/... JavaScript side