-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Geodesic Polyline support in iOS #2964
Geodesic Polyline support in iOS #2964
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format
tests are failing, do you mind taking a look at them and fixing the formatting of your obj-c code?
packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m
Outdated
Show resolved
Hide resolved
@ditman Yes. corrected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took another look at this change, and I think this cannot be merge it as is, sorry it took me a while to notice!
I think you need to remove the geodesic
property from the polyline constructor(s) and set the geodesic property of the polyline in the InterpretPolylineOptions
static method here, similarly to how visible
is being handled.
This change will make it work when adding a Polyline but also would allow your code to toggle geodesic on/off on polylines that are already created.
Can you re-implement this following the same pattern as the "visible" attribute of the polyline? (there's a setVisible
method, the InterpretPolylineOptions
can handle changes to visible
, etc...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, this is so much simpler now, thank you very much!
Can you rename "GeoDesic" / "geoDesic" to "Geodesic" / "geodesic"?
Other than that, this is great now!
packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.h
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one test failing, but it's because this branch hasn't been fully updated with master since last night. I'll merge this right away.
Thanks for your contribution!
This has been tagged and published to |
Description
Polylines in iOS are not curved based on the earth's curvature even if we set geodesic true in flutter dart code. This is because this property passed to the plugin native code isn't used. I have set this property after GMSPolyline Objc instance created
Related Issues
flutter/flutter#49189
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?