Trying to pass coordinates from BackgroundGeolocation.getLocations() is causing an issue. Upon passing the coordinates, I encounter the following error message: JSON value '-122.02235491' of type NSNumber cannot be converted to NSDictionary
I have attempted to consult the Polyline documentation but am struggling to identify what changes are needed in my coordArray for it to be accepted by Polyline.
The structure of the location variable is outlined here: https://transistorsoft.github.io/cordova-background-geolocation-lt/interfaces/cordova_background_geolocation_lt.location.html
Thank you in advance!
if(this.state.locations && this.state.locations.length > 0){
this.state.locations.map((location,index) => {
console.log(this.state.locations)
let coordArray = [latitude = parseFloat(location.coords.latitude), longitude= parseFloat(location.coords.longitude)]
polyline.push(<Polyline key={index} initialRegion={initialRegion} coordinates={coordArray} geodesic />)
})
}