From 32090f7ed62586dcd50873922ae149395d5563a3 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Wed, 25 Nov 2015 12:48:07 +0300 Subject: [PATCH] Fix crash at DownloadedRegionsLayer (4), fix - show selection of map region only after it was choosen from multi menu --- .../plus/mapcontextmenu/other/MapMultiSelectionMenu.java | 2 ++ OsmAnd/src/net/osmand/plus/views/DownloadedRegionsLayer.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenu.java index 728c6e331d..9f63193d6c 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenu.java @@ -156,11 +156,13 @@ public class MapMultiSelectionMenu extends BaseMenuController { hide(); } +/* for (Map.Entry e : selectedObjects.entrySet()) { if (e.getValue() instanceof ContextMenuLayer.IContextMenuProviderSelection) { ((ContextMenuLayer.IContextMenuProviderSelection) e.getValue()).setSelectedObject(e.getKey()); } } +*/ this.latLon = latLon; createCollection(selectedObjects); diff --git a/OsmAnd/src/net/osmand/plus/views/DownloadedRegionsLayer.java b/OsmAnd/src/net/osmand/plus/views/DownloadedRegionsLayer.java index aa67c58ae1..423efd633c 100644 --- a/OsmAnd/src/net/osmand/plus/views/DownloadedRegionsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/DownloadedRegionsLayer.java @@ -484,7 +484,8 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe private void getWorldRegionFromPoint(RotatedTileBox tb, PointF point, List dataObjects) { int zoom = tb.getZoom(); - if (zoom >= ZOOM_TO_SHOW_SELECTION_ST && zoom < ZOOM_TO_SHOW_SELECTION && osmandRegions.isInitialized()) { + if (zoom >= ZOOM_TO_SHOW_SELECTION_ST && zoom < ZOOM_TO_SHOW_SELECTION + && data.results != null && osmandRegions.isInitialized()) { LatLon pointLatLon = tb.getLatLonFromPixel(point.x, point.y); int point31x = MapUtils.get31TileNumberX(pointLatLon.getLongitude()); int point31y = MapUtils.get31TileNumberY(pointLatLon.getLatitude());