Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit ae806de

Browse files
authored
[google_maps_flutter] Geodesic Polyline support in iOS (#2964)
1 parent 90924b5 commit ae806de

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.5.31
2+
3+
* Geodesic Polyline support for iOS
4+
15
## 0.5.30
26

37
* Add a `dispose` method to the controller to let the native side know that we're done with said controller.
@@ -412,4 +416,4 @@
412416

413417
## 0.0.2
414418

415-
* Initial developers preview release.
419+
* Initial developers preview release.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- (void)setStrokeWidth:(CGFloat)width;
1414
- (void)setPoints:(NSArray<CLLocation*>*)points;
1515
- (void)setZIndex:(int)zIndex;
16+
- (void)setGeodesic:(BOOL)isGeodesic;
1617
@end
1718

1819
// Defines polyline controllable by Flutter.

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ - (void)setColor:(UIColor*)color {
5252
- (void)setStrokeWidth:(CGFloat)width {
5353
_polyline.strokeWidth = width;
5454
}
55+
56+
- (void)setGeodesic:(BOOL)isGeodesic {
57+
_polyline.geodesic = isGeodesic;
58+
}
5559
@end
5660

5761
static int ToInt(NSNumber* data) { return [FLTGoogleMapJsonConversions toInt:data]; }
@@ -95,6 +99,11 @@ static void InterpretPolylineOptions(NSDictionary* data, id<FLTGoogleMapPolyline
9599
if (strokeWidth != nil) {
96100
[sink setStrokeWidth:ToInt(strokeWidth)];
97101
}
102+
103+
NSNumber* geodesic = data[@"geodesic"];
104+
if (geodesic != nil) {
105+
[sink setGeodesic:geodesic.boolValue];
106+
}
98107
}
99108

100109
@implementation FLTPolylinesController {

packages/google_maps_flutter/google_maps_flutter/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: google_maps_flutter
22
description: A Flutter plugin for integrating Google Maps in iOS and Android applications.
33
homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter
4-
version: 0.5.30
4+
version: 0.5.31
55

66
dependencies:
77
flutter:

0 commit comments

Comments
 (0)