如何检索数据数组 arrMyLatLng 函数。db.transaction(queryDB, errorCB);
function queryDB(tx)
{
tx.executeSql('SELECT * FROM Attractions', [], querySuccess, errorCB);
}
function querySuccess(tx, results)
{
var arrMyLatLng = [];
var len = results.rows.length;
var arrLatitude=[], arrLongitude=[];
for (var i=0; i<len; i++)
{
arrLatitude[i] = results.rows.item(i).latitude;
arrLongitude[i] = results.rows.item(i).longitude;
arrMyLatLng[i] = new google.maps.LatLng(arrLatitude[i], arrLongitude[i]);
}
return arrMyLatLng ; // Need this array to manipulate the data from it is outside of the function.
}
谢谢