如何在地图上添加类型为:multilinestring?

时间:2016-12-20 12:05:08

标签: javascript jquery reactjs

addfeatures(data) {
  let map = this.map;
  var testing = {
    type: "FeatureCollection",
    features: []
  };
  testing.features.push({
    "type": "Feature",
    "geometry": JSON.parse(data)
  });
  featureLayer = new google.maps.Data();
  this.clearOverlay();
  featureLayer.addGeoJson(testing);
  featureLayer.setStyle({
    fillColor: 'purple',
    strokeColor: 'red',
    strokeWeight: 2
  });
  featureLayer.setMap(map);
}

此处数据的结果如下:

{
  "type":"MultiLineString",
  "coordinates":[[
    [-13063926.5701,4084309.8696],
    [-13063917.2422,4084309.8973]
  ]]
}

那么如何为此添加样式?它没有在地图上显示。

0 个答案:

没有答案