【发布时间】:2011-07-11 15:55:31
【问题描述】:
我正在查询一个经纬度值的数据库,并希望以对象的形式返回数据。每个对象都应该有一个 stName(状态名称)和 stPoint(纬度和经度点的数组,应该为每条记录推入数组中。) 然后应该将整个对象推入数组 stateObj。
下面的代码似乎有语法错误:
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>
【问题讨论】:
标签: javascript google-maps object coldfusion