我正在尝试存储以下JSON对象
selection = [ [ { lat: 45.5487853626087, lng: -122.67692568479107 },
{ lat: 45.51511515270127, lng: -122.63298037229107 },
{ lat: 45.532914775094774, lng: -122.60070803342389 },
{ lat: 45.57138119289546, lng: -122.63092043576764 },
{ lat: 45.5785907152446, lng: -122.67967226682232 },
{ lat: 45.55936326549193, lng: -122.69752505002545 },
{ lat: 45.5487853626087, lng: -122.67967226682232 } ] ]
在另一个对象
mySelection = { type: 'Polygon', coordinates: selection};
如何删除标签" lat:"和" lng:"以及" {"和"}"?
期望的结果是 -
mySelection = { type: 'Polygon', coordinates:
[[45.5487853626087, -122.67692568479107] ,
[45.51511515270127, -122.63298037229107] ,
[45.532914775094774, -122.60070803342389] ,
[45.57138119289546, -122.63092043576764] ,
[45.5785907152446, -122.67967226682232] ,
[45.55936326549193, -122.69752505002545] ,
[45.5487853626087, -122.67967226682232]]
}
每次选择值都不同。请帮忙。我是新手。
答案 0 :(得分:1)
使用Array#map
方法生成数组。
tdist = struct('Name','t','DoF',10);
model = arima('Constant',0.4,'AR',{0.8,-0.3},'MA',0.5,...
'D',1,'Distribution',tdist,'Variance',0.15)