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]
]]
}
那么如何为此添加样式?它没有在地图上显示。