Load current tour status from server
This commit is contained in:
parent
3324a57206
commit
0c1aeebdf7
12
main.js
12
main.js
@ -13,6 +13,7 @@ import geojsonPOI from './geo/poi.json'
|
||||
|
||||
useGeographic();
|
||||
|
||||
async function main() {
|
||||
const styles = {
|
||||
lineOrange: new Style({
|
||||
stroke: new Stroke({
|
||||
@ -60,7 +61,9 @@ const styles = {
|
||||
// Route
|
||||
//
|
||||
|
||||
const lastStageFinished = 2;
|
||||
const tourStatus = await fetch('https://r2b22.kip.pe/status.json').then(res => res.json());
|
||||
|
||||
const lastStageFinished = tourStatus.lastStageFinished;
|
||||
const stagesCompleted = geojsonRoute.features.slice(0, lastStageFinished);
|
||||
const stagesAhead = geojsonRoute.features.slice(lastStageFinished);
|
||||
const vectorSourceStagesCompleted = new VectorSource();
|
||||
@ -219,8 +222,8 @@ map.on('movestart', disposePopover);
|
||||
//
|
||||
|
||||
const updateInterval = 5000;
|
||||
let followedFeature = vanFeature;
|
||||
let followedZoomed = false;
|
||||
// let followedFeature = vanFeature;
|
||||
// let followedZoomed = false;
|
||||
// let followedFeature = null;
|
||||
|
||||
function startFollowing(feature, followLink) {
|
||||
@ -267,3 +270,6 @@ function updateData(startInterval=false) {
|
||||
}
|
||||
|
||||
updateData(true);
|
||||
}
|
||||
|
||||
main();
|
||||
|
Loading…
x
Reference in New Issue
Block a user