Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.20+5

* Allow (de-)serialization of CameraPosition

## 0.5.20+4

* Marker drag event
Expand Down
5 changes: 2 additions & 3 deletions packages/google_maps_flutter/lib/src/camera.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,13 @@ class CameraPosition {
/// will be silently clamped to the supported range.
final double zoom;

dynamic _toMap() => <String, dynamic>{
dynamic toMap() => <String, dynamic>{
'bearing': bearing,
'target': target._toJson(),
'tilt': tilt,
'zoom': zoom,
};

@visibleForTesting
static CameraPosition fromMap(dynamic json) {
if (json == null) {
return null;
Expand Down Expand Up @@ -98,7 +97,7 @@ class CameraUpdate {
/// Returns a camera update that moves the camera to the specified position.
static CameraUpdate newCameraPosition(CameraPosition cameraPosition) {
return CameraUpdate._(
<dynamic>['newCameraPosition', cameraPosition._toMap()],
<dynamic>['newCameraPosition', cameraPosition.toMap()],
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/google_maps_flutter/lib/src/google_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class _GoogleMapState extends State<GoogleMap> {
@override
Widget build(BuildContext context) {
final Map<String, dynamic> creationParams = <String, dynamic>{
'initialCameraPosition': widget.initialCameraPosition?._toMap(),
'initialCameraPosition': widget.initialCameraPosition?.toMap(),
'options': _googleMapOptions.toMap(),
'markersToAdd': _serializeMarkerSet(widget.markers),
'polygonsToAdd': _serializePolygonSet(widget.polygons),
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 <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter
version: 0.5.20+4
version: 0.5.20+5

dependencies:
flutter:
Expand Down