You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Map/doc/index.rst
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Configuration is done in your ``config/packages/ux_map.yaml`` file:
33
33
# without to manually configure it in each map instance (through "new GoogleOptions(mapId: 'your_map_id')").
34
34
default_map_id: null
35
35
36
-
The ``UX_MAP_DSN`` environment variable configure which renderer to use.
36
+
The ``UX_MAP_DSN`` environment variable configure which renderer (Bridge) to use.
37
37
38
38
Map renderers
39
39
~~~~~~~~~~~~~
@@ -383,7 +383,19 @@ Symfony UX Map allows you to extend its default behavior using a custom Stimulus
383
383
* You can use this event to configure the map before it is created
384
384
*/
385
385
_onPreConnect(event) {
386
+
// You can read or write the zoom level
387
+
console.log(event.detail.zoom);
388
+
389
+
console.log(event.detail.center);
390
+
391
+
// You can read or write map options, specific to the Bridge, it represents the normalized `*Options` PHP class (e.g. `GoogleOptions`, `LeafletOptions`)
386
392
console.log(event.detail.options);
393
+
394
+
// Finally, you can also set Bridge-specific options that will be used when creating the map.
395
+
event.detail.bridgeOptions= {
396
+
preferCanvas:true, // e.g. for Leaflet (https://leafletjs.com/reference.html#map-prefercanvas)
397
+
backgroundColor:'#f0f0f0', // e.g. for Google Maps (https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions.backgroundColor)
0 commit comments