Skip to content

Commit 2cb3cfe

Browse files
javiereguiluzKocal
authored andcommitted
[UX Map] Misc updates in the docs
1 parent 540a847 commit 2cb3cfe

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

src/Map/doc/index.rst

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ The ``UX_MAP_DSN`` environment variable configure which renderer to use.
4444
Available renderers
4545
~~~~~~~~~~~~~~~~~~~
4646

47-
========== ===============================================================
47+
============== ===============================================================
4848
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+
============== ===============================================================
5555

5656
Usage
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+
207219
Then, 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

Comments
 (0)