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 @@
## 2.5.2

* Fixes the tile overlay not correctly displaying on physical ios devices.

## 2.5.1

* Makes the tile overlay callback invoke the platform channel on the platform thread.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
982F2A6C27BADE17003C81F4 /* PartiallyMockedMapView.m in Sources */ = {isa = PBXBuildFile; fileRef = 982F2A6B27BADE17003C81F4 /* PartiallyMockedMapView.m */; };
F269303B2BB389BF00BF17C4 /* assets in Resources */ = {isa = PBXBuildFile; fileRef = F269303A2BB389BF00BF17C4 /* assets */; };
F7151F13265D7ED70028CB91 /* GoogleMapsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F7151F12265D7ED70028CB91 /* GoogleMapsTests.m */; };
FC8F35FC8CD533B128950487 /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F267F68029D1A4E2E4C572A7 /* libPods-RunnerTests.a */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -68,6 +69,7 @@
E52C6A6210A56F027C582EF9 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
EA0E91726245EDC22B97E8B9 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
F267F68029D1A4E2E4C572A7 /* libPods-RunnerTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RunnerTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
F269303A2BB389BF00BF17C4 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; path = assets; sourceTree = "<group>"; };
F7151F10265D7ED70028CB91 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
F7151F12265D7ED70028CB91 /* GoogleMapsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GoogleMapsTests.m; sourceTree = "<group>"; };
F7151F14265D7ED70028CB91 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -174,6 +176,7 @@
F7151F11265D7ED70028CB91 /* RunnerTests */ = {
isa = PBXGroup;
children = (
F269303A2BB389BF00BF17C4 /* assets */,
F7151F12265D7ED70028CB91 /* GoogleMapsTests.m */,
982F2A6A27BADE17003C81F4 /* PartiallyMockedMapView.h */,
982F2A6B27BADE17003C81F4 /* PartiallyMockedMapView.m */,
Expand Down Expand Up @@ -232,6 +235,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1530;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "The Flutter Authors";
TargetAttributes = {
Expand Down Expand Up @@ -280,6 +284,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F269303B2BB389BF00BF17C4 /* assets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -596,6 +601,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "i386 arm64";
INFOPLIST_FILE = RunnerTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ @interface FLTGoogleMapFactory (Test)
@interface GoogleMapsTests : XCTestCase
@end

@interface FLTTileProviderController (Testing)
- (UIImage *)handleResultTile:(nullable UIImage *)tileImage;
@end

@implementation GoogleMapsTests

- (void)testPlugin {
Expand Down Expand Up @@ -62,4 +66,23 @@ - (void)testMapsServiceSync {
XCTAssertEqual(factory1.sharedMapServices, factory2.sharedMapServices);
}

- (void)testHandleResultTileDownsamplesWideGamutImages {
FLTTileProviderController *controller = [[FLTTileProviderController alloc] init];

NSString *imagePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"widegamut"
ofType:@"png"
inDirectory:@"assets"];
UIImage *wideGamutImage = [UIImage imageWithContentsOfFile:imagePath];

XCTAssertNotNil(wideGamutImage, @"The image should be loaded.");

UIImage *downsampledImage = [controller handleResultTile:wideGamutImage];

CGImageRef imageRef = downsampledImage.CGImage;
size_t bitsPerComponent = CGImageGetBitsPerComponent(imageRef);

// non wide gamut images use 8 bit format
XCTAssert(bitsPerComponent == 8);
}

@end
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,29 @@ - (instancetype)init:(FlutterMethodChannel *)methodChannel

#pragma mark - GMSTileLayer method

- (UIImage *)handleResultTile:(nullable UIImage *)tile {
CGImageRef imageRef = tile.CGImage;
CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef);
BOOL isFloat = bitmapInfo && kCGBitmapFloatComponents;
size_t bitsPerComponent = CGImageGetBitsPerComponent(imageRef);

// Engine use f16 pixel format for wide gamut images
// If it is wide gamut, we want to downsample it
if (isFloat & (bitsPerComponent == 16)) {
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(nil, tile.size.width, tile.size.height, 8, 0,
colorSpace, kCGImageAlphaPremultipliedLast);
CGContextDrawImage(context, CGRectMake(0, 0, tile.size.width, tile.size.height), tile.CGImage);
CGImageRef image = CGBitmapContextCreateImage(context);
tile = [UIImage imageWithCGImage:image];

CGImageRelease(image);
CGContextRelease(context);
CGColorSpaceRelease(colorSpace);
}
return tile;
}

- (void)requestTileForX:(NSUInteger)x
y:(NSUInteger)y
zoom:(NSUInteger)zoom
Expand All @@ -137,7 +160,7 @@ - (void)requestTileForX:(NSUInteger)x
if (typedData == nil) {
tileImage = kGMSTileLayerNoTile;
} else {
tileImage = [UIImage imageWithData:typedData.data];
tileImage = [self handleResultTile:[UIImage imageWithData:typedData.data]];
}
} else {
if ([result isKindOfClass:[FlutterError class]]) {
Expand All @@ -150,7 +173,6 @@ - (void)requestTileForX:(NSUInteger)x
}
tileImage = kGMSTileLayerNoTile;
}

[receiver receiveTileWithX:x y:y zoom:zoom image:tileImage];
}];
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: google_maps_flutter_ios
description: iOS implementation of the google_maps_flutter plugin.
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_ios
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
version: 2.5.1
version: 2.5.2

environment:
sdk: ^3.2.3
Expand Down