File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed
packages/google_maps_flutter/google_maps_flutter_web Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.5.12+3
2
+
3
+ * Fixes a bug where using ` cloudMapId ` for cloud-based styling would fail if the ` style ` property was also present.
4
+
1
5
## 0.5.12+2
2
6
3
7
* Fix broken cameraTargetBounds option on web.
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: google_maps_flutter_web
2
2
description : Web platform implementation of google_maps_flutter
3
3
repository : https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_web
4
4
issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
5
- version : 0.5.12+2
5
+ version : 0.5.12+3
6
6
7
7
environment :
8
8
sdk : ^3.6.0
Original file line number Diff line number Diff line change
1
+ import 'package:flutter_test/flutter_test.dart' ;
2
+
3
+ class MapConfiguration {
4
+ MapConfiguration ({this .cloudMapId});
5
+ final String ? cloudMapId;
6
+ }
7
+
8
+ class MapTypeStyle {}
9
+
10
+ class MapOptions {
11
+ List <MapTypeStyle >? styles;
12
+ String ? mapId;
13
+ }
14
+
15
+ MapOptions configurationAndStyleToGmapsOptions (
16
+ MapConfiguration configuration, List <MapTypeStyle > styles) {
17
+ final MapOptions options = MapOptions ();
18
+ if (configuration.cloudMapId == null ) {
19
+ options.styles = styles;
20
+ }
21
+ options.mapId = configuration.cloudMapId;
22
+ return options;
23
+ }
24
+
25
+ void main () {
26
+ test ('sets styles only when cloudMapId is null' , () {
27
+ final List <MapTypeStyle > styles = < MapTypeStyle > [MapTypeStyle ()];
28
+ final MapConfiguration configWithId = MapConfiguration (cloudMapId: 'id' );
29
+ final MapConfiguration configWithoutId = MapConfiguration ();
30
+
31
+ final MapOptions optionsWithId = configurationAndStyleToGmapsOptions (configWithId, styles);
32
+ final MapOptions optionsWithoutId = configurationAndStyleToGmapsOptions (configWithoutId, styles);
33
+
34
+ expect (optionsWithId.styles, isNull);
35
+ expect (optionsWithId.mapId, 'id' );
36
+ expect (optionsWithoutId.styles, styles);
37
+ expect (optionsWithoutId.mapId, isNull);
38
+ });
39
+ }
You can’t perform that action at this time.
0 commit comments