Skip to content

Commit 888225f

Browse files
authored
fix(route-draw): remove pThrottle polyfill, use valhalla instead of OSRM
1 parent 0076278 commit 888225f

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/js/route-draw/route-draw.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,7 @@ import { Toast } from "@capacitor/toast";
2020
import turfLength from "@turf/length";
2121
import lineSlice from "@turf/line-slice";
2222
import cleanCoords from "@turf/clean-coords";
23-
// REMOVEME
24-
// pthrottle polyfill
25-
let pThrottle = (fn) => fn;
26-
if (typeof FinalizationRegistry !== "undefined") {
27-
pThrottle = require("p-throttle").default;
28-
} else {
29-
console.warn("FinalizationRegistry not supported, throttling disabled");
30-
}
23+
import pThrottle from "p-throttle";
3124

3225
import RouteDepartureIcon from "../../css/assets/route-draw/departure-marker.png";
3326
import RouteDestinationIcon from "../../css/assets/route-draw/destination-marker.png";
@@ -57,7 +50,7 @@ class RouteDraw {
5750
this.configuration = this.options.configuration || {
5851
linesource: "route-draw-line",
5952
pointsource: "route-draw-point",
60-
api: "https://data.geopf.fr/navigation/itineraire?resource=bdtopo-osrm&getSteps=false&timeUnit=second&optimization=shortest&",
53+
api: "https://data.geopf.fr/navigation/itineraire?resource=bdtopo-valhalla&getSteps=false&timeUnit=second&optimization=shortest&",
6154
template: (values) => {
6255
let intermediates = "";
6356
if (values.intermediates) {

0 commit comments

Comments
 (0)