$(document).ready(function () {
var loaderTimeout;
+ var map = new L.OSM.Map("map", {
+ zoomControl: false,
+ layerControl: false,
+ contextmenu: true
+ });
+
OSM.loadSidebarContent = function(path, callback) {
map.setSidebarOverlaid(false);
var params = OSM.mapParams();
- var map = new L.OSM.Map("map", {
- zoomControl: false,
- layerControl: false,
- contextmenu: true
- });
-
map.attributionControl.setPrefix('');
map.updateLayers(params.layers);
var expiry = new Date();
expiry.setYear(expiry.getFullYear() + 10);
+ var engines = OSM.Directions.engines;
+
+ engines.sort(function (a, b) {
+ a = I18n.t('javascripts.directions.engines.' + a.id);
+ b = I18n.t('javascripts.directions.engines.' + b.id);
+ return a.localeCompare(b);
+ });
+
+ var select = $('select.routing_engines');
+
+ engines.forEach(function(engine, i) {
+ select.append("<option value='" + i + "'>" + I18n.t('javascripts.directions.engines.' + engine.id) + "</option>");
+ });
+
function Endpoint(input, iconUrl) {
var endpoint = {};
input.on("change", function (e) {
awaitingGeocode = true;
-
+
// make text the same in both text boxes
var value = e.target.value;
endpoint.setValue(value);
.html(html);
// Add each row
- var cumulative = 0;
route.steps.forEach(function (step) {
var ll = step[0],
direction = step[1],
dist = step[3],
lineseg = step[4];
- cumulative += dist;
-
if (dist < 5) {
dist = "";
} else if (dist < 200) {
});
}
- var engines = OSM.Directions.engines;
-
- engines.sort(function (a, b) {
- a = I18n.t('javascripts.directions.engines.' + a.id);
- b = I18n.t('javascripts.directions.engines.' + b.id);
- return a.localeCompare(b);
- });
-
- var select = $('select.routing_engines');
-
- engines.forEach(function(engine, i) {
- select.append("<option value='" + i + "'>" + I18n.t('javascripts.directions.engines.' + engine.id) + "</option>");
- });
-
var chosenEngineIndex = findEngine('fossgis_osrm_car');
if ($.cookie('_osm_directions_engine')) {
chosenEngineIndex = findEngine($.cookie('_osm_directions_engine'));
cache: true,
success: function () {
piwikTracker = Piwik.getTracker(base + "piwik.php", OSM.PIWIK.site);
-
+
if (OSM.user) {
piwikTracker.setUserId(OSM.user.toString());
}
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
-
+
$("meta[name=piwik-goal]").each(function () {
piwikTracker.trackGoal($(this).attr("content"));
});
/* Hide the preview panes */
$(".richtext_preview").hide();
- /*
+ /*
* When the text in an edit pane is changed, clear the contents of
* the associated preview pne so that it will be regenerated when
* the user next switches to it.
*/
- $(".richtext_content textarea").change(function () {
+ $(".richtext_content textarea").change(function () {
$(this).parents(".richtext_container").find(".richtext_preview").empty();
});