if (ret == JOptionPane.YES_OPTION) {
TileMergeHelper tmh = new TileMergeHelper(map);
int len = map.getTotalLayers();
// TODO: Add a dialog option: "Yes, visible only"
TileLayer newLayer = tmh.merge(0, len, true);
map.removeAllLayers();
map.addLayer(newLayer);
newLayer.setName("Merged Layer");
map.addTileset(tmh.getSet());
editor.setCurrentLayer(0);