d3.js - svg map wont display with d3 & geoJSON -
i'm attempting create dynamic map d3. converted shapefile geojson, tried create svg image , bind geojson data using d3. visible on page blank or white svg image (700 x 700). how reveal map? code shown below:
$(function() { var canvas = d3.select("body").append("svg") .attr("width", 700) .attr("height", 700) d3.json("nysd.geojson", function(data) { var group = canvas.selectall("g") .data(data.features) .enter() .append("g") var projection = d3.geo.mercator().scale(5000).translate([0,1980]); var path = d3.geo.path().projection(projection); var areas = group.append("path") .attr("d", path) .attr("class", "area") .attr("fill", steelblue); }); });
Comments
Post a Comment