I need to export some tiledmap to different files, but after pressing ctrl+e, the selected file location is global one. It results in exporting different tiledmaps to the same file location after pressing Ctrl+E. it this a bug?
BTW: I can’t get the file name of tiledmap in tiled.registerMapFormat.
I don’t understand the first part of your post. Are you perhaps clicking “Export” (which repeats the last export if possible) when you mean to use “Export As” to set up a new export?
The map that’s passed into write() is a (currently read-only) clone that doesn’t have a fileName, Undo/Redo, etc, this is intentional. You’re supposed to only care about the destination filename given to you.
Of course, in practice, it is useful to know the current location sometimes, so it would be nice if there was a sourceFileName parameter to write() as well.
Oh, no, I meant you have to do that if you need to export the same map to multiple files (e.g. multiple formats or something). The last export name is saved for each map IIRC, so you should be able to
edit map1 then export to map1.json
edit map2 then export to map2.json
edit map1 then export, and it should automatically export to map1.json
edit map2 then export, and it should automatically export to map2.json
…
If that’s not the behaviour you’re seeing, then you’ve probably found a bug, or I’m misremembering (but it’d be pretty silly for it to work any other way).