@@ -44,14 +44,14 @@ The ``UX_MAP_DSN`` environment variable configure which renderer to use.
4444Available renderers
4545~~~~~~~~~~~~~~~~~~~
4646
47- ========== ===============================================================
47+ ============== ===============================================================
4848Renderer
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+ ============== ===============================================================
5555
5656Usage
5757-----
@@ -102,14 +102,20 @@ A map is created by calling ``new Map()``. You can configure the center, zoom, a
102102 )
103103 ))
104104
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
107107 ->addMarker(new Marker(
108- position: new Point(46.5074666, 6.633729),
109- title: 'Olympic Parc',
108+ // ...
110109 extra: [
111110 '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+ ),
113119 )
114120 ;
115121
@@ -204,6 +210,12 @@ Symfony UX Map allows you to extend its default behavior using a custom Stimulus
204210 }
205211 }
206212
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+
207219Then, you can use this controller in your template:
208220
209221.. code-block :: twig
@@ -219,5 +231,7 @@ https://symfony.com/doc/current/contributing/code/bc.html
219231
220232.. _`the Symfony UX initiative` : https://ux.symfony.com/
221233.. _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