diff --git a/OsmAnd/res/layout-land/map_image_view.xml b/OsmAnd/res/layout-land/context_menu_card_dialog.xml similarity index 90% rename from OsmAnd/res/layout-land/map_image_view.xml rename to OsmAnd/res/layout-land/context_menu_card_dialog.xml index 57de22d2e6..3b83e5ad54 100644 --- a/OsmAnd/res/layout-land/map_image_view.xml +++ b/OsmAnd/res/layout-land/context_menu_card_dialog.xml @@ -13,7 +13,7 @@ android:orientation="vertical"> { + + private ProgressBar progressBar; + private ImageView imageView; + + public DownloadImageTask(ProgressBar progressBar, ImageView imageView) { + this.progressBar = progressBar; + this.imageView = imageView; + } + + @Override + protected void onPreExecute() { + progressBar.setVisibility(View.VISIBLE); + } + + @Override + protected Bitmap doInBackground(Void... params) { + return AndroidNetworkUtils.downloadImage(getMapActivity().getMyApplication(), imageUrl); + } + + @Override + protected void onPostExecute(Bitmap bitmap) { + progressBar.setVisibility(View.GONE); + if (bitmap != null) { + imageView.setImageDrawable(new BitmapDrawable(getMapActivity().getResources(), bitmap)); + } + } + } +} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java index 6cb030c2c4..2ce6ce85e1 100644 --- a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java +++ b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java @@ -45,6 +45,8 @@ public class MapillaryPlugin extends OsmandPlugin { private TextInfoWidget mapillaryControl; private MapWidgetRegInfo mapillaryWidgetRegInfo; + private static boolean webGlSupported = true; + public MapillaryPlugin(OsmandApplication app) { this.app = app; settings = app.getSettings(); @@ -81,6 +83,14 @@ public class MapillaryPlugin extends OsmandPlugin { registerWidget(activity); } + public static boolean isWebGlSupported() { + return webGlSupported; + } + + public static void setWebGlSupported(boolean webGlSupported) { + MapillaryPlugin.webGlSupported = webGlSupported; + } + private void createLayers() { rasterLayer = new MapillaryLayer(); }