Skip to content

Instantly share code, notes, and snippets.

@andrewxhill
Created January 4, 2013 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewxhill/4455583 to your computer and use it in GitHub Desktop.
Save andrewxhill/4455583 to your computer and use it in GitHub Desktop.
Basic CartoDB Layer in D3
d3.json("http://account_name.cartodb.com/api/v2/sql?q=SELECT * FROM table_name WHERE the_geom IS NOT NULL&format=geojson&dp=5", function(collection) {
svg.select("#layer_id")
.selectAll("path")
.data(collection.features)
.enter().append("path")
.attr("fill", "violet")
.attr("d", path.projection(xy));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment