使用JSON对象作为另一个丢弃标签的JSON对象中的值

时间:2016-10-20 06:47:33

标签: javascript json sequelize.js

我正在尝试存储以下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]]
          }

每次选择值都不同。请帮忙。我是新手。

1 个答案:

答案 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)