JSON Export¶
MapCreator exports a JSON snapshot of the current editor state. Use it to save a map, move it between machines, or inspect the generated data structure.
How to export¶
- Click
Exportin the menu bar - Use the
savekeybind - The file downloads as
<map name>.json - The editor also posts the same payload to
POST /api/exportwhen the canvas save flow runs
What the export contains¶
The current export is the full editor bundle returned by exportFull() in src/editor/store.ts.
{
map: BuildingMap,
simulation: {
roomA,
roomB,
options,
path,
paused,
pendingFloor,
},
tileClasses,
overlayClasses,
regions,
}
The actual map data lives in map.
That map object matches the BuildingMap schema in src/core/validator.ts.
How to use it¶
- To load a map back into the editor, import a plain
BuildingMapJSON file - To inspect or reuse the file in another tool, read the
mapfield first - To serve a saved export in viewer mode, point
?map=to the JSON file path used by the app
Example viewer URL:
How to change it¶
If you want a different export format, change these files:
src/editor/store.tssrc/editor/MenuBar.tsxsrc/editor/canvas/interaction.ts
The key decision is whether the export should be:
- a full editor snapshot from
exportFull() - a map-only file from
exportMap()
If you want a clean, importable map JSON, switch the export call to exportMap() and keep the validator in sync with BuildingMapSchema.
JSON schema notes¶
floors[*].baseuses tile types likewall,floor,stairs,elevator,outside,void, anddirt_pathfloors[*].overlayusesdoor,exit_door,room, ornullfloors[*].metastores tile metadata keyed byrow,colversion,createdAt, andupdatedAtare part of the persisted mapbuildingsis optional on import, but the app fills in a default building when it is missing
Next step¶
Read the Configuration guide for the map fields that control the exported data.