mirror of
https://github.com/symfony/ux-leaflet-map.git
synced 2026-03-24 00:52:09 +01:00
feaa3c5f6af668097d3e16f74c2cfd96666b5f6a
Symfony UX Map: Leaflet
Leaflet integration for Symfony UX Map.
DSN example
UX_MAP_DSN=leaflet://default
Map options
You can use the LeafletOptions class to configure your Map::
use Symfony\UX\Map\Bridge\Leaflet\LeafletOptions;
use Symfony\UX\Map\Bridge\Leaflet\Option\TileLayer;
use Symfony\UX\Map\Point;
use Symfony\UX\Map\Map;
$map = (new Map())
->center(new Point(48.8566, 2.3522))
->zoom(6);
$leafletOptions = (new LeafletOptions())
->tileLayer(new TileLayer(
url: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
options: [
'minZoom' => 5,
'maxZoom' => 10,
]
))
;
// Add the custom options to the map
$map->options($leafletOptions);
Resources
Languages
PHP
57.1%
TypeScript
42.9%