Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin crash if map contains an unused layer. #4

Open
Thomas-lhuillier opened this issue Sep 1, 2019 · 1 comment
Open

Plugin crash if map contains an unused layer. #4

Thomas-lhuillier opened this issue Sep 1, 2019 · 1 comment

Comments

@Thomas-lhuillier
Copy link

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
Copy link

I use this code (before animatedTiles.init(map)) to avoid this issue

map.layers.forEach((layer) => {
                if (layer.tilemapLayer === null) {
                    layer.tilemapLayer = {type: 'StaticTilemapLayer'}
                }
            })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants