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

[google_maps_flutter] Geodesic Polyline support in iOS #2596

Closed
wants to merge 6 commits into from
Closed
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 @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -178,4 +182,9 @@ + (GMSMutablePath*)getPath:(NSDictionary*)polyline {
+ (NSString*)getPolylineId:(NSDictionary*)polyline {
return polyline[@"polylineId"];
}

+ (NSNumber *)isGeodesic:(NSDictionary*)polyline {
return polyline[@"geodesic"];
}

@end
Original file line number Diff line number Diff line change
@@ -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:
Expand Down