Skip to content

Commit 028683f

Browse files
authored
Merge pull request #12 from toru-matsushita/master
Added zoomControlsEnabled flag
2 parents 189d0f8 + 7b2735c commit 028683f

File tree

6 files changed

+23
-5
lines changed

6 files changed

+23
-5
lines changed

example/pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ packages:
8080
name: google_maps_flutter
8181
url: "https://pub.dartlang.org"
8282
source: hosted
83-
version: "0.5.27"
84-
google_maps_flutter_platform_interface:
83+
version: "0.5.28+1"
84+
image:
8585
dependency: transitive
8686
description:
8787
name: google_maps_flutter_platform_interface

lib/src/camera.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ class CameraPosition {
8080
}
8181

8282
class CameraUpdate {
83+
CameraUpdate._(this._json);
84+
8385
static newCameraPosition(CameraPosition cameraPosition) {
8486
if (Platform.isIOS) {
8587
return appleMaps.CameraUpdate.newCameraPosition(
@@ -137,4 +139,9 @@ class CameraUpdate {
137139
return googleMaps.CameraUpdate.zoomTo(zoom);
138140
}
139141
}
142+
143+
final dynamic _json;
144+
145+
/// Converts this object to something serializable in JSON.
146+
dynamic toJson() => _json;
140147
}

lib/src/platform_maps.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class PlatformMap extends StatefulWidget {
1616
this.padding,
1717
this.rotateGesturesEnabled = true,
1818
this.scrollGesturesEnabled = true,
19+
this.zoomControlsEnabled = true,
1920
this.zoomGesturesEnabled = true,
2021
this.tiltGestureEnabled = true,
2122
this.myLocationEnabled = false,
@@ -58,6 +59,12 @@ class PlatformMap extends StatefulWidget {
5859
/// True if the map view should respond to scroll gestures.
5960
final bool scrollGesturesEnabled;
6061

62+
/// True if the map view should show zoom controls. This includes two buttons
63+
/// to zoom in and zoom out. The default value is to show zoom controls.
64+
///
65+
/// This is only supported on Android. And this field is silently ignored on iOS.
66+
final bool zoomControlsEnabled;
67+
6168
/// True if the map view should respond to zoom gestures.
6269
final bool zoomGesturesEnabled;
6370

@@ -189,6 +196,7 @@ class _PlatformMapState extends State<PlatformMap> {
189196
onCameraMoveStarted: widget.onCameraMoveStarted,
190197
tiltGesturesEnabled: widget.tiltGestureEnabled,
191198
rotateGesturesEnabled: widget.rotateGesturesEnabled,
199+
zoomControlsEnabled: widget.zoomControlsEnabled,
192200
zoomGesturesEnabled: widget.zoomGesturesEnabled,
193201
scrollGesturesEnabled: widget.scrollGesturesEnabled,
194202
onMapCreated: _onMapCreated,

lib/src/ui.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,7 @@ class MinMaxZoomPreference {
3636

3737
googleMaps.MinMaxZoomPreference get googleMapsZoomPreference =>
3838
googleMaps.MinMaxZoomPreference(this.maxZoom, this.maxZoom);
39+
40+
/// Converts this object to something serializable in JSON.
41+
dynamic toJson() => <dynamic>[minZoom, maxZoom];
3942
}

pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ packages:
7373
name: google_maps_flutter
7474
url: "https://pub.dartlang.org"
7575
source: hosted
76-
version: "0.5.27"
77-
google_maps_flutter_platform_interface:
76+
version: "0.5.28+1"
77+
image:
7878
dependency: transitive
7979
description:
8080
name: google_maps_flutter_platform_interface

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies:
1212
flutter:
1313
sdk: flutter
1414

15-
google_maps_flutter: ^0.5.21+7
15+
google_maps_flutter: ^0.5.28+1
1616

1717
apple_maps_flutter: ^0.1.1+1
1818

0 commit comments

Comments
 (0)