capacitor-community / capacitor-community/google-maps
Get length of a polyline
- Dominant language
- Java
- Stars
- 161
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Description
**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:
```typescript
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:
```typescript
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.
Contributor guide
Assessment
This issue has not been assessed yet.