I'm using Leaflet API. I'm using the Leaflet Draw plugin to select areas on the map. I need to set up a bounding box using leaflet draw to send to GeoServer.
The problem is when I use the following code:
var coords = the_layer.getLatLngs();
I get the coordinates back like this:
LatLng(43.13306, -112.71973),LatLng(45.02695, -112.71973),LatLng(45.02695, -106.3916),LatLng(43.13306, -106.3916)
I need them back in this format (minx,miny,maxx,maxy):
So I need all of the non-numeric characters (excluding the commas) removed. I also need all spaces removed.
Is this possible?