*
* @param filename Image filename to save map render to.
*/
private void saveMapImage(String filename) {
final Map currentMap = editor.getCurrentMap();
final MapView myView = MapView.createViewforMap(currentMap);
myView.setMode(MapView.PF_NOSPECIAL, true);
// Take grid and zoom level from the current map view
final MapView mapView = editor.getMapView();
myView.setShowGrid(mapView.getShowGrid());
myView.setZoom(mapView.getZoom());
final Dimension imgSize = myView.getPreferredSize();
final int lastDot = filename.lastIndexOf('.');
if (lastDot == -1) {