Update rotating example
This commit is contained in:
parent
bae0d216e6
commit
72cbd4990d
@ -19,10 +19,11 @@
|
|||||||
planet.loadPlugin(planetaryjs.plugins.earth({
|
planet.loadPlugin(planetaryjs.plugins.earth({
|
||||||
topojson: { file: '/world-110m.json' }
|
topojson: { file: '/world-110m.json' }
|
||||||
}));
|
}));
|
||||||
// Scale the planet's radius to half the canvas' size...
|
// Scale the planet's radius to half the canvas' size
|
||||||
planet.projection.scale(canvas.width / 2);
|
// and move it to the center of the canvas.
|
||||||
// ...and move the planet to the center of the canvas.
|
planet.projection
|
||||||
planet.projection.translate([canvas.width / 2, canvas.height / 2]);
|
.scale(canvas.width / 2)
|
||||||
|
.translate([canvas.width / 2, canvas.height / 2]);
|
||||||
planet.draw(canvas);
|
planet.draw(canvas);
|
||||||
})();</code></pre>
|
})();</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -6,9 +6,10 @@
|
|||||||
planet.loadPlugin(planetaryjs.plugins.earth({
|
planet.loadPlugin(planetaryjs.plugins.earth({
|
||||||
topojson: { file: '/world-110m.json' }
|
topojson: { file: '/world-110m.json' }
|
||||||
}));
|
}));
|
||||||
// Scale the planet's radius to half the canvas' size...
|
// Scale the planet's radius to half the canvas' size
|
||||||
planet.projection.scale(canvas.width / 2);
|
// and move it to the center of the canvas.
|
||||||
// ...and move the planet to the center of the canvas.
|
planet.projection
|
||||||
planet.projection.translate([canvas.width / 2, canvas.height / 2]);
|
.scale(canvas.width / 2)
|
||||||
|
.translate([canvas.width / 2, canvas.height / 2]);
|
||||||
planet.draw(canvas);
|
planet.draw(canvas);
|
||||||
})();
|
})();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user