From 0e8da64cb5a8438355002c32ab0e9f3fb58adcae Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 13 Oct 2014 01:04:55 +0200 Subject: [PATCH] Make sure we don't download maps with disabled plugin --- OsmAnd/src/net/osmand/plus/views/MapTileLayer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java b/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java index 23ab270a24..22d4e40848 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java @@ -6,8 +6,10 @@ import net.osmand.data.RotatedTileBox; import net.osmand.map.ITileSource; import net.osmand.map.TileSourceManager; import net.osmand.map.TileSourceManager.TileSourceTemplate; +import net.osmand.plus.OsmandPlugin; import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; +import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin; import net.osmand.plus.resources.ResourceManager; import net.osmand.util.MapUtils; import android.graphics.Bitmap; @@ -146,8 +148,8 @@ public class MapTileLayer extends BaseMapLayer { int width = (int) Math.ceil(tilesRect.right - left); int height = (int) Math.ceil(tilesRect.bottom + ellipticTileCorrection - top); - boolean useInternet = settings.USE_INTERNET_TO_DOWNLOAD_TILES.get() - && settings.isInternetConnectionAvailable() && map.couldBeDownloadedFromInternet(); + boolean useInternet = OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class) != null && + settings.USE_INTERNET_TO_DOWNLOAD_TILES.get() && settings.isInternetConnectionAvailable() && map.couldBeDownloadedFromInternet(); int maxLevel = Math.min(view.getSettings().MAX_LEVEL_TO_DOWNLOAD_TILE.get(), map.getMaximumZoomSupported()); int tileSize = map.getTileSize(); boolean oneTileShown = false;