I had developed a google map function in which on call a google map is drawn according to the data is passed
Example:
function DrawMap(data){
//code to draw google map
}
data was passed in following format
['Bondi Beach', -33.890542, 151.274856],
But data was came from php so by default i am sending data like
var defaultLocation = [
<?php
foreach ($db_data as $mvalue) {
echo "[ '".$mvalue['vTripStatus']."',".$mvalue['vLatitude'].",".$mvalue['vLongitude']." ],";
}
?>
];
But i have made an event on click of button which performs an ajax call so in ajax the data was returned as string in following format (when i console.log())
[[ 'Active',23.0123022,72.5033961 ],[ 'Arrived',23.0088,72.4823 ],[ 'On Going Trip',22.9938,72.4713 ], ]
so this format isnt accepted by google map so it do not load the map.
i tried $.parseJSON and JSON.parse() too So how i can convert it like