Add an interception point to allow image URLs to be rewritten
Make all attempts to get a URL for an image go through a single routine, OpenLayers.Util.getImageLocation, which is given the actual image name. This allows users to replace that routine with an enhanced version which can rewrite the full URL, for example to go through the rails asset pipeline when using OpenLayers with rails.
This commit is contained in:
@@ -557,6 +557,16 @@ OpenLayers.Util.getImagesLocation = function() {
|
||||
return OpenLayers.ImgPath || (OpenLayers._getScriptLocation() + "img/");
|
||||
};
|
||||
|
||||
/**
|
||||
* Function: getImageLocation
|
||||
*
|
||||
* Returns:
|
||||
* {String} The fully formatted location string for a specified image
|
||||
*/
|
||||
OpenLayers.Util.getImageLocation = function(image) {
|
||||
return OpenLayers.Util.getImagesLocation() + image;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Function: Try
|
||||
|
||||
Reference in New Issue
Block a user