Search in sources :

Example 1 with OsmBugsLayer

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

the class SimpleProgressDialogPoiUploader method showProgressDialog.

@Override
public void showProgressDialog(OsmPoint[] points, boolean closeChangeSet, boolean anonymously) {
    ProgressDialogFragment dialog = ProgressDialogFragment.createInstance(R.string.uploading, R.string.local_openstreetmap_uploading, ProgressDialog.STYLE_HORIZONTAL);
    OsmEditingPlugin plugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class);
    OsmEditsUploadListener listener = new OsmEditsUploadListenerHelper(mapActivity, mapActivity.getString(R.string.local_openstreetmap_were_uploaded)) {

        @Override
        public void uploadEnded(Map<OsmPoint, String> loadErrorsMap) {
            super.uploadEnded(loadErrorsMap);
            mapActivity.getContextMenu().close();
            OsmBugsLayer l = mapActivity.getMapView().getLayerByClass(OsmBugsLayer.class);
            if (l != null) {
                l.clearCache();
                mapActivity.refreshMap();
            }
        }
    };
    dialog.show(mapActivity.getSupportFragmentManager(), ProgressDialogFragment.TAG);
    UploadOpenstreetmapPointAsyncTask uploadTask = new UploadOpenstreetmapPointAsyncTask(dialog, listener, plugin, points.length, closeChangeSet, anonymously);
    uploadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, points);
}
Also used : OsmEditsUploadListenerHelper(net.osmand.plus.plugins.osmedit.helpers.OsmEditsUploadListenerHelper) OsmBugsLayer(net.osmand.plus.plugins.osmedit.OsmBugsLayer) ProgressDialogFragment(net.osmand.plus.dialogs.ProgressDialogFragment) OsmEditsUploadListener(net.osmand.plus.plugins.osmedit.OsmEditsUploadListener) Map(java.util.Map) UploadOpenstreetmapPointAsyncTask(net.osmand.plus.plugins.osmedit.asynctasks.UploadOpenstreetmapPointAsyncTask) OsmEditingPlugin(net.osmand.plus.plugins.osmedit.OsmEditingPlugin)

Aggregations

Map (java.util.Map)1 ProgressDialogFragment (net.osmand.plus.dialogs.ProgressDialogFragment)1 OsmBugsLayer (net.osmand.plus.plugins.osmedit.OsmBugsLayer)1 OsmEditingPlugin (net.osmand.plus.plugins.osmedit.OsmEditingPlugin)1 OsmEditsUploadListener (net.osmand.plus.plugins.osmedit.OsmEditsUploadListener)1 UploadOpenstreetmapPointAsyncTask (net.osmand.plus.plugins.osmedit.asynctasks.UploadOpenstreetmapPointAsyncTask)1 OsmEditsUploadListenerHelper (net.osmand.plus.plugins.osmedit.helpers.OsmEditsUploadListenerHelper)1