const routeOutput = {};
- routeOutput.write = function (content, engine, route) {
+ routeOutput.write = function (content, route) {
polyline
.setLatLngs(route.line)
.addTo(map);
}</a></p>`);
content.append("<p class=\"text-center\">" +
- OSM.i18n.t("javascripts.directions.instructions.courtesy", { link: engine.creditline }) +
+ OSM.i18n.t("javascripts.directions.instructions.courtesy", {
+ link: `<a href="${route.creditlink}" target="_blank">${route.credit}</a>`
+ }) +
"</p>");
};
map.setSidebarOverlaid(false);
controller = new AbortController();
chosenEngine.getRoute(points, controller.signal).then(function (route) {
- routeOutput.write($("#directions_content"), chosenEngine, route);
+ routeOutput.write($("#directions_content"), route);
if (fitRoute) {
routeOutput.fit();
}
line: steps.flatMap(step => step[3]),
steps,
distance: leg.distance,
- time: leg.duration
+ time: leg.duration,
+ credit: "OSRM (FOSSGIS)",
+ creditlink: "https://routing.openstreetmap.de/about.html"
};
}
return {
mode: modeId,
provider: "fossgis_osrm",
- creditline: "<a href=\"https://routing.openstreetmap.de/about.html\" target=\"_blank\">OSRM (FOSSGIS)</a>",
draggable: true,
getRoute: function (points, signal) {
line,
steps,
distance: leg.summary.length * 1000,
- time: leg.summary.time
+ time: leg.summary.time,
+ credit: "Valhalla (FOSSGIS)",
+ creditlink: "https://gis-ops.com/global-open-valhalla-server-online/"
};
}
return {
mode: modeId,
provider: "fossgis_valhalla",
- creditline:
- "<a href='https://gis-ops.com/global-open-valhalla-server-online/' target='_blank'>Valhalla (FOSSGIS)</a>",
draggable: false,
getRoute: function (points, signal) {
distance: path.distance,
time: path.time / 1000,
ascend: path.ascend,
- descend: path.descend
+ descend: path.descend,
+ credit: "GraphHopper",
+ creditlink: "https://www.graphhopper.com/"
};
}
return {
mode: modeId,
provider: "graphhopper",
- creditline: "<a href=\"https://www.graphhopper.com/\" target=\"_blank\">GraphHopper</a>",
draggable: false,
getRoute: function (points, signal) {