mirror of
https://github.com/symfony/ux-map.git
synced 2026-03-23 23:42:07 +01:00
4.9 KiB
4.9 KiB
CHANGELOG
2.32
- Add
Map::removeAllMarkers(),Map::removeAllPolygons(),Map::removeAllPolylines(),Map::removeAllCircles()andMap::removeAllRectangles()methods
2.31
- Add
fitBoundsToMarkersparameter toux_map()Twig function
2.30
- Ensure compatibility with PHP 8.5
- Deprecate option
titlefromPolygon,Polyline,RectangleandCirclein favor ofinfoWindow
2.29.0
- Add Symfony 8 support
- Add
Clusterclass andClusteringAlgorithmInterfacewith two implementationsGridClusteringAlgorithmandMortonClusteringAlgorithm
2.28
- Add
minZoomandmaxZoomoptions toMapto set the minimum and maximum zoom levels
2.27
-
The
fitBoundsToMarkersoption is not overridden anymore when using theMapLiveComponent, but now respects the value you defined. You may encounter unwanted behavior when adding/removing elements to the map. To use the previous behavior, you must call$this->getMap()->fitBoundsToMarkers(false)in your LiveComponent's live actions -
Add support for creating
Circleby passing aPointand a radius (in meters) to theCircleconstructor, e.g.:
$map->addCircle(new Circle(
center: new Point(48.856613, 2.352222), // Paris
radius: 5_000 // 5km
));
- Add support for creating
Rectangleby passing twoPointinstances to theRectangleconstructor, e.g.:
$map->addRectangle(new Rectangle(
southWest: new Point(48.856613, 2.352222), // Paris
northEast: new Point(48.51238 2.21080) // Gare de Lyon (Paris)
));
- Deprecate property
rawOptionsfromux:map:*:before-createevents, in favor ofbridgeOptionsinstead. - Map options can now be configured and overridden through the
ux:map:pre-connectevent:
this.element.addEventListener('ux:map:pre-connect', (event) => {
// Override the map center and zoom
event.detail.zoom = 10;
event.detail.center = { lat: 48.856613, lng: 2.352222 };
// Override the normalized `*Options` PHP classes (e.g. `GoogleMapOptions` or `LeafletMapOptions`)
console.log(event.detail.options);
// Override the options specific to the renderer bridge (e.g. `google.maps.MapOptions` or `L.MapOptions`)
event.detail.bridgeOptions = {
// ...
};
});
- Add
extradata support toMap, which can be accessed inux:map:pre-connectandux:map:connectevents
2.26
- Add support for creating
Polygonwith holes, by passing an array ofarray<Point>aspointsparameter to thePolygonconstructor, e.g.:
// Draw a polygon with a hole in it, on the French map
$map->addPolygon(new Polygon(points: [
// First path, the outer boundary of the polygon
[
new Point(48.117266, -1.677792), // Rennes
new Point(50.629250, 3.057256), // Lille
new Point(48.573405, 7.752111), // Strasbourg
new Point(43.296482, 5.369780), // Marseille
new Point(44.837789, -0.579180), // Bordeaux
],
// Second path, it will make a hole in the previous one
[
new Point(45.833619, 1.261105), // Limoges
new Point(45.764043, 4.835659), // Lyon
new Point(49.258329, 4.031696), // Reims
new Point(48.856613, 2.352222), // Paris
],
]));
2.25
- Downgrade PHP requirement from 8.3 to 8.1
2.24
- Installing the package in a Symfony app using Flex won't add the
@symfony/ux-mapdependency to thepackage.jsonfile anymore. - Add
Iconto customize aMarkericon (URL or SVG content) - Add parameter
idtoMarker,PolygonandPolylineconstructors - Add method
Map::removeMarker(string|Marker $markerOrId) - Add method
Map::removePolygon(string|Polygon $polygonOrId) - Add method
Map::removePolyline(string|Polyline $polylineOrId)
2.23
- Add
DistanceUnitto represent distance units (m,km,miles,nmi) and ease conversion between units. - Add
DistanceCalculatorInterfaceinterface and three implementations:HaversineDistanceCalculator,SphericalCosineDistanceCalculatorandVincentyDistanceCalculator. - Add
CoordinateUtilshelper, to convert decimal coordinates (43.2109) in DMS (56° 78' 90")
2.22
- Add method
Symfony\UX\Map\Renderer\AbstractRenderer::tapOptions(), to allow Renderer to modify options before rendering a Map. - Add
ux_map.google_maps.default_map_idconfiguration to set the GoogleMap ID - Add
ComponentWithMapTraitto ease maps integration in Live Components - Add
Polylinesupport
2.20
- Deprecate
render_mapTwig function (will be removed in 2.21). Useux_mapor the<twig:ux:map />Twig component instead. - Add
ux_mapTwig function (replacesrender_mapwith a more flexible interface) - Add
<twig:ux:map />Twig component - The importmap entry
@symfony/ux-map/abstract-map-controllercan be removed from your importmap, it is no longer needed. - Add
Polygonsupport
2.19
- Component added