Skip to content

Commit

Permalink
MapWithAILayer: Don't allow MapWithAI data to be merged into a OSM da…
Browse files Browse the repository at this point in the history
…ta layer.

Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Jan 13, 2021
1 parent d1f5ff3 commit 7986d7e
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -299,4 +301,16 @@ public Component createMenuComponent() {
}

}

@Override
public boolean autosave(File file) throws IOException {
// Consider a deletion a "successful" save.
return Files.deleteIfExists(file.toPath());
}

@Override
public boolean isMergable(final Layer other) {
// Don't allow this layer to be merged down
return other instanceof MapWithAILayer;
}
}

0 comments on commit 7986d7e

Please sign in to comment.