Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 0f108ee

Browse files
author
Emmanuel Garcia
committed
loadedCallbackPending
1 parent 3be5ddd commit 0f108ee

File tree

1 file changed

+4
-4
lines changed
  • packages/google_maps_flutter/google_maps_flutter/android/src/main/java/io/flutter/plugins/googlemaps

1 file changed

+4
-4
lines changed

packages/google_maps_flutter/google_maps_flutter/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private CameraPosition getCameraPosition() {
133133
return trackCameraPosition ? googleMap.getCameraPosition() : null;
134134
}
135135

136-
private boolean invalidatePending = false;
136+
private boolean loadedCallbackPending = false;
137137

138138
/**
139139
* Invalidates the map view after the map has finished rendering.
@@ -152,19 +152,19 @@ private CameraPosition getCameraPosition() {
152152
* (16.66ms at 60hz) have passed since the drawing operation was issued.
153153
*/
154154
private void invalidateMapIfNeeded() {
155-
if (googleMap == null || invalidatePending) {
155+
if (googleMap == null || loadedCallbackPending) {
156156
return;
157157
}
158-
invalidatePending = true;
158+
loadedCallbackPending = true;
159159
googleMap.setOnMapLoadedCallback(
160160
new GoogleMap.OnMapLoadedCallback() {
161161
@Override
162162
public void onMapLoaded() {
163+
loadedCallbackPending = false;
163164
postFrameCallback(
164165
() -> {
165166
postFrameCallback(
166167
() -> {
167-
invalidatePending = false;
168168
if (mapView != null) {
169169
mapView.invalidate();
170170
}

0 commit comments

Comments
 (0)