Skip to content

Commit

Permalink
Mute errors when map not available
Browse files Browse the repository at this point in the history
  • Loading branch information
john-michaelburke committed Jul 31, 2024
1 parent b658532 commit 7ceb8bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions resources/SolutionTab.qml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ MainTab {
}

SolutionTabComponents.SolutionMapTab {
visible: Globals.enableMap
}
}
}
Expand Down
10 changes: 7 additions & 3 deletions resources/web/map/js/trajectory_raw.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ function setupLayers() {
}

function syncCrumbCoords(){
map.getSource('breadcrumb').setData({
let breadcrumb = map.getSource('breadcrumb');
if (breadcrumb === undefined) return;
breadcrumb.setData({
type: 'Feature',
geometry: {
type: 'LineString',
Expand All @@ -142,10 +144,12 @@ function syncCrumbCoords(){
function syncLayers() {
// sync route datas with stored points
for (let i = 0; i < lines.length; i++) {
map.getSource(`route${i}`).setData(data[i]);
let route = map.getSource(`route${i}`);
if (route !== undefined) route.setData(data[i]);
}
// clear protection, since its only one point and temporary
map.getSource('prot').setData({
let prot = map.getSource('prot');
if (prot !== undefined) prot.setData({
type: 'FeatureCollection',
features: []
});
Expand Down

0 comments on commit 7ceb8bd

Please sign in to comment.