[OpenLayers-Users] layer loadend event
protos
kildimo at gmail.com
Wed Feb 10 05:49:12 EST 2010
In case anyone is interested - this is what I did to get around the loadend
bug :
checkBaseLayerReady: function(map) {
if (!map.baseLayer) {
return false;
}
else {
var ldiv = map.baseLayer.div;
var flag = true;
for (var k = 0, len = ldiv.childNodes.length; k < len; k++) {
var node = ldiv.childNodes[k];
if (!node.complete) {
flag = false;
}
}
return flag;
}
},
checkAndClearCloneLayer:function(map){
console.debug ("Checking and clearing Cloned Layer.");
if(!map){
map = this.map;
}
if (map){
// OL loadend event gets fired too early so we need
// this to check if indeed the new baseLayer is fully loaded.
var retrier = new PeriodicalExecuter(function(pe) {
if (this.checkBaseLayerReady(map)) {
if (map.baseLayerClone){
map.layerContainerDiv.removeChild(map.baseLayerClone.div);
if (Prototype.Browser.IE) {
map.baseLayerClone.outerHTML = "";
}
map.baseLayerClone.grid = null;
map.baseLayerClone = null;
pe.stop();
}
}
}.bind(this), 0.1);
}
},
--
View this message in context: http://n2.nabble.com/layer-loadend-event-tp4533615p4547100.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list