X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/2d6fb571dc55b2e2970697f19d414add390bcc41..e20bb507f122f73d18021bf93efe85fc2e189dfb:/app/assets/javascripts/osm.js.erb diff --git a/app/assets/javascripts/osm.js.erb b/app/assets/javascripts/osm.js.erb index 58a44d630..6a8b856be 100644 --- a/app/assets/javascripts/osm.js.erb +++ b/app/assets/javascripts/osm.js.erb @@ -1,3 +1,5 @@ +//= depend_on application.yml + OSM = { <% if defined?(PIWIK) %> PIWIK: <%= PIWIK.to_json %>, @@ -14,6 +16,9 @@ OSM = { <% if defined?(MAPQUEST_KEY) %> MAPQUEST_KEY: <%= MAPQUEST_KEY.to_json %>, <% end %> +<% if defined?(MAPZEN_VALHALLA_KEY) %> + MAPZEN_VALHALLA_KEY: <%= MAPZEN_VALHALLA_KEY.to_json %>, +<% end %> MARKER_GREEN: <%= image_path("marker-green.png").to_json %>, MARKER_RED: <%= image_path("marker-red.png").to_json %>, @@ -48,7 +53,12 @@ OSM = { j = pair.indexOf('='), key = pair.slice(0, j), val = pair.slice(++j); - params[key] = decodeURIComponent(val); + + try { + params[key] = decodeURIComponent(val); + } catch (e) { + // Ignore parse exceptions + } } return params;