I have an output array from my controller like this :
[
["48.85585695936588,2.317734961729684"],
["48.87234429654349,2.351466422300973"],
["48.85376742273335,2.3639977028185513"]
]
I want to create a polygon from this coordinates, so this data structure (array) :
This is my code :
for(var j = 0; j < output.length; j++) {
var points = [];
var quart = JSON.parse(output[j]['polygon']);
for (var i = 0; i < quart.length; i = i+2) {
points.push({
lat: parseFloat(quart[i]),
lng: parseFloat(quart[i+1])
});
}
I can't get the value of the longitude (the one after the comma)...
Thank you.