Fix - Do not show context menu when map opens from Go to map dialog

This commit is contained in:
Alexey Kulish 2015-11-19 10:04:40 +03:00
parent 23e0881214
commit 0f2d547a10
3 changed files with 13 additions and 2 deletions

View file

@ -41,6 +41,7 @@ public class PointDescription {
public static final String POINT_TYPE_OSM_BUG = "bug";
public static final String POINT_TYPE_WORLD_REGION = "world_region";
public static final String POINT_TYPE_GPX_ITEM = "gpx_item";
public static final String POINT_TYPE_WORLD_REGION_SHOW_ON_MAP = "world_region_show_on_map";
public static final PointDescription LOCATION_POINT = new PointDescription(POINT_TYPE_LOCATION, "");
@ -149,6 +150,10 @@ public class PointDescription {
}
}
public boolean contextMenuDisabled() {
return POINT_TYPE_WORLD_REGION_SHOW_ON_MAP.equals(type);
}
public boolean isLocation() {
return POINT_TYPE_LOCATION.equals(type);
}

View file

@ -550,7 +550,7 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents {
if (dashboardOnMap.isVisible()) {
dashboardOnMap.hideDashboard();
}
if (mapLabelToShow != null) {
if (mapLabelToShow != null && !mapLabelToShow.contextMenuDisabled()) {
mapContextMenu.setMapCenter(latLonToShow);
mapContextMenu.setMapPosition(mapView.getMapPosition());
mapContextMenu.show(latLonToShow, mapLabelToShow, toShow);

View file

@ -31,6 +31,7 @@ import net.osmand.IProgress;
import net.osmand.PlatformUtil;
import net.osmand.access.AccessibleToast;
import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
import net.osmand.map.WorldRegion;
import net.osmand.map.WorldRegion.RegionParams;
import net.osmand.plus.OsmandApplication;
@ -793,7 +794,12 @@ public class DownloadActivity extends ActionBarProgressActivity implements Downl
@Override
public void onClick(View v) {
OsmandApplication app = (OsmandApplication) getActivity().getApplication();
app.getSettings().setMapLocationToShow(regionCenter.getLatitude(), regionCenter.getLongitude(), 5, null);
app.getSettings().setMapLocationToShow(
regionCenter.getLatitude(),
regionCenter.getLongitude(),
5,
new PointDescription(PointDescription.POINT_TYPE_WORLD_REGION_SHOW_ON_MAP, ""));
dismiss();
MapActivity.launchMapActivityMoveToTop(getActivity());
}