Skip to content

Commit a61103b

Browse files
authored
[google_maps_flutter] Implement polyline patterns in google maps ios (flutter#5757)
This PR Implements patterns in google maps ios polylines. Currently the patterns param is simply ignored on ios, despite the official google maps SDK for ios having instructions on how to achieve repeated patterns: https://developers.google.com/maps/documentation/ios-sdk/shapes#add-a-repeating-color-pattern-to-a-polyline *List which issues are fixed by this PR. You must list at least one issue.* flutter/flutter#60083 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* Nil
1 parent b16a7e3 commit a61103b

File tree

14 files changed

+213
-24
lines changed

14 files changed

+213
-24
lines changed

packages/google_maps_flutter/google_maps_flutter/example/lib/place_polyline.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,10 @@ class PlacePolylineBodyState extends State<PlacePolylineBody> {
291291
child: const Text('change joint type [Android only]'),
292292
),
293293
TextButton(
294-
onPressed: isIOS || (selectedId == null)
294+
onPressed: (selectedId == null)
295295
? null
296296
: () => _changePattern(selectedId),
297-
child: const Text('change pattern [Android only]'),
297+
child: const Text('change pattern'),
298298
),
299299
],
300300
)

packages/google_maps_flutter/google_maps_flutter_android/example/lib/place_polyline.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,10 @@ class PlacePolylineBodyState extends State<PlacePolylineBody> {
292292
child: const Text('change joint type [Android only]'),
293293
),
294294
TextButton(
295-
onPressed: isIOS || (selectedId == null)
295+
onPressed: (selectedId == null)
296296
? null
297297
: () => _changePattern(selectedId),
298-
child: const Text('change pattern [Android only]'),
298+
child: const Text('change pattern'),
299299
),
300300
],
301301
)

packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.6.1
2+
3+
* Adds support for patterns in polylines.
4+
15
## 2.6.0
26

37
* Updates the minimum allowed verison of the Google Maps SDK to 8.4, for privacy

packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcodeproj/project.pbxproj

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@
1111
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1212
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
1313
4510D964F3B1259FEDD3ABA6 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7755F8F4BABC3D6A0BD4048B /* libPods-Runner.a */; };
14+
478116522BEF8F47002F593E /* GoogleMapsPolylinesControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 478116512BEF8F47002F593E /* GoogleMapsPolylinesControllerTests.m */; };
1415
6851F3562835BC180032B7C8 /* FLTGoogleMapJSONConversionsConversionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6851F3552835BC180032B7C8 /* FLTGoogleMapJSONConversionsConversionTests.m */; };
1516
68E4726A2836FF0C00BDDDAC /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 68E472692836FF0C00BDDDAC /* MapKit.framework */; };
1617
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
1718
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
1819
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1920
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
2021
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
21-
F269303B2BB389BF00BF17C4 /* assets in Resources */ = {isa = PBXBuildFile; fileRef = F269303A2BB389BF00BF17C4 /* assets */; };
2222
982F2A6C27BADE17003C81F4 /* PartiallyMockedMapView.m in Sources */ = {isa = PBXBuildFile; fileRef = 982F2A6B27BADE17003C81F4 /* PartiallyMockedMapView.m */; };
23+
F269303B2BB389BF00BF17C4 /* assets in Resources */ = {isa = PBXBuildFile; fileRef = F269303A2BB389BF00BF17C4 /* assets */; };
2324
F7151F13265D7ED70028CB91 /* GoogleMapsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F7151F12265D7ED70028CB91 /* GoogleMapsTests.m */; };
2425
F7151F21265D7EE50028CB91 /* GoogleMapsUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = F7151F20265D7EE50028CB91 /* GoogleMapsUITests.m */; };
2526
FC8F35FC8CD533B128950487 /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F267F68029D1A4E2E4C572A7 /* libPods-RunnerTests.a */; };
@@ -60,6 +61,7 @@
6061
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
6162
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
6263
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
64+
478116512BEF8F47002F593E /* GoogleMapsPolylinesControllerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GoogleMapsPolylinesControllerTests.m; sourceTree = "<group>"; };
6365
6851F3552835BC180032B7C8 /* FLTGoogleMapJSONConversionsConversionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FLTGoogleMapJSONConversionsConversionTests.m; sourceTree = "<group>"; };
6466
68E472692836FF0C00BDDDAC /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/iOSSupport/System/Library/Frameworks/MapKit.framework; sourceTree = DEVELOPER_DIR; };
6567
733AFAB37683A9DA7512F09C /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
@@ -203,6 +205,7 @@
203205
F269303A2BB389BF00BF17C4 /* assets */,
204206
6851F3552835BC180032B7C8 /* FLTGoogleMapJSONConversionsConversionTests.m */,
205207
F7151F12265D7ED70028CB91 /* GoogleMapsTests.m */,
208+
478116512BEF8F47002F593E /* GoogleMapsPolylinesControllerTests.m */,
206209
982F2A6A27BADE17003C81F4 /* PartiallyMockedMapView.h */,
207210
982F2A6B27BADE17003C81F4 /* PartiallyMockedMapView.m */,
208211
F7151F14265D7ED70028CB91 /* Info.plist */,
@@ -467,6 +470,7 @@
467470
F7151F13265D7ED70028CB91 /* GoogleMapsTests.m in Sources */,
468471
6851F3562835BC180032B7C8 /* FLTGoogleMapJSONConversionsConversionTests.m in Sources */,
469472
982F2A6C27BADE17003C81F4 /* PartiallyMockedMapView.m in Sources */,
473+
478116522BEF8F47002F593E /* GoogleMapsPolylinesControllerTests.m in Sources */,
470474
0DD7B6C32B744EEF00E857FD /* FLTTileProviderControllerTests.m in Sources */,
471475
);
472476
runOnlyForDeploymentPostprocessing = 0;

packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/FLTGoogleMapJSONConversionsConversionTests.m

+14
Original file line numberDiff line numberDiff line change
@@ -288,4 +288,18 @@ - (void)testCameraUpdateFromChannelValueZoomTo {
288288
[classMockCameraUpdate stopMocking];
289289
}
290290

291+
- (void)testLengthsFromPatterns {
292+
NSArray<NSArray<id> *> *patterns = @[ @[ @"gap", @10 ], @[ @"dash", @6.4 ] ];
293+
294+
NSArray<NSNumber *> *spanLengths = [FLTGoogleMapJSONConversions spanLengthsFromPatterns:patterns];
295+
296+
XCTAssertEqual([spanLengths count], 2);
297+
298+
NSNumber *firstSpanLength = spanLengths[0];
299+
NSNumber *secondSpanLength = spanLengths[1];
300+
301+
XCTAssertEqual(firstSpanLength.doubleValue, 10);
302+
XCTAssertEqual(secondSpanLength.doubleValue, 6.4);
303+
}
304+
291305
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
@import google_maps_flutter_ios;
6+
@import google_maps_flutter_ios.Test;
7+
@import XCTest;
8+
@import GoogleMaps;
9+
10+
#import <OCMock/OCMock.h>
11+
#import <google_maps_flutter_ios/GoogleMapPolylineController_Test.h>
12+
#import "PartiallyMockedMapView.h"
13+
14+
@interface GoogleMapsPolylinesControllerTests : XCTestCase
15+
@end
16+
17+
@implementation GoogleMapsPolylinesControllerTests
18+
19+
/// Returns GoogleMapPolylineController object instantiated with a mocked map instance
20+
///
21+
/// @return An object of FLTGoogleMapPolylineController
22+
- (FLTGoogleMapPolylineController *)polylineControllerWithMockedMap {
23+
NSDictionary<NSString *, id> *polyline = @{
24+
@"points" : @[
25+
@[ @(52.4816), @(-3.1791) ], @[ @(54.043), @(-2.9925) ], @[ @(54.1396), @(-4.2739) ],
26+
@[ @(53.4153), @(-4.0829) ]
27+
],
28+
@"polylineId" : @"polyline_id_0",
29+
};
30+
31+
CGRect frame = CGRectMake(0, 0, 100, 100);
32+
GMSCameraPosition *camera = [[GMSCameraPosition alloc] initWithLatitude:0 longitude:0 zoom:0];
33+
34+
GMSMapViewOptions *mapViewOptions = [[GMSMapViewOptions alloc] init];
35+
mapViewOptions.frame = frame;
36+
mapViewOptions.camera = camera;
37+
38+
PartiallyMockedMapView *mapView = [[PartiallyMockedMapView alloc] initWithOptions:mapViewOptions];
39+
40+
GMSMutablePath *path = [FLTPolylinesController pathForPolyline:polyline];
41+
NSString *identifier = polyline[@"polylineId"];
42+
43+
FLTGoogleMapPolylineController *polylineControllerWithMockedMap =
44+
[[FLTGoogleMapPolylineController alloc] initPolylineWithPath:path
45+
identifier:identifier
46+
mapView:mapView];
47+
48+
return polylineControllerWithMockedMap;
49+
}
50+
51+
- (void)testSetPatterns {
52+
NSArray<GMSStrokeStyle *> *styles = @[
53+
[GMSStrokeStyle solidColor:[UIColor clearColor]], [GMSStrokeStyle solidColor:[UIColor redColor]]
54+
];
55+
56+
NSArray<NSNumber *> *lengths = @[ @10, @10 ];
57+
58+
FLTGoogleMapPolylineController *polylineController = [self polylineControllerWithMockedMap];
59+
60+
XCTAssertNil(polylineController.polyline.spans);
61+
62+
[polylineController setPattern:styles lengths:lengths];
63+
64+
// `GMSStyleSpan` doesn't implement `isEqual` so cannot be compared by value at present.
65+
XCTAssertNotNil(polylineController.polyline.spans);
66+
}
67+
68+
- (void)testStrokeStylesFromPatterns {
69+
NSArray<NSArray<id> *> *patterns = @[ @[ @"gap", @10 ], @[ @"dash", @10 ] ];
70+
UIColor *strokeColor = [UIColor redColor];
71+
72+
NSArray<GMSStrokeStyle *> *patternStrokeStyle =
73+
[FLTGoogleMapJSONConversions strokeStylesFromPatterns:patterns strokeColor:strokeColor];
74+
75+
XCTAssertEqual([patternStrokeStyle count], 2);
76+
77+
// None of the parameters of `patternStrokeStyle` is observable, so we limit to testing
78+
// the length of this output array.
79+
}
80+
81+
@end

packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/lib/place_polyline.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,10 @@ class PlacePolylineBodyState extends State<PlacePolylineBody> {
292292
child: const Text('change joint type [Android only]'),
293293
),
294294
TextButton(
295-
onPressed: isIOS || (selectedId == null)
295+
onPressed: (selectedId == null)
296296
? null
297297
: () => _changePattern(selectedId),
298-
child: const Text('change pattern [Android only]'),
298+
child: const Text('change pattern'),
299299
),
300300
],
301301
)

packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/FLTGoogleMapJSONConversions.h

+15
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ NS_ASSUME_NONNULL_BEGIN
2525
+ (GMSMapViewType)mapViewTypeFromTypeValue:(NSNumber *)value;
2626
+ (nullable GMSCameraUpdate *)cameraUpdateFromChannelValue:(NSArray *)channelValue;
2727

28+
/// Return GMS strokestyle object array populated using the patterns and stroke colors passed in.
29+
///
30+
/// @param patterns An array of patterns for each stroke in the polyline.
31+
/// @param strokeColor An array of color for each stroke in the polyline.
32+
/// @return An array of GMSStrokeStyle.
33+
+ (NSArray<GMSStrokeStyle *> *)strokeStylesFromPatterns:(NSArray<NSArray<NSObject *> *> *)patterns
34+
strokeColor:(UIColor *)strokeColor;
35+
36+
/// Return GMS strokestyle object array populated using the patterns and stroke colors passed in.
37+
/// Extracts the lengths of each stroke in the polyline from patterns input
38+
///
39+
/// @param patterns An array of object representing the pattern params in the polyline.
40+
/// @return Array of lengths.
41+
+ (NSArray<NSNumber *> *)spanLengthsFromPatterns:(NSArray<NSArray<NSObject *> *> *)patterns;
42+
2843
@end
2944

3045
NS_ASSUME_NONNULL_END

packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/FLTGoogleMapJSONConversions.m

+22
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,26 @@ + (nullable GMSCameraUpdate *)cameraUpdateFromChannelValue:(NSArray *)channelVal
141141
}
142142
return nil;
143143
}
144+
145+
+ (NSArray<GMSStrokeStyle *> *)strokeStylesFromPatterns:(NSArray<NSArray<NSObject *> *> *)patterns
146+
strokeColor:(UIColor *)strokeColor {
147+
NSMutableArray *strokeStyles = [[NSMutableArray alloc] initWithCapacity:[patterns count]];
148+
for (NSArray *pattern in patterns) {
149+
NSString *patternType = pattern[0];
150+
UIColor *color = [patternType isEqualToString:@"gap"] ? [UIColor clearColor] : strokeColor;
151+
[strokeStyles addObject:[GMSStrokeStyle solidColor:color]];
152+
}
153+
154+
return strokeStyles;
155+
}
156+
157+
+ (NSArray<NSNumber *> *)spanLengthsFromPatterns:(NSArray<NSArray<NSObject *> *> *)patterns {
158+
NSMutableArray *lengths = [[NSMutableArray alloc] initWithCapacity:[patterns count]];
159+
for (NSArray *pattern in patterns) {
160+
NSNumber *length = [pattern count] > 1 ? pattern[1] : @0;
161+
[lengths addObject:length];
162+
}
163+
164+
return lengths;
165+
}
144166
@end

packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapPolylineController.h

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
identifier:(NSString *)identifier
1212
mapView:(GMSMapView *)mapView;
1313
- (void)removePolyline;
14+
15+
/// Sets the pattern on polyline controller
16+
///
17+
/// @param styles The styles for repeating pattern sections.
18+
/// @param lengths The lengths for repeating pattern sections.
19+
- (void)setPattern:(NSArray<GMSStrokeStyle *> *)styles lengths:(NSArray<NSNumber *> *)lengths;
1420
@end
1521

1622
@interface FLTPolylinesController : NSObject

packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapPolylineController.m

+34-16
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ @interface FLTGoogleMapPolylineController ()
1212

1313
@end
1414

15+
/// Returns dict[key], or nil if dict[key] is NSNull.
16+
static id GetValueOrNilFromDict(NSDictionary *dict, NSString *key) {
17+
id value = dict[key];
18+
return value == [NSNull null] ? nil : value;
19+
}
20+
1521
@implementation FLTGoogleMapPolylineController
1622

1723
- (instancetype)initPolylineWithPath:(GMSMutablePath *)path
@@ -59,42 +65,54 @@ - (void)setGeodesic:(BOOL)isGeodesic {
5965
self.polyline.geodesic = isGeodesic;
6066
}
6167

68+
- (void)setPattern:(NSArray<GMSStrokeStyle *> *)styles lengths:(NSArray<NSNumber *> *)lengths {
69+
self.polyline.spans = GMSStyleSpans(self.polyline.path, styles, lengths, kGMSLengthRhumb);
70+
}
71+
6272
- (void)interpretPolylineOptions:(NSDictionary *)data
6373
registrar:(NSObject<FlutterPluginRegistrar> *)registrar {
64-
NSNumber *consumeTapEvents = data[@"consumeTapEvents"];
65-
if (consumeTapEvents && consumeTapEvents != (id)[NSNull null]) {
74+
NSNumber *consumeTapEvents = GetValueOrNilFromDict(data, @"consumeTapEvents");
75+
if (consumeTapEvents) {
6676
[self setConsumeTapEvents:[consumeTapEvents boolValue]];
6777
}
6878

69-
NSNumber *visible = data[@"visible"];
70-
if (visible && visible != (id)[NSNull null]) {
79+
NSNumber *visible = GetValueOrNilFromDict(data, @"visible");
80+
if (visible) {
7181
[self setVisible:[visible boolValue]];
7282
}
7383

74-
NSNumber *zIndex = data[@"zIndex"];
75-
if (zIndex && zIndex != (id)[NSNull null]) {
84+
NSNumber *zIndex = GetValueOrNilFromDict(data, @"zIndex");
85+
if (zIndex) {
7686
[self setZIndex:[zIndex intValue]];
7787
}
7888

79-
NSArray *points = data[@"points"];
80-
if (points && points != (id)[NSNull null]) {
89+
NSArray *points = GetValueOrNilFromDict(data, @"points");
90+
if (points) {
8191
[self setPoints:[FLTGoogleMapJSONConversions pointsFromLatLongs:points]];
8292
}
8393

84-
NSNumber *strokeColor = data[@"color"];
85-
if (strokeColor && strokeColor != (id)[NSNull null]) {
94+
NSNumber *strokeColor = GetValueOrNilFromDict(data, @"color");
95+
if (strokeColor) {
8696
[self setColor:[FLTGoogleMapJSONConversions colorFromRGBA:strokeColor]];
8797
}
8898

89-
NSNumber *strokeWidth = data[@"width"];
90-
if (strokeWidth && strokeWidth != (id)[NSNull null]) {
99+
NSNumber *strokeWidth = GetValueOrNilFromDict(data, @"width");
100+
if (strokeWidth) {
91101
[self setStrokeWidth:[strokeWidth intValue]];
92102
}
93103

94-
NSNumber *geodesic = data[@"geodesic"];
95-
if (geodesic && geodesic != (id)[NSNull null]) {
104+
NSNumber *geodesic = GetValueOrNilFromDict(data, @"geodesic");
105+
if (geodesic) {
96106
[self setGeodesic:geodesic.boolValue];
97107
}
108+
109+
NSArray *patterns = GetValueOrNilFromDict(data, @"pattern");
110+
if (patterns) {
111+
[self
112+
setPattern:[FLTGoogleMapJSONConversions strokeStylesFromPatterns:patterns
113+
strokeColor:self.polyline.strokeColor]
114+
lengths:[FLTGoogleMapJSONConversions spanLengthsFromPatterns:patterns]];
115+
}
98116
}
99117

100118
@end
@@ -125,7 +143,7 @@ - (instancetype)init:(FlutterMethodChannel *)methodChannel
125143
}
126144
- (void)addPolylines:(NSArray *)polylinesToAdd {
127145
for (NSDictionary *polyline in polylinesToAdd) {
128-
GMSMutablePath *path = [FLTPolylinesController getPath:polyline];
146+
GMSMutablePath *path = [FLTPolylinesController pathForPolyline:polyline];
129147
NSString *identifier = polyline[@"polylineId"];
130148
FLTGoogleMapPolylineController *controller =
131149
[[FLTGoogleMapPolylineController alloc] initPolylineWithPath:path
@@ -171,7 +189,7 @@ - (bool)hasPolylineWithIdentifier:(NSString *)identifier {
171189
}
172190
return self.polylineIdentifierToController[identifier] != nil;
173191
}
174-
+ (GMSMutablePath *)getPath:(NSDictionary *)polyline {
192+
+ (GMSMutablePath *)pathForPolyline:(NSDictionary *)polyline {
175193
NSArray *pointArray = polyline[@"points"];
176194
NSArray<CLLocation *> *points = [FLTGoogleMapJSONConversions pointsFromLatLongs:pointArray];
177195
GMSMutablePath *path = [GMSMutablePath path];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#import "GoogleMapPolylineController.h"
6+
7+
/// Internal APIs exposed for unit testing
8+
@interface FLTGoogleMapPolylineController (Test)
9+
10+
/// Polyline instance the controller is attached to
11+
@property(strong, nonatomic) GMSPolyline *polyline;
12+
13+
@end
14+
15+
/// Internal APIs explosed for unit testing
16+
@interface FLTPolylinesController (Test)
17+
18+
/// Returns the path for polyline based on the points(locations) the polyline has.
19+
///
20+
/// @param polyline The polyline instance for which path is calculated.
21+
/// @return An instance of GMSMutablePath.
22+
+ (GMSMutablePath *)pathForPolyline:(NSDictionary *)polyline;
23+
24+
@end

packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/google_maps_flutter_ios-umbrella.h

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#import <google_maps_flutter_ios/FLTGoogleMapJSONConversions.h>
77
#import <google_maps_flutter_ios/FLTGoogleMapTileOverlayController.h>
88
#import <google_maps_flutter_ios/FLTGoogleMapsPlugin.h>
9+
#import <google_maps_flutter_ios/GoogleMapPolylineController_Test.h>
910

1011
FOUNDATION_EXPORT double google_maps_flutterVersionNumber;
1112
FOUNDATION_EXPORT const unsigned char google_maps_flutterVersionString[];

packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: google_maps_flutter_ios
22
description: iOS implementation of the google_maps_flutter plugin.
33
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_ios
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
5-
version: 2.6.0
5+
version: 2.6.1
66

77
environment:
88
sdk: ^3.2.3

0 commit comments

Comments
 (0)