Merge pull request #1019 from ahocevar/chrome-optimized

Deal with recent Chrome optimizations to avoid failing TileManager and tests
This commit is contained in:
ahocevar
2013-07-09 01:51:04 -07:00
committed by Bart van den Eijnden
parent d020e8f666
commit 49dd5a4fd8
5 changed files with 49 additions and 52 deletions
+7 -1
View File
@@ -314,11 +314,17 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
* Creates the content for the frame on the tile.
*/
initImage: function() {
if (!this.url && !this.imgDiv) {
// fast path out - if there is no tile url and no previous image
this.isLoading = false;
return;
}
this.events.triggerEvent('beforeload');
this.layer.div.appendChild(this.getTile());
this.events.triggerEvent(this._loadEvent);
var img = this.getImage();
if (this.url && OpenLayers.Util.isEquivalentUrl(img.src, this.url)) {
var src = img.getAttribute('src') || '';
if (this.url && OpenLayers.Util.isEquivalentUrl(src, this.url)) {
this._loadTimeout = window.setTimeout(
OpenLayers.Function.bind(this.onImageLoad, this), 0
);