1我正在使用d3js地图。根据我的知识,下面提到的代码是正确的,但它显示错误,即"未捕获的类型错误:无法读取属性'长度'未定义" 。请帮助我如何解决这个问题!
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<style>
</style>
</head>
<body>
<script>
var canvas = d3.select("body")
.append("svg")
.attr("width", 760)
.attr("height", 700);
d3.json("nepal-topo.json", function(data){
var group = canvas.selectAll("g")
.data(data.features)
.append("g")
var projection = d3.geo.mercator();
var path = d3.geo.path().projection(projection);
var areas = group.append("path")
.attr("d", path)
.attr("class","area")
.attr("fill", "steelblue");
});
</script>
</body>
</html>