}
var turnByTurnTable = $("<table class='mb-3'>");
+ var directionsCloseButton = $("<button type='button' class='btn-close mt-1'>");
$("#sidebar_content")
.empty()
$("<div class='flex-grow-1 text-break'>").append(
$("<h2>")
.text(I18n.t("javascripts.directions.directions"))),
- $("<div>").append(
- $("<a class='geolink' href='#'>").append(
- $("<button type='button' class='btn-close mt-1'>")))),
+ $("<div>").append(directionsCloseButton)),
distanceText,
turnByTurnTable
);
I18n.t("javascripts.directions.instructions.courtesy", { link: chosenEngine.creditline }) +
"</p>");
- $("#sidebar_content a.geolink").on("click", function (e) {
- e.preventDefault();
+ directionsCloseButton.on("click", function () {
map.removeLayer(polyline);
$("#sidebar_content").html("");
map.setSidebarOverlaid(true);