Giter VIP home page Giter VIP logo

ol-routeanimate's Introduction

基于openlayer的小车运动轨迹动画

实现思路

v1利用原生requestAnimationFrame函数,利用ol自带的getCoordinateAt获取每个step的坐标,然后更新小车当前位置,并且push轨迹路线
v2利用turf的LineSliceAlong对轨迹进行增密,然后利用requestAnimationFrame绘制每一帧动画

存在问题

  • 插值和节点没有做处理,使得拐点轨迹不好看
  • 小车车头方向未做调整

mapbox实现轨迹

maptalks实现轨迹

  • maptalks是我接触最早的一个开源二三维地图api
  • line直接提供animateShow这个方法
  • maptalks将line.animateShow()返回的对象作为player,所以可以直接执行pause,play等方法控制播放
  • 小车经过摄像头时改变摄像头状态(计算小车到摄像头的距离,小于某个值,激活摄像头)

体验地址

ol-routeanimate's People

Contributors

liquid-zhangliquan avatar xiangliliang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.