我有这个变量,我想动态添加其他变量,因为我从 XML 文件中读取了 latlng、名称等。
var stationMapList = [
{"latlng":[41.38506,2.17340],name:"Barcelona", pin:'img/pin_2.png', id:'address0', tab:'tab1-button'},
{"latlng":[41.11902,1.24521],name:"Tarragona", pin:'img/pin.png', id:'address1', tab:'tab1-button'},
]
我想将这些添加到 stationMapList,我该怎么做?
{"latlng":[40.41678,-3.70379],name:"Madrid", pin:'img/pin_2.png', id:'address2' ,tab:'tab1-button'},
{"latlng":[37.99233,-1.13046],name:"Murcia", pin:'img/pin.png', id:'address3' ,tab:'tab1-button'},
{"latlng":[39.46991,-0.37629],name:"Valencia", pin:'img/pin.png', id:'address4' ,tab:'tab1-button'}