private void initFollowMyLocation(final boolean followMyLocation) {
        synchronized (inFollowMyLocation) {
            if (mapFragment == null || inFollowMyLocation[0] > 0) {
                return;
            }
            inFollowMyLocation[0]++;
        }
        Settings.setFollowMyLocation(followMyLocation);

        final ImageButton followMyLocationButton = findViewById(R.id.map_followmylocation_btn);
        if (followMyLocationButton != null) { // can be null after screen rotation
            followMyLocationButton.setImageResource(followMyLocation ? R.drawable.map_followmylocation_btn : R.drawable.map_followmylocation_off_btn);
            followMyLocationButton.setOnClickListener(v -> viewModel.followMyLocation.setValue(Boolean.FALSE.equals(viewModel.followMyLocation.getValue())));
        }

        if (followMyLocation) {
            final Location currentLocation = LocationDataProvider.getInstance().currentGeo(); // get location even if none was delivered to the view-model yet
            mapFragment.setCenter(new Geopoint(currentLocation.getLatitude(), currentLocation.getLongitude()));
        }
        checkDrivingMode();
        synchronized (inFollowMyLocation) {
            inFollowMyLocation[0]--;
        }
    }
centers map on coords given + resets "followMyLocation" state
main/src/main/java/cgeo/geocaching/unifiedmap/UnifiedMapActivity.java