While I cannot help you with your direct issue (I never used that library myself), do you plan to do any specific manipulations? Because there are some libraries for loading tmx maps using c# / Unity:
https://github.com/marshallward/TiledSharp looks interesting here… However: I never used any of those libraries myself! So I have no idea how good they are… (and wether they meet your needs)
Fore anyone interested here the solution for the zlib compression, it’s quite the same for gzip:
assuming that the zipped string is correctly stored in layer.data.value:
var decodedStream = TmxUnzip.DecodeBase64Zlib(layer.data.value);
using (var bn = new BinaryReader(decodedStream)){
for (int j = 0; j < tmxData.height; j++){
for (int i = 0; i < tmxData.width; i++){
var gid = bn.ReadUInt32();
Console.WriteLine(gid);
}
}
}
// where the function for unpack the zipped string is:
public static Stream DecodeBase64Zlib(string input)
{
byte[ ] ZlibBuffer = Convert.FromBase64String(input);
MemoryStream comp = new MemoryStream(ZlibBuffer);
return new Ionic.Zlib.ZlibStream(comp, Ionic.Zlib.CompressionMode.Decompress);
}