Topojson 缺少外部边界
Topojson missing outside boundaries
渲染我的 topojson 时,我遗漏了州的外部边界。
例如,我对南方的看法是这样的:
相反,我需要填充所有外部边界。
我的地图样式如下:
.state-boundary {
stroke: #00001d;
stroke-width: .5px;
fill: white;
stroke-linejoin: round;
stroke-linecap: round;
}
在转换为 topojson 之前,geojson 如下所示:
我的d3如下:
svg.append("path")
.datum(topojson.mesh(topology, topology.objects.south, function(a, b) { return a !== b; }))
.attr("d", path)
.attr("class", "state-boundary");
所以,这只是改变网格方法的问题。我不太明白其中的区别,所以也许有人可以插话:
svg.append("path")
.datum(topojson.mesh(topology, topology.objects.south))
.attr("d", path)
.attr("class", "state-boundary");
渲染我的 topojson 时,我遗漏了州的外部边界。
例如,我对南方的看法是这样的:
相反,我需要填充所有外部边界。
我的地图样式如下:
.state-boundary {
stroke: #00001d;
stroke-width: .5px;
fill: white;
stroke-linejoin: round;
stroke-linecap: round;
}
在转换为 topojson 之前,geojson 如下所示:
我的d3如下:
svg.append("path")
.datum(topojson.mesh(topology, topology.objects.south, function(a, b) { return a !== b; }))
.attr("d", path)
.attr("class", "state-boundary");
所以,这只是改变网格方法的问题。我不太明白其中的区别,所以也许有人可以插话:
svg.append("path")
.datum(topojson.mesh(topology, topology.objects.south))
.attr("d", path)
.attr("class", "state-boundary");