Download the PHP package symfony/ux-leaflet-map without Composer
On this page you can find all versions of the php package symfony/ux-leaflet-map. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download symfony/ux-leaflet-map
More information about symfony/ux-leaflet-map
Files in symfony/ux-leaflet-map
Package ux-leaflet-map
Short Description Symfony UX Map Leaflet Bridge
License MIT
Homepage https://symfony.com
Informations about the package ux-leaflet-map
Symfony UX Map: Leaflet
Leaflet integration for Symfony UX Map.
Installation
Install the bridge using Composer and Symfony Flex:
If you're using WebpackEncore, install your assets and restart Encore (not needed if you're using AssetMapper):
[!NOTE] Alternatively, @symfony/ux-leaflet-map package can be used to install the JavaScript assets without requiring PHP.
DSN example
Map options
You can use the LeafletOptions class to configure your Map::
Use cases
Below are some common or advanced use cases when using a map.
Customize the marker
A common use case is to customize the marker. You can listen to the ux:map:marker:before-create event to customize the marker before it is created.
Assuming you have a map with a custom controller:
You can create a Stimulus controller to customize the markers before they are created:
Disable the default tile layer
If you need to use a custom tiles layer rendering engine that is not compatible with the L.tileLayer().addTo(map) method
(e.g. Esri/esri-leaflet-vector), you can disable the default tile layer by passing tileLayer: false to the LeafletOptions:
Known issues
Unable to find leaflet/dist/leaflet.min.css file when using Webpack Encore
When using Webpack Encore with the Leaflet bridge, you may encounter the following error:
That's because the Leaflet's Stimulus controller references the leaflet/dist/leaflet.min.css file,
which exists on jsDelivr (used by the Symfony AssetMapper component),
but does not in the leaflet npm package.
The correct path is leaflet/dist/leaflet.css, but it is not possible to fix it because it would break compatibility
with the Symfony AssetMapper component.
As a workaround, you can configure Webpack Encore to add an alias for the leaflet/dist/leaflet.min.css file:
Resources
All versions of ux-leaflet-map with dependencies
symfony/stimulus-bundle Version ^2.18.1|^3.0
symfony/ux-map Version ^2.19|^3.0