-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[google_maps_flutter] Add cameraControl enable/disable & position on web #9089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 15 commits
b4cc5f8
9281be8
25020bf
f2fe01d
b2d1d89
a5a5ff5
14a12bf
59403c3
a674307
67f8332
89fc4c4
34bdf2c
ce994ae
1e1e19f
c104583
2857f31
48769d3
bc8995c
e1baafe
c2db98a
f39f172
1c43687
8251ab0
e919f3d
e8bbbb5
a53dea0
bfa3f44
2296090
aff20e2
e3a17f9
a4c3b7c
bd44dad
347538e
e11955e
ba9375e
6c54f61
c7bf6d7
eba680c
9d7d258
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert the newline removals from the Android and iOS pubspecs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,4 @@ dev_dependencies: | |
flutter: | ||
uses-material-design: true | ||
assets: | ||
- assets/ | ||
- assets/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,4 +36,4 @@ dev_dependencies: | |
topics: | ||
- google-maps | ||
- google-maps-flutter | ||
- map | ||
- map |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,4 @@ dev_dependencies: | |
flutter: | ||
uses-material-design: true | ||
assets: | ||
- assets/ | ||
- assets/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,4 @@ dev_dependencies: | |
flutter: | ||
uses-material-design: true | ||
assets: | ||
- assets/ | ||
- assets/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 2.13.0 | ||
|
||
* Adds support for disabling or moving the camera control button on web. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change should be made to all the changelogs, not just this one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @stuartmorgan-g i updated google_maps_flutter, google_maps_platform_interface & google_maps_flutter_web. Android & iOS I didn't. Is it right? |
||
|
||
## 2.12.1 | ||
|
||
* Fixes the `zIndex` issue in the `copyWith` method. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ class MapConfiguration { | |
/// as either a full configuration selection, or an update to an existing | ||
/// configuration where only non-null values are updated. | ||
const MapConfiguration({ | ||
this.webCameraControlPosition, | ||
this.webCameraControlEnabled, | ||
this.webGestureHandling, | ||
this.compassEnabled, | ||
this.mapToolbarEnabled, | ||
|
@@ -44,6 +46,18 @@ class MapConfiguration { | |
/// See [WebGestureHandling] for more details. | ||
final WebGestureHandling? webGestureHandling; | ||
|
||
/// This setting controls how the API handles cameraControl button position on the map. Web only. | ||
/// | ||
/// If null, the Google Maps API will use its default camera control position. | ||
/// | ||
/// See [WebCameraControlPosition] for more details. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment here; the null behavior should be documented. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
final WebCameraControlPosition? webCameraControlPosition; | ||
|
||
/// This setting controls how the API handles cameraControl button on the map. Web only. | ||
/// | ||
/// See https://developers.google.com/maps/documentation/javascript/controls for more details. | ||
final bool? webCameraControlEnabled; | ||
|
||
/// True if the compass UI should be shown. | ||
final bool? compassEnabled; | ||
|
||
|
@@ -123,6 +137,14 @@ class MapConfiguration { | |
/// that are different from [other]. | ||
MapConfiguration diffFrom(MapConfiguration other) { | ||
return MapConfiguration( | ||
webCameraControlPosition: | ||
webCameraControlPosition != other.webCameraControlPosition | ||
? webCameraControlPosition | ||
: null, | ||
webCameraControlEnabled: | ||
webCameraControlEnabled != other.webCameraControlEnabled | ||
? webCameraControlEnabled | ||
: null, | ||
webGestureHandling: webGestureHandling != other.webGestureHandling | ||
? webGestureHandling | ||
: null, | ||
|
@@ -188,6 +210,10 @@ class MapConfiguration { | |
/// replacing the previous values. | ||
MapConfiguration applyDiff(MapConfiguration diff) { | ||
return MapConfiguration( | ||
webCameraControlPosition: | ||
diff.webCameraControlPosition ?? webCameraControlPosition, | ||
webCameraControlEnabled: | ||
diff.webCameraControlEnabled ?? webCameraControlEnabled, | ||
webGestureHandling: diff.webGestureHandling ?? webGestureHandling, | ||
compassEnabled: diff.compassEnabled ?? compassEnabled, | ||
mapToolbarEnabled: diff.mapToolbarEnabled ?? mapToolbarEnabled, | ||
|
@@ -219,6 +245,8 @@ class MapConfiguration { | |
|
||
/// True if no options are set. | ||
bool get isEmpty => | ||
webCameraControlPosition == null && | ||
webCameraControlEnabled == null && | ||
webGestureHandling == null && | ||
compassEnabled == null && | ||
mapToolbarEnabled == null && | ||
|
@@ -251,6 +279,8 @@ class MapConfiguration { | |
return false; | ||
} | ||
return other is MapConfiguration && | ||
webCameraControlPosition == other.webCameraControlPosition && | ||
webCameraControlEnabled == other.webCameraControlEnabled && | ||
webGestureHandling == other.webGestureHandling && | ||
compassEnabled == other.compassEnabled && | ||
mapToolbarEnabled == other.mapToolbarEnabled && | ||
|
@@ -278,6 +308,8 @@ class MapConfiguration { | |
@override | ||
int get hashCode => Object.hashAll(<Object?>[ | ||
webGestureHandling, | ||
webCameraControlPosition, | ||
webCameraControlEnabled, | ||
compassEnabled, | ||
mapToolbarEnabled, | ||
cameraTargetBounds, | ||
|
Uh oh!
There was an error while loading. Please reload this page.