Compare commits
3 Commits
release-2.
...
v2.13.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f4a4090814 | ||
|
|
49dd5a4fd8 | ||
|
|
d020e8f666 |
@@ -426,4 +426,4 @@
|
|||||||
* When asking questions or reporting issues, make sure to include the output of
|
* When asking questions or reporting issues, make sure to include the output of
|
||||||
* OpenLayers.VERSION_NUMBER in the question or issue-description.
|
* OpenLayers.VERSION_NUMBER in the question or issue-description.
|
||||||
*/
|
*/
|
||||||
OpenLayers.VERSION_NUMBER="Release 2.13";
|
OpenLayers.VERSION_NUMBER="Release 2.13.1";
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ var OpenLayers = {
|
|||||||
/**
|
/**
|
||||||
* Constant: VERSION_NUMBER
|
* Constant: VERSION_NUMBER
|
||||||
*/
|
*/
|
||||||
VERSION_NUMBER: "Release 2.13",
|
VERSION_NUMBER: "Release 2.13.1",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constant: singleFile
|
* Constant: singleFile
|
||||||
|
|||||||
@@ -314,11 +314,17 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
|
|||||||
* Creates the content for the frame on the tile.
|
* Creates the content for the frame on the tile.
|
||||||
*/
|
*/
|
||||||
initImage: function() {
|
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.events.triggerEvent('beforeload');
|
||||||
this.layer.div.appendChild(this.getTile());
|
this.layer.div.appendChild(this.getTile());
|
||||||
this.events.triggerEvent(this._loadEvent);
|
this.events.triggerEvent(this._loadEvent);
|
||||||
var img = this.getImage();
|
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(
|
this._loadTimeout = window.setTimeout(
|
||||||
OpenLayers.Function.bind(this.onImageLoad, this), 0
|
OpenLayers.Function.bind(this.onImageLoad, this), 0
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
* @requires OpenLayers/Util.js
|
* @requires OpenLayers/Util.js
|
||||||
* @requires OpenLayers/BaseTypes.js
|
* @requires OpenLayers/BaseTypes.js
|
||||||
* @requires OpenLayers/BaseTypes/Element.js
|
* @requires OpenLayers/BaseTypes/Element.js
|
||||||
|
* @requires OpenLayers/Layer/Grid.js
|
||||||
|
* @requires OpenLayers/Tile/Image.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -221,7 +223,7 @@ OpenLayers.TileManager = OpenLayers.Class({
|
|||||||
for (j=layer.grid[i].length-1; j>=0; --j) {
|
for (j=layer.grid[i].length-1; j>=0; --j) {
|
||||||
tile = layer.grid[i][j];
|
tile = layer.grid[i][j];
|
||||||
this.addTile({tile: tile});
|
this.addTile({tile: tile});
|
||||||
if (tile.url) {
|
if (tile.url && !tile.imgDiv) {
|
||||||
this.manageTileCache({object: tile});
|
this.manageTileCache({object: tile});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -253,9 +255,6 @@ OpenLayers.TileManager = OpenLayers.Class({
|
|||||||
for (j=layer.grid[i].length-1; j>=0; --j) {
|
for (j=layer.grid[i].length-1; j>=0; --j) {
|
||||||
tile = layer.grid[i][j];
|
tile = layer.grid[i][j];
|
||||||
this.unloadTile({object: tile});
|
this.unloadTile({object: tile});
|
||||||
if (tile.url) {
|
|
||||||
this.manageTileCache({object: tile});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -300,6 +299,7 @@ OpenLayers.TileManager = OpenLayers.Class({
|
|||||||
* evt - {Object} The listener argument
|
* evt - {Object} The listener argument
|
||||||
*/
|
*/
|
||||||
addTile: function(evt) {
|
addTile: function(evt) {
|
||||||
|
if (evt.tile instanceof OpenLayers.Tile.Image) {
|
||||||
evt.tile.events.on({
|
evt.tile.events.on({
|
||||||
beforedraw: this.queueTileDraw,
|
beforedraw: this.queueTileDraw,
|
||||||
beforeload: this.manageTileCache,
|
beforeload: this.manageTileCache,
|
||||||
@@ -307,6 +307,10 @@ OpenLayers.TileManager = OpenLayers.Class({
|
|||||||
unload: this.unloadTile,
|
unload: this.unloadTile,
|
||||||
scope: this
|
scope: this
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
// Layer has the wrong tile type, so don't handle it any longer
|
||||||
|
this.removeLayer({layer: evt.tile.layer});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -383,26 +387,24 @@ OpenLayers.TileManager = OpenLayers.Class({
|
|||||||
manageTileCache: function(evt) {
|
manageTileCache: function(evt) {
|
||||||
var tile = evt.object;
|
var tile = evt.object;
|
||||||
var img = this.tileCache[tile.url];
|
var img = this.tileCache[tile.url];
|
||||||
// only use image from cache if it is not on a layer already
|
if (img) {
|
||||||
if (img && (!img.parentNode ||
|
// if image is on its layer's backbuffer, remove it from backbuffer
|
||||||
OpenLayers.Element.hasClass(img.parentNode, 'olBackBuffer'))) {
|
if (img.parentNode &&
|
||||||
if (tile.layer.backBuffer) {
|
OpenLayers.Element.hasClass(img.parentNode, 'olBackBuffer')) {
|
||||||
if (tile.layer.backBuffer === img.parentNode) {
|
img.parentNode.removeChild(img);
|
||||||
// cached image is on the target layer's backbuffer already,
|
|
||||||
// so nothing to do here
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
img.style.opacity = 0;
|
|
||||||
img.style.visibility = 'hidden';
|
|
||||||
}
|
|
||||||
// Only backbuffer tiles have an id, so we don't want one here
|
|
||||||
img.id = null;
|
img.id = null;
|
||||||
|
}
|
||||||
|
// only use image from cache if it is not on a layer already
|
||||||
|
if (!img.parentNode) {
|
||||||
|
img.style.visibility = 'hidden';
|
||||||
|
img.style.opacity = 0;
|
||||||
tile.setImage(img);
|
tile.setImage(img);
|
||||||
// LRU - move tile to the end of the array to mark it as the most
|
// LRU - move tile to the end of the array to mark it as the most
|
||||||
// recently used
|
// recently used
|
||||||
OpenLayers.Util.removeItem(this.tileCacheIndex, tile.url);
|
OpenLayers.Util.removeItem(this.tileCacheIndex, tile.url);
|
||||||
this.tileCacheIndex.push(tile.url);
|
this.tileCacheIndex.push(tile.url);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1135,7 +1135,7 @@
|
|||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
map.zoomToMaxExtent();
|
map.zoomToMaxExtent();
|
||||||
|
|
||||||
t.delay_call(1, function() {
|
layer.grid[1][1].onImageLoad();
|
||||||
layer.mergeNewParams({foo: 'bar'});
|
layer.mergeNewParams({foo: 'bar'});
|
||||||
var tile = layer.grid[1][1];
|
var tile = layer.grid[1][1];
|
||||||
t.ok(OpenLayers.Element.hasClass(tile.imgDiv, 'olTileReplacing'), 'tile is marked for being replaced');
|
t.ok(OpenLayers.Element.hasClass(tile.imgDiv, 'olTileReplacing'), 'tile is marked for being replaced');
|
||||||
@@ -1155,7 +1155,6 @@
|
|||||||
tile.onImageLoad();
|
tile.onImageLoad();
|
||||||
t.ok(!OpenLayers.Element.hasClass(tile.imgDiv, 'olTileReplacing'), 'tile replaced, no longer marked');
|
t.ok(!OpenLayers.Element.hasClass(tile.imgDiv, 'olTileReplacing'), 'tile replaced, no longer marked');
|
||||||
t.ok(document.getElementById(tile.id + '_bb'), 'backbuffer not removed for visible tile');
|
t.ok(document.getElementById(tile.id + '_bb'), 'backbuffer not removed for visible tile');
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_backbuffer_replace_singleTile(t) {
|
function test_backbuffer_replace_singleTile(t) {
|
||||||
|
|||||||
@@ -382,12 +382,9 @@
|
|||||||
|
|
||||||
t.delay_call(5, function() {
|
t.delay_call(5, function() {
|
||||||
var tile = layer.grid[0][0];
|
var tile = layer.grid[0][0];
|
||||||
if (tile.isLoading) {
|
tile.onImageLoad();
|
||||||
t.ok(false, "test_getCanvasContext timeout");
|
|
||||||
} else {
|
|
||||||
t.ok(tile.getCanvasContext() instanceof CanvasRenderingContext2D,
|
t.ok(tile.getCanvasContext() instanceof CanvasRenderingContext2D,
|
||||||
"getCanvasContext() returns CanvasRenderingContext2D instance");
|
"getCanvasContext() returns CanvasRenderingContext2D instance");
|
||||||
}
|
|
||||||
map.destroy();
|
map.destroy();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -231,7 +231,7 @@
|
|||||||
<li>Tile/Image.html</li>
|
<li>Tile/Image.html</li>
|
||||||
<li>Tile/Image/IFrame.html</li>
|
<li>Tile/Image/IFrame.html</li>
|
||||||
<li>Tile/UTFGrid.html</li>
|
<li>Tile/UTFGrid.html</li>
|
||||||
<li>TileManager.html?visible</li>
|
<li>TileManager.html</li>
|
||||||
<li>Tween.html</li>
|
<li>Tween.html</li>
|
||||||
<li>Kinetic.html</li>
|
<li>Kinetic.html</li>
|
||||||
<li>Util.html?visible</li>
|
<li>Util.html?visible</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user