Update rotating example

This commit is contained in:
Brandon Tilley 2013-12-23 15:02:27 -08:00
parent bae0d216e6
commit 72cbd4990d
2 changed files with 10 additions and 8 deletions

View File

@ -19,10 +19,11 @@
planet.loadPlugin(planetaryjs.plugins.earth({
topojson: { file: '/world-110m.json' }
}));
// Scale the planet's radius to half the canvas' size...
planet.projection.scale(canvas.width / 2);
// ...and move the planet to the center of the canvas.
planet.projection.translate([canvas.width / 2, canvas.height / 2]);
// Scale the planet's radius to half the canvas' size
// and move it to the center of the canvas.
planet.projection
.scale(canvas.width / 2)
.translate([canvas.width / 2, canvas.height / 2]);
planet.draw(canvas);
})();</code></pre>
</div>

View File

@ -6,9 +6,10 @@
planet.loadPlugin(planetaryjs.plugins.earth({
topojson: { file: '/world-110m.json' }
}));
// Scale the planet's radius to half the canvas' size...
planet.projection.scale(canvas.width / 2);
// ...and move the planet to the center of the canvas.
planet.projection.translate([canvas.width / 2, canvas.height / 2]);
// Scale the planet's radius to half the canvas' size
// and move it to the center of the canvas.
planet.projection
.scale(canvas.width / 2)
.translate([canvas.width / 2, canvas.height / 2]);
planet.draw(canvas);
})();