Map of Chile made with Spam.js.
This time projected automagically.
border: none | |
height: 665 | |
license: mit |
<!DOCTYPE html> | |
<meta charset="utf-8" /> | |
<body> | |
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
<script src="https://d3js.org/topojson.v1.min.js"></script> | |
<script src="https://unpkg.com/rbush@1.4.3/rbush.js"></script> | |
<script src="https://unpkg.com/spamjs@1.1.0/spam.min.js"></script> | |
<script type='text/javascript'> | |
d3.json("chile.json", function(error, d) { | |
topojson.presimplify(d); | |
var map = new StaticCanvasMap({ | |
element: "body", | |
width: 560, | |
data: [ | |
{ | |
features: topojson.feature(d, d.objects["chile"]), | |
static: { | |
paintfeature: function(parameters, d) { | |
parameters.context.lineWidth = 0.5; | |
parameters.context.strokeStyle = "rgb(30,30,30)"; | |
parameters.context.stroke(); | |
} | |
} | |
} | |
] | |
}); | |
map.init(); | |
}); | |
</script> | |
</body> | |
</html> |