- var html = '<h2><a class="geolink" href="#">' +
- '<span class="icon close"></span></a>' + I18n.t('javascripts.directions.directions') +
- '</h2><p id="routing_summary">' +
- I18n.t('javascripts.directions.distance') + ': ' + formatDistance(route.distance) + '. ' +
- I18n.t('javascripts.directions.time') + ': ' + formatTime(route.time) + '.';
- if (typeof route.ascend !== 'undefined' && typeof route.descend !== 'undefined') {
- html += '<br />' +
- I18n.t('javascripts.directions.ascend') + ': ' + Math.round(route.ascend) + 'm. ' +
- I18n.t('javascripts.directions.descend') + ': ' + Math.round(route.descend) +'m.';
+ var distanceText = $("<p>").append(
+ I18n.t("javascripts.directions.distance") + ": " + formatDistance(route.distance) + ". " +
+ I18n.t("javascripts.directions.time") + ": " + formatTime(route.time) + ".");
+ if (typeof route.ascend !== "undefined" && typeof route.descend !== "undefined") {
+ distanceText.append(
+ $("<br>"),
+ I18n.t("javascripts.directions.ascend") + ": " + Math.round(route.ascend) + "m. " +
+ I18n.t("javascripts.directions.descend") + ": " + Math.round(route.descend) + "m.");