Skip to content

Instantly share code, notes, and snippets.

@jfirebaugh
Created May 5, 2013 21:48
Show Gist options
  • Select an option

  • Save jfirebaugh/5522318 to your computer and use it in GitHub Desktop.

Select an option

Save jfirebaugh/5522318 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<meta charset="utf-8">
<style>
</style>
<body>
<script src="http://d3js.org/d3.v3.js"></script>
<script>
var width = 897,
height = 956;
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
var projection = d3.geo.mercator()
.scale(36782185.57401177)
.translate([78590413.93604825, 26230042.030919768])
.clipExtent([[0, 0], [width, height]]);
var path = d3.geo.path()
.projection(projection);
var feature = {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-122.4204308,37.7789213],[-122.4205915,37.7789001],[-122.4205771,37.7788321],[-122.4212821,37.7787388],[-122.4212744,37.7787022],[-122.4214533,37.7786785],[-122.4213704,37.778287],[-122.4211716,37.7783133],[-122.4211633,37.7782739],[-122.4204598,37.778367],[-122.4204422,37.7782837],[-122.4202982,37.7783028],[-122.4203203,37.7784072],[-122.4202469,37.7784169],[-122.4203274,37.7787969],[-122.4204024,37.778787],[-122.4204308,37.7789213]]]}};
svg.append("path")
.attr("d", path(feature));
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment