Merge remote-tracking branch 'upstream/pull/5694'
This commit is contained in:
commit
51a2d85053
2 changed files with 14 additions and 0 deletions
|
@ -36,6 +36,8 @@ OSM.Directions = function (map) {
|
||||||
OSM.DirectionsEndpoint(map, $("input[name='route_to']"), OSM.MARKER_RED, endpointDragCallback, endpointChangeCallback)
|
OSM.DirectionsEndpoint(map, $("input[name='route_to']"), OSM.MARKER_RED, endpointDragCallback, endpointChangeCallback)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
let downloadURL = null;
|
||||||
|
|
||||||
const expiry = new Date();
|
const expiry = new Date();
|
||||||
expiry.setYear(expiry.getFullYear() + 10);
|
expiry.setYear(expiry.getFullYear() + 10);
|
||||||
|
|
||||||
|
@ -189,6 +191,16 @@ OSM.Directions = function (map) {
|
||||||
turnByTurnTable.append(row);
|
turnByTurnTable.append(row);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const blob = new Blob([JSON.stringify(polyline.toGeoJSON())], { type: "application/json" });
|
||||||
|
URL.revokeObjectURL(downloadURL);
|
||||||
|
downloadURL = URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
$("#sidebar_content").append(`<p class="text-center"><a href="${downloadURL}" download="${
|
||||||
|
I18n.t("javascripts.directions.filename")
|
||||||
|
}">${
|
||||||
|
I18n.t("javascripts.directions.download")
|
||||||
|
}</a></p>`);
|
||||||
|
|
||||||
$("#sidebar_content").append("<p class=\"text-center\">" +
|
$("#sidebar_content").append("<p class=\"text-center\">" +
|
||||||
I18n.t("javascripts.directions.instructions.courtesy", { link: chosenEngine.creditline }) +
|
I18n.t("javascripts.directions.instructions.courtesy", { link: chosenEngine.creditline }) +
|
||||||
"</p>");
|
"</p>");
|
||||||
|
|
|
@ -3312,6 +3312,8 @@ en:
|
||||||
ninth: "9th"
|
ninth: "9th"
|
||||||
tenth: "10th"
|
tenth: "10th"
|
||||||
time: "Time"
|
time: "Time"
|
||||||
|
download: "Download route as GeoJSON"
|
||||||
|
filename: "route"
|
||||||
query:
|
query:
|
||||||
node: Node
|
node: Node
|
||||||
way: Way
|
way: Way
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue