D3 Globe Animation (d3.geo.azimuthal)

I have a question about d3 javascript libarary. I want to use the azimuthal globe, and I want to insert points from longitude coordinates and coordinates on the globe and make an animation of the globe without using mouse events.

Do you think this is possible? Can you give me some useful tips on how to do this?

Cheers Thor

+6
source share
1 answer

To make an example myself, I implemented:

var newX = 185; var newY = -200; function setupRotate() { m0= [0,0]; o0 = projection.origin(); } function rotate() { if (m0) { var m1 = [newX, newY];//d3.event.pageX, d3.event.pageY], o1 = [o0[0] + (m0[0] - m1[0]) / 8, o0[1] + (m1[1] - m0[1]) / 8]; projection.origin(o1); //console.log(m1); circle.origin(o1) refresh(); //console.log("rotate"); //console.log("newX: "+newX+" newY: "+newY); } } function rotateInterval() { var theRotationInterval = setInterval(rotateAndIncrement,1); function rotateAndIncrement(){ //console.log("rotateAndIncrement"); if (newX === 3)//3065) { { //console.warn("!!Reset Rotation!!"); clearInterval(theRotationInterval); newX = 185; rotateInterval(); } //console.log("newX: "+newX+" newY: "+newY); else { newX++; rotate(); } } } 

I am working on adding points to the map, it is much more complicated. If I cannot get it to work, I will post it here.

+5
source

Source: https://habr.com/ru/post/927135/


All Articles