I am trying to parse stored items of an Array which contains Coordinates of Drawing shapes on the map as into JSON Object/String:
var polys =[];
google.maps.event.addListener(drawingManager, 'polygoncomplete', function (polygon) {
coordinates = (polygon.getPath().getArray());
polys.push(coordinates);
});
I used this loop to convert the array to JSON data:
var info = [];
for(var i = 0; i < polys.length; i++){
info.push({
"type":"POL",
"id": i,
"geometry": polys[i]
});
}
every thing fine but at result I am getting a "d" and "e" keys for the coordinates as:
[
{
"type":"POL",
"id":0,
"geometry":[
{
"d":49.26870064827097,
"e":-122.89237976074219
},
{
"d":49.25436113302859,
"e":-122.9092025756836
},
{
"d":49.24965507167121,
"e":-122.88551330566406
}
]
},
Can you please let me know why this is happening? Since I am going to load the JSON data into MYSQL database, do you think this is a good approch to continue?