-
Notifications
You must be signed in to change notification settings - Fork 3
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
types of property orientation are incompatible #4
Comments
Hi, export type TiledLayer<O extends TiledMapType> = TiledLayerTilelayer | TiledLayerObjectgroup<O> | TiledLayerImagelayer | TiledLayerGroup; So in your case you have to check if current layer is a tilelayer, then you can manipulate its map.layers.forEach(layer => {
if(layer.type === 'tilelayer') {
pako.inflate(layer.data);
}
}); This said, I see that your data is Ok I checked Tiled doc, seems that there is changes in props (or I just forgot them 🙈 ).
I hope finding some time to make changes & also check others forgotten props. If you can make a PR for that it would be great 😄 |
I just released a new version with all fixed, consider upgrading to For tilelayer typing consider doing one of these solutions: // you have only tilelayers, no need to check them
const tilelayers = map.layers as TiledLayerTilelayer[];
tilelayers.layers.forEach(layer => {
pako.inflate(layer.data);
}); // you can have other layer types
map.layers.forEach(layer => {
if(layer.type === 'tilelayer') {
pako.inflate(layer.data);
}
}); |
That was fast! Thank you very much @Chnapy ! |
Getting this error when trying to type my Tiled map:
My tiled json looks like this:
Also,
compressionlevel
seems to be missing from the types definition.Using typescript 4.1 and tiled-types 1.1.0
The text was updated successfully, but these errors were encountered: