Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] - save debug cache state vs map state
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun committed Dec 21, 2018
1 parent edf33c8 commit a795e6d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public final class MapboxMap {
@Nullable
private Style style;

private boolean debugActive;

MapboxMap(NativeMapView map, Transform transform, UiSettings ui, Projection projection,
OnGesturesManagerInteractionListener listener, CameraChangeDispatcher cameraChangeDispatcher) {
this.nativeMapView = map;
Expand Down Expand Up @@ -145,7 +147,7 @@ void onStop() {
*/
void onSaveInstanceState(@NonNull Bundle outState) {
outState.putParcelable(MapboxConstants.STATE_CAMERA_POSITION, transform.getCameraPosition());
outState.putBoolean(MapboxConstants.STATE_DEBUG_ACTIVE, nativeMapView.getDebug());
outState.putBoolean(MapboxConstants.STATE_DEBUG_ACTIVE, isDebugActive());
uiSettings.onSaveInstanceState(outState);
}

Expand Down Expand Up @@ -696,7 +698,7 @@ public void setOfflineRegionDefinition(@NonNull OfflineRegionDefinition definiti
* @return If true, map debug information is currently shown.
*/
public boolean isDebugActive() {
return nativeMapView.getDebug();
return debugActive;
}

/**
Expand All @@ -708,6 +710,7 @@ public boolean isDebugActive() {
* @param debugActive If true, map debug information is shown.
*/
public void setDebugActive(boolean debugActive) {
this.debugActive = debugActive;
nativeMapView.setDebug(debugActive);
}

Expand All @@ -722,6 +725,7 @@ public void setDebugActive(boolean debugActive) {
*/
public void cycleDebugOptions() {
nativeMapView.cycleDebugOptions();
this.debugActive = nativeMapView.getDebug();
}

//
Expand Down

0 comments on commit a795e6d

Please sign in to comment.