When the Openlayers map is making a trajectory, in addition to marking each location point and connecting line, trajectory animation is often used. This actual combat is such an example, a block moves on a trajectory. The essence is to use setInterval to recalculate and position the position of small objects every short period of time, and the whole string is moving.
renderings
source code
/*
* @Author: 大剑师兰特(xiaozhuanlan),还是大剑师兰特(CSDN)
* @此源代码版权归大剑师兰特所有,可供学习或商业项目中借鉴,未经授权,不得重复地发表到博客、论坛,问答,git等公共空间或网站中。
* @Email: [email protected]
* @First published in CSDN
* @First published time: 2023-07-12
*/
<template>
<div class="container"