2024-08-07 14:14:07 +02:00
2024-08-07 14:14:07 +02:00
2024-08-07 14:14:07 +02:00
2024-08-07 14:14:07 +02:00
2024-08-07 14:14:07 +02:00
2024-08-07 14:14:07 +02:00
2024-08-07 14:14:07 +02:00
2024-08-07 14:14:07 +02:00
2024-08-07 14:14:07 +02:00
2024-08-07 14:14:07 +02:00
2024-08-07 14:14:07 +02:00

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

Description
⚠️ ARCHIVED: Original GitHub repository no longer exists. Preserved as backup on 2026-01-22T16:42:37.924Z
Readme MIT 311 KiB
Languages
PHP 57.1%
TypeScript 42.9%