D3과 CSV 파일을 사용하여 Google지도에 점을 찍으려고합니다. 난 위도가 긴 좌표를 제대로 읽을 수있을 것하지만 그들은지도에 아무데도 그릴하지 않습니다.d3.js csv에서 Google Map으로 Lat Long 좌표를 읽는 중
var map = new google.maps.Map(d3.select("#map").node(),
{
zoom: 11,
center: new google.maps.LatLng(39.654835520000063, -105.01942651999994),
mapTypeId: google.maps.MapTypeId.TERRAIN
});
d3.csv("data.csv", function(error, data)
{
var overlay = new google.maps.OverlayView();
overlay.draw = function() {
d3.select("circle")
.data(data)
.enter()
.append("circle")
.attr("cy", function(d)
{
return [d.longitude, d.latitude][0];
})
.attr("cx", function(d)
{
return [d.longitude, d.latitude][1];
})
.attr("r", 5)
.style("fill", "blue");
}
overlay.setMap(map);
});
좌표를 투영해야합니다. [이 예제] (http://bl.ocks.org/mbostock/899711)를 보았습니까? –