@@ -44,14 +44,14 @@ The ``UX_MAP_DSN`` environment variable configure which renderer to use.
44
44
Available renderers
45
45
~~~~~~~~~~~~~~~~~~~
46
46
47
- ========== ===============================================================
47
+ ============== ===============================================================
48
48
Renderer
49
- ========== ===============================================================
50
- `Google `_ **Install **: ``composer require symfony/ux-google-map `` \
51
- **DSN **: ``UX_MAP_DSN=google://GOOGLE_MAPS_API_KEY@default `` \
52
- `Leaflet `_ **Install **: ``composer require symfony/ux-leaflet-map `` \
53
- **DSN **: ``UX_MAP_DSN=leaflet://default `` \
54
- ========== ===============================================================
49
+ ============== ===============================================================
50
+ `Google Maps `_ **Install **: ``composer require symfony/ux-google-map `` \
51
+ **DSN **: ``UX_MAP_DSN=google://GOOGLE_MAPS_API_KEY@default `` \
52
+ `Leaflet `_ **Install **: ``composer require symfony/ux-leaflet-map `` \
53
+ **DSN **: ``UX_MAP_DSN=leaflet://default `` \
54
+ ============== ===============================================================
55
55
56
56
Usage
57
57
-----
@@ -102,14 +102,20 @@ A map is created by calling ``new Map()``. You can configure the center, zoom, a
102
102
)
103
103
))
104
104
105
- // You can also pass extra data, that you can later use in your custom Stimulus controller
106
- // when listening to "ux:map:marker:before-create" event:
105
+ // You can also pass arbitrary data via the `extra` option in both the marker
106
+ // and the infoWindow; you can later use this data in your custom Stimulus controllers
107
107
->addMarker(new Marker(
108
- position: new Point(46.5074666, 6.633729),
109
- title: 'Olympic Parc',
108
+ // ...
110
109
extra: [
111
110
'icon_mask_url' => 'https://maps.gstatic.com/mapfiles/place_api/icons/v2/tree_pinlet.svg',
112
- ]
111
+ ],
112
+ infoWindow: new InfoWindow(
113
+ // ...
114
+ extra: [
115
+ 'num_items' => 3,
116
+ 'includes_link' => true,
117
+ ],
118
+ ),
113
119
)
114
120
;
115
121
@@ -204,6 +210,12 @@ Symfony UX Map allows you to extend its default behavior using a custom Stimulus
204
210
}
205
211
}
206
212
213
+ .. tip ::
214
+
215
+ Read the `Symfony UX Map Leaflet bridge docs `_ and the
216
+ `Symfony UX Map Google Maps brige docs `_ to learn about the exact code
217
+ needed to customize the markers.
218
+
207
219
Then, you can use this controller in your template:
208
220
209
221
.. code-block :: twig
@@ -219,5 +231,7 @@ https://symfony.com/doc/current/contributing/code/bc.html
219
231
220
232
.. _`the Symfony UX initiative` : https://ux.symfony.com/
221
233
.. _StimulusBundle configured in your app : https://symfony.com/bundles/StimulusBundle/current/index.html
222
- .. _`Google` : https://github.com/symfony/symfony-ux/blob/{version}/src/Map/src/Bridge/Google/README.md
223
- .. _`Leaflet` : https://github.com/symfony/symfony-ux/blob/{version}/src/Map/src/Bridge/Leaflet/README.md
234
+ .. _`Google Maps` : https://github.com/symfony/ux-google-map
235
+ .. _`Leaflet` : https://github.com/symfony/ux-leaflet-map
236
+ .. _`Symfony UX Map Google Maps brige docs` : https://github.com/symfony/symfony-ux/blob/{version}/src/Map/src/Bridge/Google/README.md
237
+ .. _`Symfony UX Map Leaflet bridge docs` : https://github.com/symfony/symfony-ux/blob/{version}/src/Map/src/Bridge/Leaflet/README.md
0 commit comments