Weave Code
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 Map Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Easily embed interactive maps in your Symfony application

Frequently asked questions about Ux Map
Can I use symfony/ux-map in a Laravel project without Symfony?
No, symfony/ux-map requires Symfony UX 3.x, which isn’t natively compatible with Laravel. You’d need the Symfony Bridge (v7.4+) and adopt Symfony UX conventions like Stimulus controllers. Alternatively, use standalone Leaflet.js, but you’ll lose server-driven map configurations and reactivity.
What Laravel versions support symfony/ux-map via Symfony Bridge?
Laravel projects using the Symfony Bridge must align with Symfony 7.4+ and Symfony UX 3.x. There’s no direct Laravel version lock—compatibility depends on your Bridge setup and Stimulus/UX adoption. Test with Laravel 10.x+ for best results.
How do I configure Leaflet.js providers (e.g., Mapbox, OpenStreetMap) in symfony/ux-map?
Use Twig’s `ux_map()` function or `<twig:ux:map>` component to define providers. For Mapbox, include your access token in the `provider` option (e.g., `provider: 'mapbox://...'`). OpenStreetMap is pre-configured via `provider: 'osm'`. Custom providers require extending the `MapRenderer` class.
Will symfony/ux-map work with my existing PostGIS database in Laravel?
Yes, symfony/ux-map is backend-agnostic. If your Laravel app uses PostGIS (via spatie/laravel-postgis or similar), you can fetch geospatial data normally and pass it to Twig for map rendering. No additional setup is needed for PostGIS queries.
What’s the migration path from Symfony UX 2.x to 3.x for symfony/ux-map?
Symfony UX 3.x introduces breaking changes, like updated Stimulus controller syntax and Live Component APIs. Replace deprecated `render_map()` with `ux_map()` in Twig, and update Stimulus imports (e.g., `@symfony/ux-map` instead of older paths). Test thoroughly—some custom controllers may need refactoring.
Can I use Google Maps API with symfony/ux-map instead of Leaflet?
Yes, but you’ll need to create a custom `MapRenderer` extending `AbstractMapRenderer` and configure it for Google Maps. Leaflet is the default and recommended provider, but Google Maps is supported via the `provider` option in Twig. Note: This requires a Google Maps API key and may incur costs.
How do I handle dynamic markers or real-time updates in symfony/ux-map?
Use Symfony UX’s Live Components to update markers dynamically. Pass data via Twig’s `ux_map()` attributes (e.g., `markers: {{ dump(app.data) }}`) and leverage Stimulus actions to trigger updates. For real-time features, combine with Laravel Echo or Mercure for server pushes.
Are there performance concerns with symfony/ux-map in production?
Leaflet.js is lightweight, but complex maps (e.g., thousands of markers) may impact performance. Optimize by using clustering (via Leaflet.markercluster) or lazy-loading tiles. Enable Symfony’s asset mapper for production to minify JS/CSS. Monitor bundle sizes if using multiple UX components.
What alternatives exist for interactive maps in Laravel if symfony/ux-map isn’t ideal?
For Laravel-only projects, consider: **Leaflet.js standalone** (manual JS integration), **Mapbox GL JS** (for advanced maps), or Laravel-specific packages like `spatie/laravel-geo`. If you need Symfony UX features, **symfony/ux-map** is the most integrated option, but standalone libraries offer more flexibility.
How do I debug Stimulus/UX issues with symfony/ux-map in Laravel?
Enable Symfony’s Stimulus debug mode in your Bridge config and check browser console logs for errors. Use `stimulus:debug` in Twig to inspect registered controllers. For Laravel, ensure the Symfony Bridge’s asset pipeline is correctly configured. Common issues include missing Stimulus imports or Twig syntax errors in map components.
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.
graham-campbell/flysystem
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi