diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index 02b257d6b168..0476f8c9a744 100644 --- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md @@ -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. @@ -412,4 +416,4 @@ ## 0.0.2 -* Initial developers preview release. \ No newline at end of file +* Initial developers preview release. 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..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 @@ -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,9 @@ + (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 e7e3aeeb3327..0a506097d723 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -1,7 +1,8 @@ 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: