Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b4cc5f8
feat: camera control on web
4rthurmonteiro Apr 15, 2025
9281be8
chore: update map_configuration_test.dart
4rthurmonteiro Apr 15, 2025
25020bf
chore: add dependecy_overrides
4rthurmonteiro Apr 15, 2025
f2fe01d
Merge remote-tracking branch 'upstream/main' into feat/camera_control
4rthurmonteiro Apr 21, 2025
b2d1d89
chore(step-1): make-deps-path-based
4rthurmonteiro Apr 21, 2025
a5a5ff5
chore(changelog): merge with upstream
4rthurmonteiro Apr 21, 2025
14a12bf
Merge branch 'main' into feat/camera_control
4rthurmonteiro Apr 24, 2025
59403c3
Merge branch 'main' into feat/camera_control
4rthurmonteiro Aug 6, 2025
a674307
chore: fix minor
4rthurmonteiro Aug 6, 2025
67f8332
chore: improve webCameraControlEnabled description
4rthurmonteiro Aug 6, 2025
89fc4c4
chore: add doc for WebCameraControlPosition? when is null
4rthurmonteiro Aug 6, 2025
34bdf2c
chore: update changelog
4rthurmonteiro Aug 6, 2025
ce994ae
chore: remove duplicated doc
4rthurmonteiro Aug 6, 2025
1e1e19f
fix: google_maps_flutter changelog
4rthurmonteiro Aug 6, 2025
c104583
chore: remove overrides
4rthurmonteiro Aug 6, 2025
2857f31
Merge remote-tracking branch 'upstream/main' into feat/camera_control
4rthurmonteiro Aug 27, 2025
48769d3
chore: update google_maps_flutter_web version
4rthurmonteiro Aug 27, 2025
bc8995c
chore: update google_maps_flutter changelog
4rthurmonteiro Aug 27, 2025
e1baafe
chore: undo
4rthurmonteiro Aug 27, 2025
c2db98a
chore: update web package changelog
4rthurmonteiro Aug 27, 2025
f39f172
chore: remove non doc-comments
4rthurmonteiro Aug 27, 2025
1c43687
chore: revert the newline removals from the Android and iOS pubspecs
4rthurmonteiro Aug 27, 2025
8251ab0
feat: add cameraControl enablse/disable
4rthurmonteiro Aug 27, 2025
e919f3d
Update packages/google_maps_flutter/google_maps_flutter_platform_inte…
4rthurmonteiro Aug 27, 2025
e8bbbb5
Merge remote-tracking branch 'origin/google_maps_flutter_platform_int…
4rthurmonteiro Aug 27, 2025
a53dea0
chore: update docs
4rthurmonteiro Aug 27, 2025
bfa3f44
Merge branch 'google_maps_flutter_platform_interface/camera_control' …
4rthurmonteiro Aug 27, 2025
2296090
Merge branch 'main' into feat/camera_control
4rthurmonteiro Aug 27, 2025
aff20e2
chore: add webCameraControlPosition test
4rthurmonteiro Aug 27, 2025
e3a17f9
Merge remote-tracking branch 'upstream/main' into feat/camera_control
4rthurmonteiro Aug 28, 2025
a4c3b7c
chore: remove platform interface override
4rthurmonteiro Aug 28, 2025
bd44dad
chore: remove platform interface override
4rthurmonteiro Aug 28, 2025
347538e
Merge remote-tracking branch 'upstream/main' into feat/camera_control
4rthurmonteiro Sep 2, 2025
e11955e
chore: remove dependency override
4rthurmonteiro Sep 2, 2025
ba9375e
chore: undo web example
4rthurmonteiro Sep 2, 2025
6c54f61
chore: undo line change
4rthurmonteiro Sep 2, 2025
c7bf6d7
chore: restore file
4rthurmonteiro Sep 2, 2025
eba680c
Merge branch 'main' into feat/camera_control
4rthurmonteiro Sep 3, 2025
9d7d258
chore: format file
4rthurmonteiro Sep 3, 2025
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 2.13.0

* Adds support for camera control button on web.
* Updates minimum supported SDK version to Flutter 3.29/Dart 3.7.

## 2.12.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class MapUiBodyState extends State<MapUiBody> {
late GoogleMapController _controller;
bool _nightMode = false;
String _mapStyle = '';
bool _webCameraControlEnabled = true;
WebCameraControlPosition? _webCameraControlPosition;

@override
void initState() {
Expand All @@ -72,6 +74,64 @@ class MapUiBodyState extends State<MapUiBody> {
super.dispose();
}

Widget _webCameraControlToggler() {
return TextButton(
child: Text(
'${_webCameraControlEnabled ? 'disable' : 'enable'} web camera control',
),
onPressed: () {
setState(() {
_webCameraControlEnabled = !_webCameraControlEnabled;
});
},
);
}

Widget _webCameraControlPositionToggler() {
return TextButton(
onPressed:
() => showDialog<void>(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Web camera control position'),
content: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
DropdownButton<WebCameraControlPosition>(
hint: const Text('Web camera control position'),
value: _webCameraControlPosition,
items:
WebCameraControlPosition.values
.map(
(WebCameraControlPosition e) =>
DropdownMenuItem<WebCameraControlPosition>(
value: e,
child: Text(e.name),
),
)
.toList(),
onChanged: (WebCameraControlPosition? value) {
setState(() {
_webCameraControlPosition = value;
});
},
),
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: const Text('Ok'),
),
],
),
);
},
),
child: const Text('change web camera control position'),
);
}

Widget _compassToggler() {
return TextButton(
child: Text('${_compassEnabled ? 'disable' : 'enable'} compass'),
Expand Down Expand Up @@ -269,6 +329,8 @@ class MapUiBodyState extends State<MapUiBody> {
@override
Widget build(BuildContext context) {
final GoogleMap googleMap = GoogleMap(
webCameraControlEnabled: _webCameraControlEnabled,
webCameraControlPosition: _webCameraControlPosition,
onMapCreated: onMapCreated,
initialCameraPosition: _kInitialPosition,
compassEnabled: _compassEnabled,
Expand Down Expand Up @@ -326,6 +388,11 @@ class MapUiBodyState extends State<MapUiBody> {
_myLocationButtonToggler(),
_myTrafficToggler(),
_nightModeToggler(),
if (kIsWeb) ...<Widget>[
_webCameraControlToggler(),
if (_webCameraControlEnabled)
_webCameraControlPositionToggler(),
],
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
# the parent directory to use the current plugin's version.
path: ../
google_maps_flutter_android: ^2.16.1
google_maps_flutter_platform_interface: ^2.12.1
google_maps_flutter_platform_interface: ^2.14.0

dev_dependencies:
build_runner: ^2.1.10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export 'package:google_maps_flutter_platform_interface/google_maps_flutter_platf
TileOverlay,
TileOverlayId,
TileProvider,
WebCameraControlPosition,
WebGestureHandling,
WeightedLatLng;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ class GoogleMap extends StatefulWidget {
this.onMapCreated,
this.gestureRecognizers = const <Factory<OneSequenceGestureRecognizer>>{},
this.webGestureHandling,
this.webCameraControlPosition,
this.webCameraControlEnabled = true,
this.compassEnabled = true,
this.mapToolbarEnabled = true,
this.cameraTargetBounds = CameraTargetBounds.unbounded,
Expand Down Expand Up @@ -353,6 +355,18 @@ class GoogleMap extends StatefulWidget {
/// 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.
final WebCameraControlPosition? webCameraControlPosition;

/// Enables or disables the Camera controls. Web only.
///
/// See https://developers.google.com/maps/documentation/javascript/controls for more details.
final bool webCameraControlEnabled;

/// Identifier that's associated with a specific cloud-based map style.
///
/// See https://developers.google.com/maps/documentation/get-map-id
Expand Down Expand Up @@ -684,6 +698,8 @@ class _GoogleMapState extends State<GoogleMap> {
/// Builds a [MapConfiguration] from the given [map].
MapConfiguration _configurationFromMapWidget(GoogleMap map) {
return MapConfiguration(
webCameraControlPosition: map.webCameraControlPosition,
webCameraControlEnabled: map.webCameraControlEnabled,
webGestureHandling: map.webGestureHandling,
compassEnabled: map.compassEnabled,
mapToolbarEnabled: map.mapToolbarEnabled,
Expand Down
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.
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
version: 2.12.3
version: 2.13.0

environment:
sdk: ^3.7.0
Expand All @@ -23,8 +23,8 @@ dependencies:
sdk: flutter
google_maps_flutter_android: ^2.16.1
google_maps_flutter_ios: ^2.15.4
google_maps_flutter_platform_interface: ^2.12.1
google_maps_flutter_web: ^0.5.12
google_maps_flutter_platform_interface: ^2.14.0
google_maps_flutter_web: ^0.5.14

dev_dependencies:
flutter_test:
Expand Down