Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get length of a polyline #117

Open
BryanBerger98 opened this issue Nov 11, 2021 · 0 comments
Open

Get length of a polyline #117

BryanBerger98 opened this issue Nov 11, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@BryanBerger98
Copy link

Is your feature request related to a problem? Please describe.
I miss a feature to achieve my Ionic application: get the length (in meters) of a drawn polyline.
After a lot of research, I didn't find a way to do it but using iOS SDK (which I don't know use yet because I don't know swift).

Does this feature exist in the Google Maps SDK for android and iOS? Please link the documentation for this feature.
In JavaScript, Google gives us a function from geometry API which look like this:

pathWaypoints: LatLng[] = [];
google.maps.geometry.spherical.computeLength(pathWaypoints);

I know that it is totally different with Swift so I think it could help to get a look at this: https://developers.google.com/maps/documentation/ios-sdk/reference/group___length_kind?hl=en

Describe the solution you'd like
Maybe you could give the distance inside de .then callback after creating a new polyline ? Like this:

CapacitorGoogleMaps.addPolyline(options)
.then(value => {
// value.distance => shows the distance in meters
})

Additional context
I tried many others native dependencies but a lot of them are deprecated or not up to date for a while.

@BryanBerger98 BryanBerger98 added the enhancement New feature or request label Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant