Plugin crash if map contains an unused layer.
Thomas-lhuillier opened this issue · 1 comments
Thomas-lhuillier commented
When using the plugin with a map containing an unused layer (eg. only used on server side), the plugins throws an error.
Uncaught TypeError: Cannot read property 'type' of null
.
PavelMishin commented
I use this code (before animatedTiles.init(map)
) to avoid this issue
map.layers.forEach((layer) => {
if (layer.tilemapLayer === null) {
layer.tilemapLayer = {type: 'StaticTilemapLayer'}
}
})