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

Geodesic Polyline support in iOS #2964

Merged
merged 11 commits into from
Sep 1, 2020
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.31

* Geodesic Polyline support for iOS

## 0.5.30

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

## 0.0.2

* Initial developers preview release.
* Initial developers preview release.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- (void)setStrokeWidth:(CGFloat)width;
- (void)setPoints:(NSArray<CLLocation*>*)points;
- (void)setZIndex:(int)zIndex;
- (void)setGeodesic:(BOOL)isGeodesic;
@end

// Defines polyline controllable by Flutter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ - (void)setColor:(UIColor*)color {
- (void)setStrokeWidth:(CGFloat)width {
_polyline.strokeWidth = width;
}

- (void)setGeodesic:(BOOL)isGeodesic {
_polyline.geodesic = isGeodesic;
}
@end

static int ToInt(NSNumber* data) { return [FLTGoogleMapJsonConversions toInt:data]; }
Expand Down Expand Up @@ -95,6 +99,11 @@ static void InterpretPolylineOptions(NSDictionary* data, id<FLTGoogleMapPolyline
if (strokeWidth != nil) {
[sink setStrokeWidth:ToInt(strokeWidth)];
}

NSNumber* geodesic = data[@"geodesic"];
if (geodesic != nil) {
[sink setGeodesic:geodesic.boolValue];
}
}

@implementation FLTPolylinesController {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: google_maps_flutter
description: A Flutter plugin for integrating Google Maps in iOS and Android applications.
homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter
version: 0.5.30
version: 0.5.31

dependencies:
flutter:
Expand Down