Pleasant zoom.

This commit is contained in:
Tim Schaub
2012-06-23 02:50:00 +02:00
parent 0554bceb29
commit 76d90428bd
3 changed files with 11 additions and 14 deletions

View File

@@ -102,6 +102,8 @@ ol.Tile.prototype.getImg = function() {
ol.Tile.prototype.handleImageLoad = function(evt) {
this.loading_ = false;
this.loaded_ = true;
this.img_.style.visibility = "inherit";
this.img_.style.opacity = 1; // TODO: allow for layer opacity
this.events_.triggerEvent('load');
};
@@ -137,19 +139,6 @@ ol.Tile.prototype.destroy = function() {
this.events_.triggerEvent('destroy');
};
/**
* Create an image node. This is done by cloning
* the same image element.
* @return {HTMLImageElement}
*/
ol.Tile.createImage = (function() {
var img = document.createElement("img");
img.className = "olTile";
return function() {
return img.cloneNode(false);
};
})();
/**
* Create a tile constructor, for specific width and height values
* for the tiles.
@@ -173,6 +162,8 @@ ol.Tile.createConstructor = function(width, height) {
img.style.position = "absolute";
img.style.width = width + "px";
img.style.height = height + "px";
img.style.opacity = 0;
img.src = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";
return function() {
return img.cloneNode(false);
};