X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/90f119d97612397564d8e93776a703c687d362d8..85d17f257c338f668a1d17d9fc62a2f48ec84230:/app/assets/javascripts/openlayers.js.erb?ds=inline diff --git a/app/assets/javascripts/openlayers.js.erb b/app/assets/javascripts/openlayers.js.erb index f4964b8fb..c428da014 100644 --- a/app/assets/javascripts/openlayers.js.erb +++ b/app/assets/javascripts/openlayers.js.erb @@ -2,69 +2,36 @@ //= 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' %>" + "404.png": "<%= asset_path 'img/404.png' %>", + "blank.gif": "<%= asset_path 'img/blank.gif' %>", + "cloud-popup-relative.png": "<%= asset_path 'img/cloud-popup-relative.png' %>", + "drag-rectangle-off.png": "<%= asset_path 'img/drag-rectangle-off.png' %>", + "drag-rectangle-on.png": "<%= asset_path 'img/drag-rectangle-on.png' %>", + "east-mini.png": "<%= asset_path 'img/east-mini.png' %>", + "layer-switcher-maximize.png": "<%= asset_path 'img/layer-switcher-maximize.png' %>", + "layer-switcher-minimize.png": "<%= asset_path 'img/layer-switcher-minimize.png' %>", + "marker-blue.png": "<%= asset_path 'img/marker-blue.png' %>", + "marker-gold.png": "<%= asset_path 'img/marker-gold.png' %>", + "marker-green.png": "<%= asset_path 'img/marker-green.png' %>", + "marker.png": "<%= asset_path 'img/marker.png' %>", + "measuring-stick-off.png": "<%= asset_path 'img/measuring-stick-off.png' %>", + "measuring-stick-on.png": "<%= asset_path 'img/measuring-stick-on.png' %>", + "north-mini.png": "<%= asset_path 'img/north-mini.png' %>", + "panning-hand-off.png": "<%= asset_path 'img/panning-hand-off.png' %>", + "panning-hand-on.png": "<%= asset_path 'img/panning-hand-on.png' %>", + "slider.png": "<%= asset_path 'img/slider.png' %>", + "south-mini.png": "<%= asset_path 'img/south-mini.png' %>", + "west-mini.png": "<%= asset_path 'img/west-mini.png' %>", + "zoombar.png": "<%= asset_path 'img/zoombar.png' %>", + "zoom-minus-mini.png": "<%= asset_path 'img/zoom-minus-mini.png' %>", + "zoom-plus-mini.png": "<%= asset_path 'img/zoom-plus-mini.png' %>", + "zoom-world-mini.png": "<%= asset_path 'img/zoom-world-mini.png' %>" }; -OpenLayers.Util.origCreateDiv = OpenLayers.Util.createDiv; +OpenLayers.Util.OSM.MISSING_TILE_URL = "<%= asset_path 'img/404.png' %>"; -OpenLayers.Util.createDiv = function(id, px, sz, imgURL, position, - border, overflow, opacity) { - imgURL = OpenLayers.Util.imageURLs[imgURL] || imgURL; +OpenLayers.Util.origGetImageLocation = OpenLayers.Util.getImageLocation; - 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, - opacity, delayDisplay) { - imgURL = OpenLayers.Util.imageURLs[imgURL] || imgURL; - - 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); -}; - -OpenLayers.Tile.Image.clear = function() { - if (this.imgDiv) { - this.hide(); - if (OpenLayers.Tile.Image.useBlankTile) { - this.imgDiv.src = "<%= asset_path 'img/blank.gif' %>"; - } - } +OpenLayers.Util.getImageLocation = function(image) { + return OpenLayers.Util.imageURLs[image] || OpenLayers.Util.origGetImageLocation(image); };