From 2f6ccfe6be048b5cbebe9138214238afde34fafb Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Thu, 17 Sep 2020 15:26:18 +0300 Subject: [PATCH] Fix #9555 --- .../net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java | 4 ++-- OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java index e40a911027..da7a7882d3 100644 --- a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java +++ b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java @@ -149,10 +149,10 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin { underlayLayer.setMap(null); } if(settings.LAYER_TRANSPARENCY_SEEKBAR_MODE.get() == LayerTransparencySeekbarMode.UNDERLAY && - underlayLayer.getMap() != null) { + underlayLayer.getMap() != null || underlayLayer.getMapTileAdapter() != null) { layers.getMapControlsLayer().showTransparencyBar(settings.MAP_TRANSPARENCY, true); } else if(settings.LAYER_TRANSPARENCY_SEEKBAR_MODE.get() == LayerTransparencySeekbarMode.OVERLAY && - overlayLayer.getMap() != null) { + overlayLayer.getMap() != null || overlayLayer.getMapTileAdapter() != null) { layers.getMapControlsLayer().showTransparencyBar(settings.MAP_OVERLAY_TRANSPARENCY, true); } else { layers.getMapControlsLayer().hideTransparencyBar(); diff --git a/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java b/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java index a58713c4cc..1118cfd514 100644 --- a/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java +++ b/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java @@ -25,6 +25,7 @@ public class YandexTrafficAdapter extends MapTileAdapter { private final static Log log = PlatformUtil.getLog(MapTileLayer.class); private final static String YANDEX_PREFFIX = ".YandexTraffic_"; + private final static String YANDEX_BASE_URL = "https://core-jams-rdr.maps.yandex.net"; private static final long DELTA = 10 * 60 * 1000; private long lastTimestampUpdated; @@ -59,11 +60,6 @@ public class YandexTrafficAdapter extends MapTileAdapter { } protected void updateTimeStampImpl() { - String YANDEX_BASE_URL; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) - YANDEX_BASE_URL = "https://core-jams-rdr.maps.yandex.net"; - else - YANDEX_BASE_URL = "http://core-jams-rdr.maps.yandex.net"; if (mTimestamp == null || (System.currentTimeMillis() - lastTimestampUpdated) > DELTA) { log.info("Updating timestamp"); //$NON-NLS-1$ try {