@Override
    public boolean onOptionsItemSelected(@NonNull final MenuItem item) {
        final int id = item.getItemId();
        if (id == R.id.menu_map_rotation_off) {
            setMapRotation(item, Settings.MAPROTATION_OFF);
        } else if (id == R.id.menu_map_rotation_manual) {
            setMapRotation(item, Settings.MAPROTATION_MANUAL);
        } else if (id == R.id.menu_map_rotation_auto_lowpower) {
            setMapRotation(item, Settings.MAPROTATION_AUTO_LOWPOWER);
        } else if (id == R.id.menu_filter) {
            getMapActivity().showFilterMenu();
        } else if (id == R.id.menu_map_live) {
            mapOptions.isLiveEnabled = !mapOptions.isLiveEnabled;
            if (mapOptions.mapMode == MapMode.LIVE) {
                Settings.setLiveMap(mapOptions.isLiveEnabled);
            }
            if (mapOptions.isLiveEnabled) {
                mapOptions.isStoredEnabled = true;
                mapOptions.filterContext = new GeocacheFilterContext(GeocacheFilterContext.FilterType.LIVE);
                refreshMapData(false, true);
            }
            markersInvalidated = true;
            lastSearchResult = null;
            mapOptions.searchResult = null;
            ActivityMixin.invalidateOptionsMenu(activity);
            if (mapOptions.mapMode == MapMode.SINGLE) {
                setTarget(mapOptions.coords, mapOptions.geocode);
            }
            mapOptions.mapMode = MapMode.LIVE;
            mapOptions.title = StringUtils.EMPTY;
            updateMapTitle();
        } else if (id == R.id.menu_store_caches) {
            CacheDownloaderService.downloadCaches(activity, getGeocodesForCachesInViewport(), false, false, () -> displayExecutor.execute(new DisplayRunnable(CGeoMap.this)));
        } else if (id == R.id.menu_theme_mode) {
            mapView.selectMapTheme(activity);
        } else if (id == R.id.menu_as_list) {
            CacheListActivity.startActivityMap(activity, new SearchResult(getGeocodesForCachesInViewport()));
            ActivityMixin.overrideTransitionToFade(activity);
        } else if (id == R.id.menu_hint) {
            menuShowHint();
        } else if (id == R.id.menu_compass) {
            menuCompass();
        } else if (LoggingUI.onMenuItemSelected(item, activity, getSingleModeCache(), null)) {
            return true;
        } else if (id == R.id.menu_check_routingdata) {
            final Viewport bb = mapView.getViewport();
            if (bb != null) {
                MapUtils.checkRoutingData(activity, bb.bottomLeft.getLatitude(), bb.bottomLeft.getLongitude(), bb.topRight.getLatitude(), bb.topRight.getLongitude());
            }
        } else if (id == R.id.menu_check_hillshadingdata) {
            final Viewport bb = mapView.getViewport();
            if (bb != null) {
                MapUtils.checkHillshadingData(activity, bb.bottomLeft.getLatitude(), bb.bottomLeft.getLongitude(), bb.topRight.getLatitude(), bb.topRight.getLongitude());
            }
        } else if (HistoryTrackUtils.onOptionsItemSelected(activity, id, () -> mapView.repaintRequired(overlayPositionAndScale instanceof GeneralOverlay ? ((GeneralOverlay) overlayPositionAndScale) : null), this::clearTrailHistory)
                || DownloaderUtils.onOptionsItemSelected(activity, id)) {
            return true;
        } else if (id == R.id.menu_routetrack) {
            mapActivity.getRouteTrackUtils().showPopup(individualRoute, this::setTarget, null);
        } else {
            final MapSource mapSource = MapProviderFactory.getMapSource(id);
            if (mapSource != null) {
                item.setChecked(true);
                changeMapSource(mapSource);
            } else {
                return super.onOptionsItemSelected(item);
            }
        }
        return true;
    }
Set the zoom of the map. The zoom is restricted to a certain minimum in case of live map.
main/src/main/java/cgeo/geocaching/maps/CGeoMap.java