This is a map of Qubec in response to Stackoverflow question. The gist is based on Let's Make a Map.
Created
September 26, 2013 05:42
-
-
Save phil-pedruco/6710250 to your computer and use it in GitHub Desktop.
Topojson Map of Qubec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
#area { | |
stroke: grey; | |
stroke-width: 1px; | |
fill: steelblue; | |
} | |
</style> | |
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
<script src="http://d3js.org/topojson.v1.min.js"></script> | |
<body> | |
<script> | |
var width = 960, | |
height = 500; | |
var svg = d3.select("body").append("svg") | |
.attr("width", width) | |
.attr("height", height); | |
var projection = d3.geo.mercator() | |
.center([-71.94, 52.90]) | |
.scale(750) | |
.translate([(width) / 2, (height)/2]); | |
var path = d3.geo.path() | |
.projection(projection); | |
d3.json("qc-map.json", function(error, qbec) { | |
console.log(qbec) | |
svg.append("path") | |
.datum(topojson.feature(qbec, qbec.objects.map_qc)) | |
.attr("id", "area") | |
.attr("d", path); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment