data from http://www.nysm.nysed.gov/gis/
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <script src="http://d3js.org/d3.v3.min.js"></script> | |
| <script src="http://d3js.org/topojson.v1.min.js"></script> | |
| <style> | |
| path{ | |
| fill: none; | |
| stroke: navy; | |
| stroke-width:.5; | |
| } | |
| </style> | |
| <body> | |
| <div id="map"> | |
| </div> | |
| <script> | |
| var width = 960, | |
| height = 500; | |
| var projection = d3.geo.mercator() | |
| .center([-74.875366, 42.88]) | |
| .scale(4500) | |
| .translate([width / 2, height / 2]) | |
| var path = d3.geo.path() | |
| .projection(projection) | |
| var svg = d3.select("#map").append("svg") | |
| .attr("width", width) | |
| .attr("height", height); | |
| d3.json("nysurf2.json", function(error, ny) { | |
| svg.append("path") | |
| .datum(topojson.mesh(ny)) | |
| .attr("d", path); | |
| }); | |
| </script> | |
| </body> | |
| </html> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment