var pastResult = []; pastResult.push(feature.attributes.F_iID); pastResult.push(feature.attributes.F_sName); pastResult.push(feature.attributes.F_sAddress); 得到的結果是: 想要把默認的0、1、2,改成F_iID、F_sName、F_sAd...展開
pastResult是數組,所以只能用0,1,2
1
2
3
4
5
6
7
8
9
|
// 用對象
var
pastResult = {};
pastResult[
'F_iID'
] = feature.attributes.F_iID;
pastResult[
'F_sName'
] = feature.attributes.F_sName;
pastResult[
'F_sAddress'
] = feature.attributes.F_sAddress;
alert(pastResult[
'F_iID'
]);
alert(pastResult[
'F_sName'
]);
alert(pastResult[
'F_sAddress'
]);
|