Skip to content

Commit

Permalink
Merge pull request #12 from toru-matsushita/master
Browse files Browse the repository at this point in the history
Added zoomControlsEnabled flag
  • Loading branch information
LuisThein authored Jul 12, 2020
2 parents 189d0f8 + 7b2735c commit 028683f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 5 deletions.
4 changes: 2 additions & 2 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ packages:
name: google_maps_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.27"
google_maps_flutter_platform_interface:
version: "0.5.28+1"
image:
dependency: transitive
description:
name: google_maps_flutter_platform_interface
Expand Down
7 changes: 7 additions & 0 deletions lib/src/camera.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ class CameraPosition {
}

class CameraUpdate {
CameraUpdate._(this._json);

static newCameraPosition(CameraPosition cameraPosition) {
if (Platform.isIOS) {
return appleMaps.CameraUpdate.newCameraPosition(
Expand Down Expand Up @@ -137,4 +139,9 @@ class CameraUpdate {
return googleMaps.CameraUpdate.zoomTo(zoom);
}
}

final dynamic _json;

/// Converts this object to something serializable in JSON.
dynamic toJson() => _json;
}
8 changes: 8 additions & 0 deletions lib/src/platform_maps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class PlatformMap extends StatefulWidget {
this.padding,
this.rotateGesturesEnabled = true,
this.scrollGesturesEnabled = true,
this.zoomControlsEnabled = true,
this.zoomGesturesEnabled = true,
this.tiltGestureEnabled = true,
this.myLocationEnabled = false,
Expand Down Expand Up @@ -58,6 +59,12 @@ class PlatformMap extends StatefulWidget {
/// True if the map view should respond to scroll gestures.
final bool scrollGesturesEnabled;

/// True if the map view should show zoom controls. This includes two buttons
/// to zoom in and zoom out. The default value is to show zoom controls.
///
/// This is only supported on Android. And this field is silently ignored on iOS.
final bool zoomControlsEnabled;

/// True if the map view should respond to zoom gestures.
final bool zoomGesturesEnabled;

Expand Down Expand Up @@ -189,6 +196,7 @@ class _PlatformMapState extends State<PlatformMap> {
onCameraMoveStarted: widget.onCameraMoveStarted,
tiltGesturesEnabled: widget.tiltGestureEnabled,
rotateGesturesEnabled: widget.rotateGesturesEnabled,
zoomControlsEnabled: widget.zoomControlsEnabled,
zoomGesturesEnabled: widget.zoomGesturesEnabled,
scrollGesturesEnabled: widget.scrollGesturesEnabled,
onMapCreated: _onMapCreated,
Expand Down
3 changes: 3 additions & 0 deletions lib/src/ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ class MinMaxZoomPreference {

googleMaps.MinMaxZoomPreference get googleMapsZoomPreference =>
googleMaps.MinMaxZoomPreference(this.maxZoom, this.maxZoom);

/// Converts this object to something serializable in JSON.
dynamic toJson() => <dynamic>[minZoom, maxZoom];
}
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ packages:
name: google_maps_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.27"
google_maps_flutter_platform_interface:
version: "0.5.28+1"
image:
dependency: transitive
description:
name: google_maps_flutter_platform_interface
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
flutter:
sdk: flutter

google_maps_flutter: ^0.5.21+7
google_maps_flutter: ^0.5.28+1

apple_maps_flutter: ^0.1.1+1

Expand Down

0 comments on commit 028683f

Please sign in to comment.