Skip to content

Instantly share code, notes, and snippets.

Last active January 8, 2020 03:26
  • Star 2 You must be signed in to star a gist
  • Fork 3 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?
Rotating Equirectangular
license: gpl-3.0
<!DOCTYPE html>
<meta charset="utf-8">
<script src="//"></script>
<script src="//"></script>
var width = 960,
height = 500;
var velocity = .01,
t0 =;
var projection = d3.geo.equirectangular()
var canvas ="body").append("canvas")
.attr("width", width)
.attr("height", height);
var context = canvas.node().getContext("2d");
var path = d3.geo.path()
d3.json("/mbostock/raw/4090846/world-110m.json", function(error, world) {
if (error) throw error;
var land = topojson.feature(world,;
d3.timer(function() {
var t = - t0;
projection.rotate([0, velocity * t]);
context.clearRect(0, 0, width, height);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment