我正在尝试绘制哥伦比亚某些地区的 geojson 地图。目前它只显示一个路径:,
我的特征集合有 52 个特征,但我只能绘制这一个特征。我不知道我做错了什么,我的代码基于其他教程。我该怎么做才能显示所有路径?
var features = mapData.features;
console.log(features);
// Update color scale domain based on data
// Draw each province as a path
mapLayer.selectAll('path')
.data(features)
.enter().append('path')
.attr('d', path)
.attr('vector-effect', 'non-scaling-stroke')
Run Code Online (Sandbox Code Playgroud)
这是我的完整代码: