基於openlayer的遷徙案例

基於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 

配置項

  1. 路徑座標文件 /asstes/route.topojson

    示例
    {
        "flights":[
            [
                [
                    "30.8312277712",
                    "120.9259679951"
                ],
                [
                    "43.7933993081",
                    "87.6270586992"
                ]
            ]
        ]
     }
    
  2. 從起始點到終點的時間間隔 /src/util.ol.js -> pointsPerMs

    /** 從起始點到終點的時間間隔 */
    const pointsPerMs = 2000;
    

TODO

待整理

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章