基於openlayer的遷徙案例
展示
源碼地址
https://github.com/Liar0320/openlayer.track
演示地址
https://liar0320.github.io/openlayer.track/dist/index.html
依賴
- openlayer OpenLayers is a high-performance, feature-packed library for creating interactive maps on the web. It can display map tiles, vector data and markers loaded from any source on any web page. OpenLayers has been developed to further the use of geographic information of all kinds. It is completely free, Open Source JavaScript, released under the BSD 2-Clause License.
- arc Calculate great circles routes as lines in GeoJSON or WKT format.
使用
Clone the repo using Git:
git clone https://github.com/Liar0320/openlayer.track.git
Alternatively you can download this repository and then:
npm i
npm run start
配置項
-
路徑座標文件 /asstes/route.topojson
示例 { "flights":[ [ [ "30.8312277712", "120.9259679951" ], [ "43.7933993081", "87.6270586992" ] ] ] }
-
從起始點到終點的時間間隔 /src/util.ol.js -> pointsPerMs
/** 從起始點到終點的時間間隔 */ const pointsPerMs = 2000;
TODO
待整理