@Override
    protected void onSaveInstanceState(@NonNull final Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putBundle(STATE_ROUTETRACKUTILS, routeTrackUtils.getState());

        Log.d("New map: onSaveInstanceState");

        final MapState state = prepareMapState();
        outState.putParcelable(BUNDLE_MAP_STATE, state);
        if (proximityNotification != null) {
            outState.putParcelable(BUNDLE_PROXIMITY_NOTIFICATION, proximityNotification);
        }
        if (mapOptions.filterContext != null) {
            outState.putParcelable(BUNDLE_FILTERCONTEXT, mapOptions.filterContext);
        }
        if (sheetInfo != null) {
            outState.putParcelable(BUNDLE_SHEETINFO, sheetInfo);
        }
    }
Get the current map state from the map view if it exists or from the mapStateIntent field otherwise.

@return the current map state as an array of int, or null if no map state is available
main/src/main/java/cgeo/geocaching/maps/mapsforge/v6/NewMap.java