Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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,3 +1,7 @@
## 0.5.14+3

* Replaces uses of deprecated `Color` properties.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The changelog entry is a bit incomplete. It should also mention the replacement of the deprecated cloudMapId property to fully capture the changes in this PR.

Suggested change
* Replaces uses of deprecated `Color` properties.
* Replaces uses of deprecated `Color` properties and `cloudMapId`.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion!


## 0.5.14+2

* Fixes a bug where using `cloudMapId` for cloud-based styling would fail if the `style` property was also present.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ void main() {
mapConfiguration: const MapConfiguration(
mapType: MapType.satellite,
zoomControlsEnabled: true,
cloudMapId: _kCloudMapId,
mapId: _kCloudMapId,
fortyFiveDegreeImageryEnabled: false,
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,20 @@ final Map<int, String> _bitmapBlobUrlCache = <int, String>{};

// Converts a [Color] into a valid CSS value #RRGGBB.
String _getCssColor(Color color) {
return '#${color.value.toRadixString(16).padLeft(8, '0').substring(2)}';
return '#${color.toARGB32().toRadixString(16).padLeft(8, '0').substring(2)}';
}

// Extracts the opacity from a [Color].
double _getCssOpacity(Color color) {
return color.opacity;
return color.a;
}

// Converts a [Color] into a valid CSS value rgba(R, G, B, A).
String _getCssColorWithAlpha(Color color) {
return 'rgba(${color.red}, ${color.green}, ${color.blue}, ${(color.alpha / 255).toStringAsFixed(2)})';
return 'rgba(${(color.r * 255.0).round().clamp(0, 255)}, '
'${(color.g * 255.0).round().clamp(0, 255)}, '
'${(color.b * 255.0).round().clamp(0, 255)}, '
'${color.a.toStringAsFixed(2)})';
}

// Converts options from the plugin into gmaps.MapOptions that can be used by the JS SDK.
Expand Down Expand Up @@ -122,11 +125,11 @@ gmaps.MapOptions _configurationAndStyleToGmapsOptions(
options.streetViewControl = false;

// If using cloud map, do not set options.styles
if (configuration.cloudMapId == null) {
if (configuration.mapId == null) {
options.styles = styles;
}

options.mapId = configuration.cloudMapId;
options.mapId = configuration.mapId;

return options;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: google_maps_flutter_web
description: Web platform implementation of google_maps_flutter
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_web
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
version: 0.5.14+2
version: 0.5.14+3

environment:
sdk: ^3.7.0
Expand Down