Search in sources :

Example 1 with SaveOsmChangeAsyncTask

use of net.osmand.plus.plugins.osmedit.asynctasks.SaveOsmChangeAsyncTask in project Osmand by osmandapp.

the class OsmEditsLayer method applyNewObjectPosition.

@Override
public void applyNewObjectPosition(@NonNull Object o, @NonNull LatLon position, @Nullable ApplyMovedObjectCallback callback) {
    if (o instanceof OsmPoint) {
        if (o instanceof OpenstreetmapPoint) {
            OpenstreetmapPoint objectInMotion = (OpenstreetmapPoint) o;
            Entity entity = objectInMotion.getEntity();
            entity.setLatitude(position.getLatitude());
            entity.setLongitude(position.getLongitude());
            new SaveOsmChangeAsyncTask(mOsmChangeUtil, objectInMotion, callback).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
        } else if (o instanceof OsmNotesPoint) {
            OsmNotesPoint objectInMotion = (OsmNotesPoint) o;
            objectInMotion.setLatitude(position.getLatitude());
            objectInMotion.setLongitude(position.getLongitude());
            new SaveOsmNoteAsyncTask(objectInMotion.getText(), ctx, callback, plugin, mOsmBugsUtil).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, objectInMotion);
        }
    }
}
Also used : SaveOsmNoteAsyncTask(net.osmand.plus.plugins.osmedit.asynctasks.SaveOsmNoteAsyncTask) Entity(net.osmand.osm.edit.Entity) OsmPoint(net.osmand.plus.plugins.osmedit.data.OsmPoint) OpenstreetmapPoint(net.osmand.plus.plugins.osmedit.data.OpenstreetmapPoint) OsmNotesPoint(net.osmand.plus.plugins.osmedit.data.OsmNotesPoint) SaveOsmChangeAsyncTask(net.osmand.plus.plugins.osmedit.asynctasks.SaveOsmChangeAsyncTask)

Aggregations

Entity (net.osmand.osm.edit.Entity)1 SaveOsmChangeAsyncTask (net.osmand.plus.plugins.osmedit.asynctasks.SaveOsmChangeAsyncTask)1 SaveOsmNoteAsyncTask (net.osmand.plus.plugins.osmedit.asynctasks.SaveOsmNoteAsyncTask)1 OpenstreetmapPoint (net.osmand.plus.plugins.osmedit.data.OpenstreetmapPoint)1 OsmNotesPoint (net.osmand.plus.plugins.osmedit.data.OsmNotesPoint)1 OsmPoint (net.osmand.plus.plugins.osmedit.data.OsmPoint)1