Skip to content

Instantly share code, notes, and snippets.

@repustate
Created December 3, 2013 20:21
Show Gist options
  • Save repustate/7776853 to your computer and use it in GitHub Desktop.
Save repustate/7776853 to your computer and use it in GitHub Desktop.
We need to project our map data as well as scaling and centering it so it fits in our viewport.
// Values to centre and scale the map of Toronto.
var x = -14100
var y = 7300
var scale = 66700
// Define map projection.
projection = d3.geo.albers().translate([x, y]).scale([scale])
// Define path generator.
var path = d3.geo.path().projection(projection);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment