Skip to content

Commit 66c9d9f

Browse files
committed
Docs: Update version and CHANGELOG for style fix
1 parent 65b6183 commit 66c9d9f

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
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+
15
## 0.5.12+2
26

37
* Fix broken cameraTargetBounds option on web.

packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: google_maps_flutter_web
22
description: Web platform implementation of google_maps_flutter
33
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_web
44
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
66

77
environment:
88
sdk: ^3.6.0
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
}

0 commit comments

Comments
 (0)