So currently I have a map that has some plane data. There is a setInterval
function that updates the plane data every 5 seconds, making the plane move from point to point. That is working well.
function planeInterval() {
setInterval(function() {planeMovement()}, 5000);
//this is currently working
}
function planeMovement() {
//do some stuff to make the plane move around
//this is currently working
}
Now, I would like to set up a checkbox or some sort of toggle to:
-toggle on: as the plane moves across the map, the map MOVES as the plane moves
-toggle off: the plane just does what it usually does: moves across the map while the map stays stagnant.
I was looking into OL panTo
but I don't think that's the answer here. What would be the best/most simple approach in achieving this?