Skip to content

Instantly share code, notes, and snippets.

@rociiu
Forked from markmarkoh/gist:2969316
Created April 18, 2013 12:00
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 rociiu/5412196 to your computer and use it in GitHub Desktop.
Save rociiu/5412196 to your computer and use it in GitHub Desktop.
(function(window) {
var data,
xy = d3
.geo
.equirectangular()
.scale($('#map_container').width())
.translate([$('#map_container').width() / 2, $('#map_container').height() / 2]),
path = d3
.geo
.path()
.projection(xy),
svg = d3
.select('#map_container')
.append('svg:svg'),
countries = svg
.append('svg:g')
.attr('id', 'countries');
/* World Map */
countries.selectAll('path')
.data(window.countries_data.features) // get the data here: https://gist.github.com/2969317
.enter()
.append('svg:path')
.attr('d', path)
.attr('fill', 'rgba(29,91,85,1)')
.attr('stroke', 'rgba(29,91,85,1)')
.attr('stroke-width', 1);
}(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment