From 8741b2ec86f4f15c95c0bf1241bcb711a6061856 Mon Sep 17 00:00:00 2001 From: Raees Date: Tue, 10 Mar 2020 18:05:42 +0300 Subject: [PATCH 1/4] set geodesic property coming from platform channel args to GMSPolyline obj-c instance --- .../google_maps_flutter/google_maps_flutter/CHANGELOG.md | 3 +++ .../ios/Classes/GoogleMapPolylineController.h | 1 + .../ios/Classes/GoogleMapPolylineController.m | 8 ++++++++ .../google_maps_flutter/google_maps_flutter/pubspec.yaml | 2 +- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index f90a2517bd75..1deedf561681 100644 --- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.5.25 +Geodesic Polyline support for iOS + ## 0.5.24+1 * Make the pedantic dev_dependency explicit. diff --git a/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.h b/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.h index a5977bf75e1e..2c9993e47349 100644 --- a/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.h +++ b/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.h @@ -20,6 +20,7 @@ @property(atomic, readonly) NSString* polylineId; - (instancetype)initPolylineWithPath:(GMSMutablePath*)path polylineId:(NSString*)polylineId + geodesic:(BOOL)geodesic mapView:(GMSMapView*)mapView; - (void)removePolyline; @end diff --git a/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m b/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m index b701a5f3a6b5..029e96f09043 100644 --- a/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m +++ b/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m @@ -11,10 +11,12 @@ @implementation FLTGoogleMapPolylineController { } - (instancetype)initPolylineWithPath:(GMSMutablePath*)path polylineId:(NSString*)polylineId + geodesic:(BOOL)geodesic mapView:(GMSMapView*)mapView { self = [super init]; if (self) { _polyline = [GMSPolyline polylineWithPath:path]; + _polyline.geodesic = geodesic; _mapView = mapView; _polylineId = polylineId; _polyline.userData = @[ polylineId ]; @@ -119,9 +121,11 @@ - (void)addPolylines:(NSArray*)polylinesToAdd { for (NSDictionary* polyline in polylinesToAdd) { GMSMutablePath* path = [FLTPolylinesController getPath:polyline]; NSString* polylineId = [FLTPolylinesController getPolylineId:polyline]; + NSNumber* geodisc = [FLTPolylinesController isGeodesic:polyline]; FLTGoogleMapPolylineController* controller = [[FLTGoogleMapPolylineController alloc] initPolylineWithPath:path polylineId:polylineId + geodesic:geodisc.boolValue mapView:_mapView]; InterpretPolylineOptions(polyline, controller, _registrar); _polylineIdToController[polylineId] = controller; @@ -178,4 +182,8 @@ + (GMSMutablePath*)getPath:(NSDictionary*)polyline { + (NSString*)getPolylineId:(NSDictionary*)polyline { return polyline[@"polylineId"]; } + ++ (NSNumber *)isGeodesic:(NSDictionary*)polyline { + return polyline[@"geodesic"]; +} @end diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml index 5ff3e3f22288..e6dfb6bea412 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -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.24+1 +version: 0.5.25 dependencies: flutter: From 166ec3a65366ac4d6aa1d273245f3a9aa992deab Mon Sep 17 00:00:00 2001 From: Raees Date: Tue, 10 Mar 2020 19:33:26 +0300 Subject: [PATCH 2/4] set geodesic property coming from platform channel args to GMSPolyline obj-c instance --- .../ios/Classes/GoogleMapPolylineController.m | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m b/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m index 029e96f09043..995df3be74cf 100644 --- a/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m +++ b/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m @@ -186,4 +186,5 @@ + (NSString*)getPolylineId:(NSDictionary*)polyline { + (NSNumber *)isGeodesic:(NSDictionary*)polyline { return polyline[@"geodesic"]; } + @end From 7954aaec22770a0d2f9def562a5a72c8e2b9dd76 Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Mon, 24 Aug 2020 17:17:01 -0700 Subject: [PATCH 3/4] Update pubspec.yaml --- packages/google_maps_flutter/google_maps_flutter/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml index a3a6a7a6b456..0a506097d723 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -2,7 +2,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: From 87655a053986b14afa793b000d519b96aee6cd5f Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Mon, 24 Aug 2020 17:17:20 -0700 Subject: [PATCH 4/4] Update CHANGELOG.md --- packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index e058e9dfd544..0476f8c9a744 100644 --- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.5.30+1 +## 0.5.31 * Geodesic Polyline support for iOS @@ -416,4 +416,4 @@ ## 0.0.2 -* Initial developers preview release. \ No newline at end of file +* Initial developers preview release.