新手问题在这里.. 我正在尝试从数组中返回 LAT LNG 值。
我有以下三个功能:
function City(ridge)
{
var city= {
ABC:"Bethel, AK",
ABR:"Aberdeen, SD",
ABX:"Albuquerque, NM"};
return city[ridge];
}
和
function BBox(ridge,product)
{
var yx= {
NOR:
{
ABC:[64.835517,56.735755,-157.448578,-166.284681]
,
ABR:[48.270508,42.631241, -95.331912,-101.483839]
,
ABX:[37.565036,32.726169,-104.179217,-109.457981]}};
var xy=yx[product][ridge];
return {x0:xy[2],x1:xy[3],y0:xy[0],y1:xy[1]};
}
和
function initialize()
{
var ridge = 'ABC';
var product ='NOR';
var getCityInfoFromRidgeName = City(ridge);
var boundries=BBox(ridge,product);
alert(getCityInfoFromRidgeName);
alert(boundries);
}
City的警报按预期返回“Bethel,AK”.. 但BBox的警报返回“objec Object”,而不是希望的 LAT LNG 信息。
我可能有点不知所措,但是如何将 LAT LNG 从 BBox 返回到 var?
窝