1
나는 d3.js와지도를 그릴려고하지만 난 여기에d3.js "MNaN, NaN가"
<!-- language: lang-js -->
var width=960, height=500;
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
var q = 0;
var sc = 3000;
var d3line2 = d3.svg.line()
.x(function(d){q= 0.95105*sc*(d[0]+66.4262); return q;})
.y(function(d){q= sc*(-1*d[1]+ 18.2336); return q;})
.interpolate("linear");
d3.json("/prCounties.json", function(d){
for(var k = 0; k < d.features[0].length; k++){
svg.append("path")
.attr("d", d3line2(d.features[0][k].geometry.coordinates))
.attr("class", "stroke");
}
});
Problem parsing d="MNaN,NaN"
가 계속 GeoJson 파일이 구문 분석 문제 - 그것은에 무엇 동일해야합니다을 GitHub.
{
"type": "FeatureCollection",
"properties": {"kind": "state", "state": "PR"},
"features": [[
{"geometry": {"type": "MultiPolygon", "coordinates": [[[[-66.7222, 18.2198], [-66.6838, 18.2034], [-66.6729, 18.1541], [-66.6948, 18.1322], [-66.7167, 18.1322], [-66.7331, 18.1103], [-66.7715, 18.1377], [-66.7989, 18.1322], [-66.8262, 18.1705], [-66.8153, 18.2308], [-66.7824, 18.2527]]]]},
"type": "Feature", "properties": {"kind": "county", "name": "Adjuntas", "state": "PR"}
}
JsFiddle. 그것은 좋은 전화입니다. 괜찮 았어. [지도] (https://a248.e.akamai.net/camo.github.com/521b09a4A0d52539fd2b83060503d96bada85d277/687474703a2f2f646c2e64726f70626f782e636f6d2f752f31373934393130302f70722e706e67) –