From 032ad34a841853e52d0836059bee214ec27d939f Mon Sep 17 00:00:00 2001 From: Clement Date: Fri, 31 May 2024 10:30:51 +0200 Subject: [PATCH] add leaflet routing --- front/src/pages/maps.astro | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/front/src/pages/maps.astro b/front/src/pages/maps.astro index 3e552b3..f812184 100644 --- a/front/src/pages/maps.astro +++ b/front/src/pages/maps.astro @@ -32,7 +32,7 @@ const metadata = { import markerIcon from "leaflet/dist/images/marker-icon.png" import { OpenStreetMapProvider } from 'leaflet-geosearch' import { GeoSearchControl } from 'leaflet-geosearch' - + import 'leaflet-routing-machine/dist/leaflet-routing-machine.js' const icon = {icon: new L.Icon({iconUrl: markerIcon.src, shadowUrl: markerShadow.src, iconAnchor: [13,41]})} @@ -62,13 +62,14 @@ const metadata = { style: 'bar', }), ) - // L.Routing.control({ - // waypoints: [ - // L.latLng(57.74, 11.94), - // L.latLng(57.6792, 11.949) - // ], - // routeWhileDragging: true - // }).addTo(map) + + L.Routing.control({ + waypoints: [ + L.latLng(57.74, 11.94), + L.latLng(57.6792, 11.949) + ], + routeWhileDragging: true + }).addTo(map) let poiMarkers = new Array