Skip to content

Instantly share code, notes, and snippets.

Last active August 1, 2016 02:02
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
TopoJSON Points
license: gpl-3.0

This example demonstrates encoding a MultiPoint geometry object using TopoJSON.

Display the source blob
Display the rendered blob
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<meta charset="utf-8">
path {
stroke-linejoin: round;
.land {
fill: #ddd;
.states {
fill: none;
stroke: #fff;
<script src="//"></script>
<script src="//"></script>
<script src="//"></script>
var width = 960,
height = 500;
var projection = d3.geo.albers();
var path = d3.geo.path()
var svg ="body").append("svg")
.attr("width", width)
.attr("height", height);
.defer(d3.json, "/mbostock/raw/4090846/us.json")
.defer(d3.json, "airports.json")
function ready(error, us, airports) {
if (error) throw error;
.attr("class", "land")
.attr("d", path);
.datum(topojson.mesh(us, us.objects.states, function(a, b) { return a !== b; }))
.attr("class", "states")
.attr("d", path);
.datum(topojson.feature(airports, airports.objects.airports))
.attr("class", "points")
.attr("d", path);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment