use of net.osmand.plus.plugins.osmedit.helpers.OpenstreetmapsDbHelper in project Osmand by osmandapp.
the class OsmEditsSettingsItem method apply.
@Override
public void apply() {
List<OpenstreetmapPoint> newItems = getNewItems();
if (!newItems.isEmpty() || !duplicateItems.isEmpty()) {
appliedItems = new ArrayList<>(newItems);
OsmEditingPlugin osmEditingPlugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class);
if (osmEditingPlugin != null) {
OpenstreetmapsDbHelper db = osmEditingPlugin.getDBPOI();
for (OpenstreetmapPoint duplicate : duplicateItems) {
db.deletePOI(duplicate);
db.addOpenstreetmap(duplicate);
}
for (OpenstreetmapPoint point : appliedItems) {
db.addOpenstreetmap(point);
}
}
}
}
Aggregations