]> git.openstreetmap.org Git - rails.git/commitdiff
Handle openlayers.js as a template
authorTom Hughes <tom@compton.nu>
Fri, 25 Nov 2011 23:05:44 +0000 (23:05 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 25 Nov 2011 23:14:16 +0000 (23:14 +0000)
app/assets/javascripts/openlayers.js [deleted file]
app/assets/javascripts/openlayers.js.erb [new file with mode: 0644]

diff --git a/app/assets/javascripts/openlayers.js b/app/assets/javascripts/openlayers.js
deleted file mode 100644 (file)
index 7314035..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//= require OpenLayers
-//= require OpenStreetMap
-
-OpenLayers.Util.imageURLs = {
-    "img/404.png": "<%= asset_path '404.png' %>",
-    "img/blank.gif": "<%= asset_path 'blank.gif' %>",
-    "img/cloud-popup-relative.png": "<%= asset_path 'cloud-popup-relative.png' %>",
-    "img/drag-rectangle-off.png": "<%= asset_path 'drag-rectangle-off.png' %>",
-    "img/drag-rectangle-on.png": "<%= asset_path 'drag-rectangle-on.png' %>",
-    "img/east-mini.png": "<%= asset_path 'east-mini.png' %>",
-    "img/layer-switcher-maximize.png": "<%= asset_path 'layer-switcher-maximize.png' %>",
-    "img/layer-switcher-minimize.png": "<%= asset_path 'layer-switcher-minimize.png' %>",
-    "img/marker-blue.png": "<%= asset_path 'marker-blue.png' %>",
-    "img/marker-gold.png": "<%= asset_path 'marker-gold.png' %>",
-    "img/marker-green.png": "<%= asset_path 'marker-green.png' %>",
-    "img/marker.png": "<%= asset_path 'marker.png' %>",
-    "img/measuring-stick-off.png": "<%= asset_path 'measuring-stick-off.png' %>",
-    "img/measuring-stick-on.png": "<%= asset_path 'measuring-stick-on.png' %>",
-    "img/north-mini.png": "<%= asset_path 'north-mini.png' %>",
-    "img/panning-hand-off.png": "<%= asset_path 'panning-hand-off.png' %>",
-    "img/panning-hand-on.png": "<%= asset_path 'panning-hand-on.png' %>",
-    "img/slider.png": "<%= asset_path 'slider.png' %>",
-    "img/south-mini.png": "<%= asset_path 'south-mini.png' %>",
-    "img/west-mini.png": "<%= asset_path 'west-mini.png' %>",
-    "img/zoombar.png": "<%= asset_path 'zoombar.png' %>",
-    "img/zoom-minus-mini.png": "<%= asset_path 'zoom-minus-mini.png' %>",
-    "img/zoom-plus-mini.png": "<%= asset_path 'zoom-plus-mini.png' %>",
-    "img/zoom-world-mini.png": "<%= asset_path 'zoom-world-mini.png' %>"
-};
-
-OpenLayers.Util.origCreateImage = OpenLayers.Util.createImage;
-
-OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border,
-                                       opacity, delayDisplay) {
-    imgURL = OpenLayers.Util.imageURLs[imgURL] || imgURL;
-
-    return OpenLayers.Util.origCreateImage(id, px, sz, imgURL, position,
-                                           border, opacity, delayDisplay);
-};
diff --git a/app/assets/javascripts/openlayers.js.erb b/app/assets/javascripts/openlayers.js.erb
new file mode 100644 (file)
index 0000000..6a027d5
--- /dev/null
@@ -0,0 +1,39 @@
+//= require OpenLayers
+//= require OpenStreetMap
+
+OpenLayers.Util.imageURLs = {
+    "img/404.png": "<%= asset_path 'img/404.png' %>",
+    "img/blank.gif": "<%= asset_path 'img/blank.gif' %>",
+    "img/cloud-popup-relative.png": "<%= asset_path 'img/cloud-popup-relative.png' %>",
+    "img/drag-rectangle-off.png": "<%= asset_path 'img/drag-rectangle-off.png' %>",
+    "img/drag-rectangle-on.png": "<%= asset_path 'img/drag-rectangle-on.png' %>",
+    "img/east-mini.png": "<%= asset_path 'img/east-mini.png' %>",
+    "img/layer-switcher-maximize.png": "<%= asset_path 'img/layer-switcher-maximize.png' %>",
+    "img/layer-switcher-minimize.png": "<%= asset_path 'img/layer-switcher-minimize.png' %>",
+    "img/marker-blue.png": "<%= asset_path 'img/marker-blue.png' %>",
+    "img/marker-gold.png": "<%= asset_path 'img/marker-gold.png' %>",
+    "img/marker-green.png": "<%= asset_path 'img/marker-green.png' %>",
+    "img/marker.png": "<%= asset_path 'img/marker.png' %>",
+    "img/measuring-stick-off.png": "<%= asset_path 'img/measuring-stick-off.png' %>",
+    "img/measuring-stick-on.png": "<%= asset_path 'img/measuring-stick-on.png' %>",
+    "img/north-mini.png": "<%= asset_path 'img/north-mini.png' %>",
+    "img/panning-hand-off.png": "<%= asset_path 'img/panning-hand-off.png' %>",
+    "img/panning-hand-on.png": "<%= asset_path 'img/panning-hand-on.png' %>",
+    "img/slider.png": "<%= asset_path 'img/slider.png' %>",
+    "img/south-mini.png": "<%= asset_path 'img/south-mini.png' %>",
+    "img/west-mini.png": "<%= asset_path 'img/west-mini.png' %>",
+    "img/zoombar.png": "<%= asset_path 'img/zoombar.png' %>",
+    "img/zoom-minus-mini.png": "<%= asset_path 'img/zoom-minus-mini.png' %>",
+    "img/zoom-plus-mini.png": "<%= asset_path 'img/zoom-plus-mini.png' %>",
+    "img/zoom-world-mini.png": "<%= asset_path 'img/zoom-world-mini.png' %>"
+};
+
+OpenLayers.Util.origCreateImage = OpenLayers.Util.createImage;
+
+OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border,
+                                       opacity, delayDisplay) {
+    imgURL = OpenLayers.Util.imageURLs[imgURL] || imgURL;
+
+    return OpenLayers.Util.origCreateImage(id, px, sz, imgURL, position,
+                                           border, opacity, delayDisplay);
+};