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...展开
  • 给js对象赋值,赋值key

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']);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-11-17
  • 2021-07-04
  • 2022-02-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-23
相关资源
相似解决方案