@@ -9,10 +9,9 @@ typedef void MapCreatedCallback(GoogleMapController controller);
99/// Callback that receives updates to the camera position.
1010///
1111/// This callback is triggered when the platform Google Map
12- /// registers a camera movement. This will be called with null if
13- /// [GoogleMap.trackCameraPosition] is false.
12+ /// registers a camera movement.
1413///
15- /// This is used in [GoogleMap.onCameraMove] and [GoogleMap.onMapOptionsUpdate] .
14+ /// This is used in [GoogleMap.onCameraMove] .
1615typedef void CameraPositionCallback (CameraPosition position);
1716
1817class GoogleMap extends StatefulWidget {
@@ -28,7 +27,6 @@ class GoogleMap extends StatefulWidget {
2827 this .scrollGesturesEnabled = true ,
2928 this .zoomGesturesEnabled = true ,
3029 this .tiltGesturesEnabled = true ,
31- this .trackCameraPosition = false ,
3230 this .myLocationEnabled = false ,
3331 this .markers,
3432 this .onCameraMoveStarted,
@@ -67,9 +65,6 @@ class GoogleMap extends StatefulWidget {
6765 /// True if the map view should respond to tilt gestures.
6866 final bool tiltGesturesEnabled;
6967
70- /// True if the map view should relay camera move events to Flutter.
71- final bool trackCameraPosition;
72-
7368 /// Markers to be placed on the map.
7469 final Set <Marker > markers;
7570
@@ -81,17 +76,13 @@ class GoogleMap extends StatefulWidget {
8176 /// 2. Programmatically initiated animation.
8277 /// 3. Camera motion initiated in response to user gestures on the map.
8378 /// For example: pan, tilt, pinch to zoom, or rotate.
84- ///
85- /// Note: This is callback is called even if [trackCameraPosition] is false.
8679 final VoidCallback onCameraMoveStarted;
8780
8881 /// Called repeatedly as the camera continues to move after an
8982 /// onCameraMoveStarted call.
9083 ///
9184 /// This may be called as often as once every frame and should
9285 /// not perform expensive operations.
93- ///
94- /// This is only called if [trackCameraPosition] is true.
9586 final CameraPositionCallback onCameraMove;
9687
9788 /// Called when camera movement has ended, there are no pending
@@ -259,7 +250,7 @@ class _GoogleMapOptions {
259250 rotateGesturesEnabled: map.rotateGesturesEnabled,
260251 scrollGesturesEnabled: map.scrollGesturesEnabled,
261252 tiltGesturesEnabled: map.tiltGesturesEnabled,
262- trackCameraPosition: map.trackCameraPosition ,
253+ trackCameraPosition: map.onCameraMove != null ,
263254 zoomGesturesEnabled: map.zoomGesturesEnabled,
264255 myLocationEnabled: map.myLocationEnabled,
265256 );
0 commit comments