add opacity support to createDiv() and createImage(). update their tests. also small update to modify tests for more completeness. updated one single complete usage of createImage() due to argument reordering
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1549 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -104,6 +104,7 @@ OpenLayers.Tile.Image.prototype =
|
||||
null,
|
||||
"absolute",
|
||||
null,
|
||||
null,
|
||||
true);
|
||||
}
|
||||
this.layer.div.appendChild(this.imgDiv);
|
||||
|
||||
@@ -55,12 +55,13 @@ OpenLayers.Util.modifyDOMElement = function(element, id, px, sz, position,
|
||||
* @param {String} position
|
||||
* @param {String} border
|
||||
* @param {String} overflow
|
||||
* @param {float} opacity Fractional value (0.0 - 1.0)
|
||||
*
|
||||
* @returns A DOM Div created with the specified attributes.
|
||||
* @type DOMElement
|
||||
*/
|
||||
OpenLayers.Util.createDiv = function(id, px, sz, imgURL, position,
|
||||
border, overflow) {
|
||||
border, overflow, opacity) {
|
||||
|
||||
var dom = document.createElement('div');
|
||||
|
||||
@@ -78,8 +79,8 @@ OpenLayers.Util.createDiv = function(id, px, sz, imgURL, position,
|
||||
if (!position) {
|
||||
position = "absolute";
|
||||
}
|
||||
OpenLayers.Util.modifyDOMElement(dom, id, px, sz,
|
||||
position, border, overflow);
|
||||
OpenLayers.Util.modifyDOMElement(dom, id, px, sz, position,
|
||||
border, overflow, opacity);
|
||||
|
||||
return dom;
|
||||
};
|
||||
@@ -92,12 +93,13 @@ OpenLayers.Util.createDiv = function(id, px, sz, imgURL, position,
|
||||
* @param {String} position
|
||||
* @param {String} border
|
||||
* @param {Boolean} delayDisplay
|
||||
* @param {float} opacity Fractional value (0.0 - 1.0)
|
||||
*
|
||||
* @returns A DOM Image created with the specified attributes.
|
||||
* @type DOMElement
|
||||
*/
|
||||
OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border,
|
||||
delayDisplay) {
|
||||
OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border,
|
||||
opacity, delayDisplay) {
|
||||
|
||||
image = document.createElement("img");
|
||||
|
||||
@@ -124,7 +126,8 @@ OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border,
|
||||
if (!position) {
|
||||
position = "relative";
|
||||
}
|
||||
OpenLayers.Util.modifyDOMElement(image, id, px, sz, position, border);
|
||||
OpenLayers.Util.modifyDOMElement(image, id, px, sz, position,
|
||||
border, null, opacity);
|
||||
|
||||
|
||||
return image;
|
||||
|
||||
Reference in New Issue
Block a user