Skip to content

Instantly share code, notes, and snippets.

@martgnz
Last active October 28, 2017 14:59
Show Gist options
  • Save martgnz/fbd23257d01bfbc9c2db8b09d550944c to your computer and use it in GitHub Desktop.
Save martgnz/fbd23257d01bfbc9c2db8b09d550944c to your computer and use it in GitHub Desktop.
Berlin railways
license: mit
border: none
height: 723
<!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/[email protected]/rbush.js"></script>
<script src="https://unpkg.com/[email protected]/spam.min.js"></script>
<script type='text/javascript'>
d3.json("railways.json", function(error, d) {
topojson.presimplify(d);
var map = new StaticCanvasMap({
element: "body",
data: [
{
features: topojson.feature(d, d.objects["railways"]),
static: {
paintfeature: function(parameters, d) {
parameters.context.lineWidth = 0.5;
parameters.context.strokeStyle = "rgba(0,0,0,0.3)";
parameters.context.stroke();
}
}
}
]
});
map.init();
});
</script>
Display the source blob
Display the rendered blob
Raw
Loading
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