Fix crash at DownloadedRegionsLayer (4), fix - show selection of map region only after it was choosen from multi menu

This commit is contained in:
Alexey Kulish 2015-11-25 12:48:07 +03:00
parent 4e2bdf8553
commit 32090f7ed6
2 changed files with 4 additions and 1 deletions

View file

@ -156,11 +156,13 @@ public class MapMultiSelectionMenu extends BaseMenuController {
hide();
}
/*
for (Map.Entry<Object, IContextMenuProvider> e : selectedObjects.entrySet()) {
if (e.getValue() instanceof ContextMenuLayer.IContextMenuProviderSelection) {
((ContextMenuLayer.IContextMenuProviderSelection) e.getValue()).setSelectedObject(e.getKey());
}
}
*/
this.latLon = latLon;
createCollection(selectedObjects);

View file

@ -484,7 +484,8 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe
private void getWorldRegionFromPoint(RotatedTileBox tb, PointF point, List<? super DownloadMapObject> 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());