use of net.osmand.plus.mapcontextmenu.MapContextMenu in project Osmand by osmandapp.
the class AvoidSpecificRoads method addImpassableRoadInternal.
private void addImpassableRoadInternal(@NonNull RouteDataObject object, @NonNull Location ll, boolean showDialog, @Nullable MapActivity activity, @NonNull LatLon loc) {
if (!app.getDefaultRoutingConfig().addImpassableRoad(object, ll)) {
LatLon location = getLocation(object);
if (location != null) {
app.getSettings().removeImpassableRoad(getLocation(object));
}
}
RoutingHelper rh = app.getRoutingHelper();
if (rh.isRouteCalculated() || rh.isRouteBeingCalculated()) {
rh.recalculateRouteDueToSettingsChange();
}
if (activity != null) {
if (showDialog) {
showDialog(activity);
}
MapContextMenu menu = activity.getContextMenu();
if (menu.isActive() && menu.getLatLon().equals(loc)) {
menu.close();
}
activity.refreshMap();
}
}
use of net.osmand.plus.mapcontextmenu.MapContextMenu in project Osmand by osmandapp.
the class ExternalApiHelper method showOnMap.
private void showOnMap(double lat, double lon, Object object, PointDescription pointDescription) {
MapContextMenu mapContextMenu = mapActivity.getContextMenu();
mapContextMenu.setMapCenter(new LatLon(lat, lon));
mapContextMenu.setMapPosition(mapActivity.getMapView().getMapPosition());
mapContextMenu.setCenterMarker(true);
mapContextMenu.setMapZoom(15);
mapContextMenu.show(new LatLon(lat, lon), pointDescription, object);
}
use of net.osmand.plus.mapcontextmenu.MapContextMenu in project Osmand by osmandapp.
the class AudioVideoNotesPlugin method updateContextMenu.
private void updateContextMenu(Recording rec) {
if (mapActivity != null && rec != null) {
MapContextMenu menu = mapActivity.getContextMenu();
menu.show(new LatLon(rec.lat, rec.lon), audioNotesLayer.getObjectName(rec), rec);
if (app.getRoutingHelper().isFollowingMode()) {
menu.hideWithTimeout(3000);
}
}
}
use of net.osmand.plus.mapcontextmenu.MapContextMenu in project Osmand by osmandapp.
the class ParkingPositionPlugin method showContextMenuIfNeeded.
void showContextMenuIfNeeded(final MapActivity mapActivity, boolean animated) {
if (parkingLayer != null) {
MapContextMenu menu = mapActivity.getContextMenu();
if (menu.isVisible()) {
menu.hide(animated);
menu.show(new LatLon(parkingPosition.getLatitude(), parkingPosition.getLongitude()), parkingLayer.getObjectName(parkingPosition), parkingPosition);
}
}
}
use of net.osmand.plus.mapcontextmenu.MapContextMenu in project Osmand by osmandapp.
the class DownloadedRegionsLayer method collectObjectsFromPoint.
// IContextMenuProvider
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List<Object> objects, boolean unknownLocation) {
boolean isMenuVisible = false;
if (view.getContext() instanceof MapActivity) {
MapActivity mapActivity = (MapActivity) view.getContext();
MapContextMenu menu = mapActivity.getContextMenu();
MapMultiSelectionMenu multiMenu = menu.getMultiSelectionMenu();
isMenuVisible = menu.isVisible() || multiMenu.isVisible();
}
if (!isMenuVisible) {
getWorldRegionFromPoint(tileBox, point, objects);
}
}
Aggregations