Im wondering why this function is returning this error:
Uncaught ReferenceError: capasPlay is not defined at funPlay.handleFunPlay
funPlay.prototype.handleFunPlay = function handleFunPlay() {
capasPlay = [capa4_48R, capa4_49R, capa4_50R, capa4_51R, capa4_52R, capa4_53R, capa4_54R, capa4_55R, capa4_56R];
var index;
for (index=0; index <= capasPlay.leght; index++){
window.setTimeout(function(){capasPlay[index].setVisible(false)}, 1000);
}
};
return funPlay;
The array is made from variables like this:
var capa4_48R = new TileLayer({
source: new TileWMS({
url: 'http://localhost:8080/geoserver/wms',
params: { 'LAYERS': 'earth:4_48R', 'TILED': true },
serverType: 'geoserver',
})
});
Thanks a lot!