0
GeoJSON LineStrings를 d3이있는지도로 그리는 데 어려움이 있습니다. 전단지 (Mike Bostock의 예)를 사용하고 있으며 페이지가 오류없이로드됩니다. 그러나 아무 것도 내지도에 그려지지 않습니다.그리기 LineStrings d3
도움이 될 것입니다. 내 데이터의
니펫 :
{"type": "LineString", "coordinates":[[-74.12706, 40.734680000000004],...]}
여기 내 관련 코드입니다 : 내 문제를
/* Load the map */
var map = new L.Map("map", {center: [40.7127, -74.0059], zoom: 10})
.addLayer(new L.TileLayer(URL_TO_MY_TILES));
function makemap(error, data){
var svg = d3.select(map.getPanes().overlayPane).append("svg"),
g = svg.append("g").attr("class", "leaflet-zoom-hide");
var transform = d3.geo.transform({point: projectPoint}),
path = d3.geo.path().projection(transform);
var feature = g.selectAll("path")
.data(data.coordinates)
.enter().append("line")
.attr("d","path")
...
}