2017-01-08 3 views
0

PHPのエクササイズ/プロジェクトでは、(プログレッション付きの)ルートをプログラミングする必要がありますが、 2点間の線。 例:付加的な困難は、比率から出発し、ライン上の進行状況を表示できるようにすることである example routeOSM:進行中の2つのポイント間のプログラミングライン

、目標が直線上に(車、人や自転車のような)画像を有することがあります。 私はすでにleaflet.jsで作業していますが、別のライブラリが適切な場合は、私は入札者です。

私はポイント(出発と到着)のために、一瞬のためにこれを使用します。

function placeMarkerDepartureArrival() { 
    // Departure 
    L.marker([varGPS[0].lat, varGPS[0].lng], {icon:myIconAD}).addTo(map); 
    // Arrival 
    L.marker([varGPS[1].lat, varGPS[1].lng], {icon:myIconAD}).addTo(map); 
} 

あなたが任意の例やサイトを持っている場合は、私が係です。

(リーフレットマッピングライブラリに基づく)
+0

それはワット私には不明ですあなたの質問は実際に尋ねています。コードのヘルプ?見るための作業コードの提案? – TylerH

答えて

0

Mapbox.jsアニメーションの例とそれらのドキュメントのWebサイトでプロットラインを持っており、ライン上のポイントをアニメーションあなたの運動/プロジェクト

のための無料の階層を持ってい

mapbox.jsサイトから

map.addSource('point', { 
    "type": "geojson", 
    "data": pointOnCircle(0) 
}); 

map.addLayer({ 
    "id": "point", 
    "source": "point", 
    "type": "circle", 
    "paint": { 
     "circle-radius": 10, 
     "circle-color": "#007cbf" 
    } 
}); 

function animateMarker(timestamp) { 
    // Update the data to a new position based on the animation timestamp. The 
    // divisor in the expression `timestamp/1000` controls the animation speed. 
    map.getSource('point').setData(pointOnCircle(timestamp/1000)); 

    // Request the next frame of the animation. 
    requestAnimationFrame(animateMarker); 
} 

// Start the animation. 
animateMarker(0); 

Link to example

関連する問題