]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/openlayers.js.erb
Switch from Prototype to jQuery
[rails.git] / app / assets / javascripts / openlayers.js.erb
index 6a027d59be6d1684449b4761fa6fc111b1132577..206e7177f6906cee5ecbec0f9d4d66697e4ca100 100644 (file)
@@ -28,6 +28,16 @@ OpenLayers.Util.imageURLs = {
     "img/zoom-world-mini.png": "<%= asset_path 'img/zoom-world-mini.png' %>"
 };
 
+OpenLayers.Util.origCreateDiv = OpenLayers.Util.createDiv;
+
+OpenLayers.Util.createDiv = function(id, px, sz, imgURL, position, 
+                                     border, overflow, opacity) {
+    imgURL = OpenLayers.Util.imageURLs[imgURL] || imgURL;
+
+    return OpenLayers.Util.origCreateDiv(id, px, sz, imgURL, position, 
+                                         border, overflow, opacity);
+};
+
 OpenLayers.Util.origCreateImage = OpenLayers.Util.createImage;
 
 OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border,
@@ -37,3 +47,15 @@ OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border,
     return OpenLayers.Util.origCreateImage(id, px, sz, imgURL, position,
                                            border, opacity, delayDisplay);
 };
+
+OpenLayers.Util.origModifyAlphaImageDiv = OpenLayers.Util.modifyAlphaImageDiv;
+
+OpenLayers.Util.modifyAlphaImageDiv = function(div, id, px, sz, imgURL, 
+                                               position, border, sizing, 
+                                               opacity) {
+    imgURL = OpenLayers.Util.imageURLs[imgURL] || imgURL;
+
+    return OpenLayers.Util.origModifyAlphaImageDiv(div, id, px, sz, imgURL, 
+                                                   position, border, sizing, 
+                                                   opacity);
+};