]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/osm.js.erb
Localisation updates from https://translatewiki.net.
[rails.git] / app / assets / javascripts / osm.js.erb
index 3e2e7c866e6998403613a361abcda082f7387093..3290b5e2cd22d5f2892ffa0602ca4599725a0bc8 100644 (file)
@@ -3,8 +3,8 @@
 //= require qs/dist/qs
 
 OSM = {
-<% if defined?(PIWIK) %>
-  PIWIK:                   <%= PIWIK.to_json %>,
+<% if defined?(Settings.matomo) %>
+  MATOMO:                  <%= Settings.matomo.to_json %>,
 <% end %>
 
   MAX_REQUEST_AREA:        <%= Settings.max_request_area.to_json %>,
@@ -37,7 +37,8 @@ OSM = {
   SEARCHING:               <%= image_path("searching.gif").to_json %>,
 
   apiUrl: function (object) {
-    var url = "/api/" + OSM.API_VERSION + "/" + object.type + "/" + object.id;
+    var apiType = object.type === "note" ? "notes" : object.type;
+    var url = "/api/" + OSM.API_VERSION + "/" + apiType + "/" + object.id;
 
     if (object.type === "way" || object.type === "relation") {
       url += "/full";
@@ -85,6 +86,8 @@ OSM = {
       mapParams.object = {type: 'way', id: parseInt(params.way)};
     } else if (params.relation) {
       mapParams.object = {type: 'relation', id: parseInt(params.relation)};
+    } else if (params.note) {
+      mapParams.object = {type: 'note', id: parseInt(params.note)};
     }
 
     var hash = OSM.parseHash(location.hash);