Skip to content

Commit 9a41270

Browse files
authored
BitmapDescriptor#fromBytes should be consistent across platforms (flutter#1489)
- Android Bitmaps scale images to account for dpi. - iOS UIImages do not, we need to account for that.
1 parent 434b9fc commit 9a41270

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

packages/google_maps_flutter/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.5.9
2+
3+
* BitmapDescriptor#fromBytes accounts for screen scale on ios.
4+
15
## 0.5.8
26

37
* Remove some unused variables and rename method

packages/google_maps_flutter/ios/Classes/GoogleMapMarkerController.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ static void InterpretInfoWindow(id<FLTGoogleMapMarkerOptionsSink> sink, NSDictio
199199
if (iconData.count == 2) {
200200
@try {
201201
FlutterStandardTypedData* byteData = iconData[1];
202-
image = [UIImage imageWithData:[byteData data]];
202+
CGFloat screenScale = [[UIScreen mainScreen] scale];
203+
image = [UIImage imageWithData:[byteData data] scale:screenScale];
203204
} @catch (NSException* exception) {
204205
@throw [NSException exceptionWithName:@"InvalidByteDescriptor"
205206
reason:@"Unable to interpret bytes as a valid image."

packages/google_maps_flutter/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: google_maps_flutter
22
description: A Flutter plugin for integrating Google Maps in iOS and Android applications.
33
author: Flutter Team <[email protected]>
44
homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter
5-
version: 0.5.8
5+
version: 0.5.9
66

77
dependencies:
88
flutter:

0 commit comments

Comments
 (0)