0
我正在查詢緯度和經度值的數據庫,並希望以對象的形式返回數據。每個對象都應該有一個stName(狀態名稱)和stPoint(經度和緯度點數組,應該將每個記錄壓入數組)。 然後應將整個對象推入數組stateObj中。使用createObject(谷歌地圖)在Coldfusion查詢中創建java腳本對象
有似乎是在下面的代碼語法錯誤:
var stateObj=[];
var stName;
var stPoints;
<cfoutput query="states" group="stateid">
var temp= Object.create{{stName:#states.stateid#},{ stPoints:[]}};
<cfoutput>var coordinates = new google.maps.LatLng(#states.latitude#, #states.longitude#);
stPoints.push(coordinates);
</cfoutput>
stateObj.push(temp);
</cfoutput>