To work with movement and animations, we will use the class
GMove.
For GMove, 4 properties are defined:
-
deltaMiliseconds: amount of milliseconds that will be left between the previous animation (if it existed) and the one that we are defining.
-
goTO: property of the GLatLon type. It defines which latitude and longitude the map will jump to.
-
deltaX: The increase in X that the map will undergo, where a unit is average screen.
-
deltaY: The increase in Y that the map will undergo, where a unit is average screen.
If goTO is defined, the values given to deltaX and deltaY will be ignored.
Once the movement is defined, the addMovement method will add the movement to the map, as demonstrated in the example.
A map can have as many movements as we want, and the movements will be carried out according to the order in which we have added them to the map.
NOTE: When the beginning and the end of a movement are the sufficiently near, instead of a jump, the map will slide.