I’m using mapbox and I’m trying to send my bounding box coordinates to an api using JavaScript. My existing code go do this is here:
var ne = map.getBounds().getNorthEast();
var sw = map.getBounds().getSouthWest();
getGrid(ne, sw);
This is documented here:
https://docs.mapbox.com/mapbox.js/api/v3.3.1/l-latlng/
However this sends it as follows:
var ne = LngLat(-0.19424453896019145, 51.52165574100269)
var sw = LngLat(-0.19708728301148426, 51.52033324794837)
However I don’t want to be sending the brackets or LngLat to my api in the url, i instead want to send something more clean like this:
var sw = -0.19708728301148426, 51.52033324794837
How can I do that? Is there a way to clean this up in JS, or better yet just get only the coordinates returned in the first place?