Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
4 changes: 4 additions & 0 deletions packages/google_maps_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5.21+13

* Add documentation.

## 0.5.21+12

* Update driver tests in the example app to e2e tests.
Expand Down
6 changes: 6 additions & 0 deletions packages/google_maps_flutter/lib/src/camera.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,19 @@ class CameraPosition {
/// will be silently clamped to the supported range.
final double zoom;

/// Serializes [CameraPosition].
///
/// Mainly for internal use when calling [CameraUpdate.newCameraPosition].
dynamic toMap() => <String, dynamic>{
'bearing': bearing,
'target': target._toJson(),
'tilt': tilt,
'zoom': zoom,
};

/// Deserializes [CameraPosition] from a map.
///
/// Mainly for internal use.
static CameraPosition fromMap(dynamic json) {
if (json == null) {
return null;
Expand Down
4 changes: 4 additions & 0 deletions packages/google_maps_flutter/lib/src/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class GoogleMapController {
channel.setMethodCallHandler(_handleMethodCall);
}

/// Initialize control of a [GoogleMap] with [id].
///
/// Mainly for internal use when instantiating a [GoogleMapController] passed
/// in [GoogleMap.onMapCreated] callback.
static Future<GoogleMapController> init(
int id,
CameraPosition initialCameraPosition,
Expand Down
9 changes: 9 additions & 0 deletions packages/google_maps_flutter/lib/src/google_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

part of google_maps_flutter;

/// Callback method for when the map is ready to be used.
///
/// Pass to [GoogleMap.onMapCreated] to receive a [GoogleMapController] when the
/// map is created.
typedef void MapCreatedCallback(GoogleMapController controller);

/// Callback that receives updates to the camera position.
Expand All @@ -14,6 +18,7 @@ typedef void MapCreatedCallback(GoogleMapController controller);
/// This is used in [GoogleMap.onCameraMove].
typedef void CameraPositionCallback(CameraPosition position);

/// A widget which displays a map with data obtained from the Google Maps service.
class GoogleMap extends StatefulWidget {
const GoogleMap({
Key key,
Expand Down Expand Up @@ -48,6 +53,9 @@ class GoogleMap extends StatefulWidget {
}) : assert(initialCameraPosition != null),
super(key: key);

/// Callback method for when the map is ready to be used.
///
/// Used to receive a [GoogleMapController] for this [GoogleMap].
final MapCreatedCallback onMapCreated;

/// The initial position of the map's camera.
Expand Down Expand Up @@ -179,6 +187,7 @@ class GoogleMap extends StatefulWidget {
/// were not claimed by any other gesture recognizer.
final Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers;

/// Creates a [State] for this [GoogleMap].
@override
State createState() => _GoogleMapState();
}
Expand Down
1 change: 1 addition & 0 deletions packages/google_maps_flutter/lib/src/location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class LatLngBounds {
}
}

/// Converts a list to [LatLngBounds].
@visibleForTesting
static LatLngBounds fromList(dynamic json) {
if (json == null) {
Expand Down
2 changes: 1 addition & 1 deletion packages/google_maps_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: google_maps_flutter
description: A Flutter plugin for integrating Google Maps in iOS and Android applications.
author: Flutter Team <flutter-dev@googlegroups.com>
homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter
version: 0.5.21+12
version: 0.5.21+13

dependencies:
flutter:
Expand Down