I've been trying to create a d3 map for weeks meshing tutorials with code. Here is my html code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript" src= "d3.min.js">
Modernizr.load({
test: Modernizr.svg && Modernizr.inlinesvg,
yep : [ 'd3.min.js',
'js/script.js' ]
});
</script>
</head>
<body>
<script src="NYC_MapInfo.geojson"></script>
<script>
var width = 960,
height = 1160;
var projection = d3.geo.mercator()
.scale(500)
.translate([width / 2, height / 2]);
var path = d3.geo.path()
.projection(projection);
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
d3.json("NYC_MapInfo.geojson", function(error, NYC_MapInfo) {
svg.append("path")
.datum(NYC_MapInfo.feature(NYC_MapInfo, NYC_MapInfo.objects))
.attr("d", path);
});
</script>
</body>
</html>
Here is the link to the json file
:
Can someone please help me fix the code to load a image?
here is a link that might help you see the code: http://0.0.0.0:8000/nyc_zipmap.html