@Override
    public boolean onOptionsItemSelected(@NonNull final MenuItem item) {
        final int id = item.getItemId();
        if (id == R.id.menu_map_live) {
            if (viewModel.mapType.enableLiveMap()) {
                Settings.setLiveMap(!Settings.isLiveMap());
                viewModel.transientIsLiveEnabled.setValue(Settings.isLiveMap());
                ActivityMixin.invalidateOptionsMenu(this);
                refreshListChooser();
                if (TRUE.equals(viewModel.transientIsLiveEnabled.getValue())) {
                    reloadCachesAndWaypoints();
                }
            } else {
                viewModel.mapType = new UnifiedMapType();
                viewModel.transientIsLiveEnabled.setValue(true);
                Settings.setLiveMap(true);
                refreshListChooser();
                MapUtils.updateFilterBar(this, viewModel.mapType.filterContext);
                updateSelectedBottomNavItemId();
                saveCenterAndZoom();
                final Geopoint coordsIndicator = viewModel.coordsIndicator.getValue();
                onMapReadyTasks(tileProvider);
                viewModel.coordsIndicator.setValue(coordsIndicator);
            }
            //refresh live status view
            refreshLiveStatusView();
        } else if (id == R.id.menu_map_rotation_off) {
            setMapRotation(MAPROTATION_OFF);
        } else if (id == R.id.menu_map_rotation_manual) {
            setMapRotation(MAPROTATION_MANUAL);
        } else if (id == R.id.menu_map_rotation_auto_lowpower) {
            setMapRotation(MAPROTATION_AUTO_LOWPOWER);
        } else if (id == R.id.menu_map_rotation_auto_precise) {
            setMapRotation(MAPROTATION_AUTO_PRECISE);
        } else if (id == R.id.menu_check_routingdata) {
            final Viewport vp = mapFragment.getViewportNonNull();
            MapUtils.checkRoutingData(this, vp.getLatitudeMin(), vp.getLongitudeMin(), vp.getLatitudeMax(), vp.getLongitudeMax());
        } else if (id == R.id.menu_check_hillshadingdata) {
            final Viewport vp = mapFragment.getViewportNonNull();
            MapUtils.checkHillshadingData(this, vp.getLatitudeMin(), vp.getLongitudeMin(), vp.getLatitudeMax(), vp.getLongitudeMax());
        } else if (HistoryTrackUtils.onOptionsItemSelected(this, id, () -> viewModel.positionHistory.setValue(viewModel.positionHistory.getValue()), () -> {
            PositionHistory positionHistory = viewModel.positionHistory.getValue();
            if (positionHistory == null) {
                positionHistory = new PositionHistory();
            }
            positionHistory.reset();
        })
                || DownloaderUtils.onOptionsItemSelected(this, id)) {
            return true;
        } else if (id == R.id.menu_filter) {
            showFilterMenu();
        } else if (id == R.id.menu_store_caches) {
            final Set<String> geocodes = viewModel.caches.readWithResult(caches ->
                    mapFragment.getViewport()
                            .filter(caches)
                            .stream()
                            .map(Geocache::getGeocode)
                            .collect(Collectors.toSet()));
            CacheDownloaderService.downloadCaches(this, geocodes, false, false, () -> viewModel.caches.notifyDataChanged(false));
        } else if (id == R.id.menu_theme_mode) {
            mapFragment.selectTheme(this);
        } else if (id == R.id.menu_theme_options) {
            mapFragment.selectThemeOptions(this);
        } else if (id == R.id.menu_routetrack) {
            routeTrackUtils.showPopup(viewModel.individualRoute.getValue(), viewModel::setTarget, this::handleLongTapOnRoutesOrTracks);
        } else if (id == R.id.menu_select_mapview) {
            // dynamically create submenu to reflect possible changes in map sources
            final View v = findViewById(R.id.menu_select_mapview);
            if (v != null) {
                final PopupMenu menu = new PopupMenu(this, v, Gravity.TOP);
                menu.inflate(R.menu.map_mapview);
                TileProviderFactory.addMapviewMenuItems(this, menu);
                menu.setOnMenuItemClickListener(this::onOptionsItemSelected);
                menu.setForceShowIcon(true);
                menu.show();
            }
        } else if (id == R.id.menu_as_list) {
            final Collection<Geocache> caches = viewModel.caches.readWithResult(vmCaches ->
                    mapFragment.getViewport().filter(vmCaches));
            CacheListActivity.startActivityMap(this, new SearchResult(caches));
        } else if (id == R.id.menu_hillshading) {
            Settings.setMapShadingShowLayer(!Settings.getMapShadingShowLayer());
            item.setChecked(Settings.getMapShadingShowLayer());
            changeMapSource(mapFragment.currentTileProvider);
        } else if (id == R.id.menu_backgroundmap) {
            Settings.setMapBackgroundMapLayer(!Settings.getMapBackgroundMapLayer());
            item.setChecked(Settings.getMapBackgroundMapLayer());
            changeMapSource(mapFragment.currentTileProvider);
        } else { // dynamic submenus: Map language, Map source
            final String language = TileProviderFactory.getLanguage(id);
            final AbstractTileProvider tileProviderLocal = TileProviderFactory.getTileProvider(id);
            if (language != null || id == MAP_LANGUAGE_DEFAULT_ID) {
                item.setChecked(true);
                Settings.setMapLanguage(language);
                mapFragment.setPreferredLanguage(language);
            } else if (tileProviderLocal != null) {
                item.setChecked(true);
                Settings.setPreviousTileProvider(tileProvider);
                changeMapSource(tileProviderLocal);
            }
            if (mapFragment.onOptionsItemSelected(item)) {
                return true;
            } else {
                return super.onOptionsItemSelected(item);
            }
        }
        MenuUtils.tintToolbarAndOverflowIcons(toolbarMenu);
        return true;
    }
centers map on coords given + resets "followMyLocation" state
main/src/main/java/cgeo/geocaching/unifiedmap/UnifiedMapActivity.java