【发布时间】:2017-11-12 21:29:04
【问题描述】:
我正在尝试使用 .geojson 文件使用 D3.js 创建世界地图。但是每次页面加载时它都会给我一个404 error http://localhost:xxxx/world.geojson file not found。
这是我的 site.js 文件:
$(function() {
d3.json("./world.geojson", createMap);
function createMap(countries) {
var aProjection = d3.geoMercator();
var geoPath = d3.geoPath().projection(aProjection);
d3.select("svg").selectAll("path").data(countries.features)
.enter()
.append("path")
.atrt("d", geoPath)
.attr("class", "countries");
}
});
这是我的项目结构的样子:structure
任何帮助将不胜感激。谢谢!
【问题讨论】:
标签: javascript c# asp.net d3.js asp.net-core