symfony/ux-map
Symfony UX Map adds interactive maps to Symfony apps with easy integration for providers like Leaflet and Google Maps. Part of the Symfony UX ecosystem; documentation and issue tracking live in the main symfony/ux repository.
symfony/ux v4.x, which introduces Stimulus 2.x and Live Components 2.x). This ensures compatibility with Symfony 7.x/8.x and future-proofs the integration with modern Symfony features like Turbo 2.x and Mercure.symfony/ux-web-component integration), enabling interoperability with modern frameworks like React or Vue while maintaining PHP-driven logic.symfony/ux conventions (e.g., Stimulus 2.x controllers, Live Components 2.x, and Web Component support).symfony/ux-map:^3.1.0 + Symfony Bridge (now compatible with UX 4.x). Laravel projects must adopt Stimulus 2.x syntax and Live Components 2.x.alpinejs or lit).spatie/laravel-postgis) still required.initialize() replaced with connect() in some cases) and controller composition (mixing controllers).x-data → x-model).data-controller attributes, TypeScript support).x-bind:model instead of x-data).| Component | Symfony Fit (UX 4.x) | Laravel Adaptation |
|---|---|---|
| Frontend | Symfony UX 4.x (Stimulus 2.x + Live Components 2.x) + Twig | Blade + Alpine.js/Stimulus 2.x or Inertia + Vue/React |
| Web Components | Experimental (symfony/ux-web-component) | Custom wrappers or standalone (e.g., Lit) |
| Backend | Symfony Controllers + Doctrine + Mercure | Laravel Controllers + Eloquent/PostGIS + Laravel Echo |
| Mapping Library | Leaflet.js (wrapped) | Leaflet.js (direct) or Mapbox GL JS |
| Geospatial DB | PostGIS (native) | PostGIS or custom client-side logic |
| Real-Time | Turbo 2.x + Mercure | Laravel Echo + Pusher/Ably |
| APIs | Symfony HTTP Client | Laravel HTTP Client or Guzzle |
composer require symfony/ux-map:^3.1 symfony/ux:^4.0 symfony/ux-turbo:^2.0
initialize() with connect() where applicable.extends Controller).// assets/controllers/map_controller.js
import { Controller } from '@hotwired/stimulus';
export default class extends Controller {
static targets = ['marker'];
connect() {
const map = L.map('map').setView([this.latitudeValue, this.longitudeValue], 13);
L.tileLayer('...').addTo(map);
}
}
x-data with x-model.x-bind:model for two-way binding.symfony/mercure-bundle).symfony/ux-web-component).symfony/ux-map:^3.1 + symfony/ux:^4.0 via Symfony Bridge.<div data-controller="map"
data-map-latitude-value="{{ $location->lat }}"
data-map-longitude-value="{{ $location->lng }}">
{{ include('components/map.html.twig') }}
</div>
How can I help you explore Laravel packages today?