use of net.osmand.plus.views.layers.MapControlsLayer in project Osmand by osmandapp.
the class ContextMenuScrollFragment method onDestroyView.
@Override
public void onDestroyView() {
super.onDestroyView();
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
MapLayers mapLayers = mapActivity.getMapLayers();
MapControlsLayer mapControlsLayer = mapLayers.getMapControlsLayer();
mapControlsLayer.removeHudButtons(Arrays.asList(ZOOM_IN_BUTTON_ID, ZOOM_OUT_BUTTON_ID, BACK_TO_LOC_BUTTON_ID));
MapInfoLayer mapInfoLayer = mapLayers.getMapInfoLayer();
mapInfoLayer.removeRulerWidgets(Collections.singletonList(rulerWidget));
}
}
use of net.osmand.plus.views.layers.MapControlsLayer in project Osmand by osmandapp.
the class LauncherShortcutsHelper method navigateTo.
private void navigateTo(@NonNull MapActivity mapActivity, @Nullable FavouritePoint point) {
if (point == null) {
MapControlsLayer mapControlsLayer = mapActivity.getMapLayers().getMapControlsLayer();
if (mapControlsLayer != null) {
mapControlsLayer.doRoute(false);
}
} else {
app.getRoutingHelper().setRoutePlanningMode(true);
LatLon latLon = new LatLon(point.getLatitude(), point.getLongitude());
PointDescription description = point.getPointDescription(app);
app.getTargetPointsHelper().navigateToPoint(latLon, true, -1, description);
OsmAndLocationProvider.requestFineLocationPermissionIfNeeded(mapActivity);
}
}
use of net.osmand.plus.views.layers.MapControlsLayer in project Osmand by osmandapp.
the class SnapTrackWarningFragment method setupControlButtons.
private void setupControlButtons(@NonNull View view) {
MapActivity mapActivity = getMapActivity();
View zoomInButtonView = view.findViewById(R.id.map_zoom_in_button);
View zoomOutButtonView = view.findViewById(R.id.map_zoom_out_button);
View myLocButtonView = view.findViewById(R.id.map_my_location_button);
View mapRulerView = view.findViewById(R.id.map_ruler_layout);
MapLayers mapLayers = mapActivity.getMapLayers();
OsmandMapTileView mapTileView = mapActivity.getMapView();
View.OnLongClickListener longClickListener = MapControlsLayer.getOnClickMagnifierListener(mapTileView);
MapControlsLayer mapControlsLayer = mapLayers.getMapControlsLayer();
mapControlsLayer.setupZoomInButton(zoomInButtonView, longClickListener, ZOOM_IN_BUTTON_ID);
mapControlsLayer.setupZoomOutButton(zoomOutButtonView, longClickListener, ZOOM_OUT_BUTTON_ID);
mapControlsLayer.setupBackToLocationButton(myLocButtonView, false, BACK_TO_LOC_BUTTON_ID);
MapInfoLayer mapInfoLayer = mapLayers.getMapInfoLayer();
mapInfoLayer.setupRulerWidget(mapRulerView);
}
use of net.osmand.plus.views.layers.MapControlsLayer in project Osmand by osmandapp.
the class ChooseRouteFragment method onDestroyView.
@Override
public void onDestroyView() {
super.onDestroyView();
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
MapControlsLayer mapControlsLayer = mapActivity.getMapLayers().getMapControlsLayer();
mapControlsLayer.removeHudButtons(Arrays.asList(ZOOM_IN_BUTTON_ID, ZOOM_OUT_BUTTON_ID, BACK_TO_LOC_BUTTON_ID));
}
}
use of net.osmand.plus.views.layers.MapControlsLayer in project Osmand by osmandapp.
the class ChooseRouteFragment method buildZoomButtons.
private void buildZoomButtons(@NonNull View view) {
MapActivity mapActivity = getMapActivity();
if (mapActivity == null) {
return;
}
// Zoom buttons
View zoomButtonsView = view.findViewById(R.id.map_hud_controls);
this.zoomButtonsView = zoomButtonsView;
ImageButton zoomInButton = view.findViewById(R.id.map_zoom_in_button);
ImageButton zoomOutButton = view.findViewById(R.id.map_zoom_out_button);
ImageButton backToLocation = view.findViewById(R.id.map_my_location_button);
OsmandMapTileView mapTileView = mapActivity.getMapView();
View.OnLongClickListener longClickListener = MapControlsLayer.getOnClickMagnifierListener(mapTileView);
MapControlsLayer mapControlsLayer = mapActivity.getMapLayers().getMapControlsLayer();
mapControlsLayer.setupZoomInButton(zoomInButton, longClickListener, ZOOM_IN_BUTTON_ID);
mapControlsLayer.setupZoomOutButton(zoomOutButton, longClickListener, ZOOM_OUT_BUTTON_ID);
mapControlsLayer.setupBackToLocationButton(backToLocation, false, BACK_TO_LOC_BUTTON_ID);
AndroidUiHelper.updateVisibility(zoomButtonsView, true);
}
Aggregations