Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Ux Leaflet Map

Ux Leaflet Map Laravel Package

symfony/ux-leaflet-map

Leaflet integration for Symfony UX Map. Install via Composer, configure the leaflet://default DSN, and customize maps with LeafletOptions, tile layers, controls, and Stimulus events for markers.

View on GitHub
Deep Wiki
Context7

Symfony UX Map Leaflet Bridge

Frequently asked questions about Ux Leaflet Map
What is symfony/ux-leaflet-map used for?
It is the Leaflet bridge for Symfony UX Map. It lets you define maps, markers, and Leaflet options in PHP or Twig and render them with Stimulus-powered frontend assets. In a Laravel context, it is best treated as a JavaScript and Stimulus integration rather than a native Laravel package.
Can I use symfony/ux-leaflet-map in a Laravel application?
Yes, but not as a drop-in Laravel package. The PHP side depends on Symfony UX Map and Twig components, so Laravel integration usually means either adopting Symfony UX pieces or using the standalone @symfony/ux-leaflet-map npm package with a manually registered Stimulus controller. If your app already uses Livewire or Inertia, evaluate whether direct Leaflet.js plus Alpine.js is simpler.
How do I install symfony/ux-leaflet-map in Laravel?
For the full Symfony UX path, install symfony/ux-leaflet-map via Composer and configure UX_MAP_DSN=leaflet://default, but this brings Symfony 6.4+ and PHP 8.4+ requirements for v3. For a lighter Laravel setup, install @symfony/ux-leaflet-map from npm, register its Stimulus controller, bundle Leaflet CSS and JS with Vite or Laravel Mix, and pass map data from Blade or API endpoints.
What PHP and Symfony versions does symfony/ux-leaflet-map require?
Current v3 releases require PHP 8.4+ and Symfony 6.4+ components, while older v2.35 releases support PHP 8.1+. That can block legacy Laravel projects that have not upgraded PHP. Check the installed bridge version before planning a Laravel integration.
Do I need Symfony UX Map to use this Leaflet bridge?
The Composer package is designed as a bridge for Symfony UX Map, so the PHP and Twig workflow expects Symfony UX Map classes such as Map, Point, and LeafletOptions. You can avoid the PHP package by using the npm package @symfony/ux-leaflet-map for the Stimulus controller only. In that case you lose the Twig component and PHP-side map configuration convenience.
How do I configure Leaflet options with symfony/ux-leaflet-map?
Use the LeafletOptions class to set tile layers, attribution controls, zoom controls, and other Leaflet settings, then attach it to a Map with $map->options($leafletOptions). The DSN example is UX_MAP_DSN=leaflet://default. In Laravel, you would need to replicate this configuration in PHP if you adopt Symfony UX, or pass equivalent options to the Stimulus and Leaflet setup manually.
How do I add or customize markers in a Laravel Leaflet map?
With Symfony UX Map, markers are defined through the Map API and rendered by the bridge. For custom marker behavior, listen for the ux:map:marker:before-create event in a Stimulus controller and adjust the marker before creation. In Laravel, the same event works if you register the Stimulus controller, but marker data must come from Blade, an API endpoint, or a custom JavaScript store.
Does symfony/ux-leaflet-map work with Vite or Laravel Mix?
The Symfony side supports Webpack Encore and AssetMapper, and the underlying Leaflet CSS and JS must be bundled correctly. In Laravel, Vite or Laravel Mix can work, but you may need to resolve Leaflet asset aliases such as leaflet.min.css and ensure the Stimulus controller is registered. AssetMapper is less relevant in Laravel and generally not the path you would take.
Is symfony/ux-leaflet-map production-ready for Laravel projects?
Leaflet itself is mature and widely used, and Symfony UX 3.x indicates ongoing maintenance. The risk is integration fit: Symfony UX assumptions, PHP 8.4+ for v3, and frontend asset and Stimulus setup add maintenance overhead in Laravel. For production, assign ownership for Leaflet and Stimulus updates, and test map events and tile layers across browsers.
What are Laravel-friendly alternatives to symfony/ux-leaflet-map?
For many Laravel apps, using Leaflet.js directly with Alpine.js, Inertia, or Livewire is simpler than adopting Symfony UX. You can also consider commercial APIs such as Google Maps or Mapbox if you need advanced styling or support. Choose symfony/ux-leaflet-map mainly if you already use Symfony UX or want its PHP and Twig map configuration model.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package