final MapModel oldMap = Controller.getCurrentController().getMap();
Controller.getCurrentModeController().getMapController().newMap(url);
final IMapViewManager mapViewManager = Controller.getCurrentController().getMapViewManager();
final String key = mapViewManager.checkIfFileIsAlreadyOpened(url);
// make the map the current map even if it was already opened
if (key == null || !mapViewManager.tryToChangeToMapView(key))
throw new RuntimeException("map " + url + " does not seem to be opened");
final MapModel newMap = mapViewManager.getModel();
restartTransaction(oldMap, newMap);
return new MapProxy(newMap, scriptContext);
}