Skip to content

Commit 7ceb8bd

Browse files
Mute errors when map not available
1 parent b658532 commit 7ceb8bd

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Diff for: resources/SolutionTab.qml

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ MainTab {
5858
}
5959

6060
SolutionTabComponents.SolutionMapTab {
61+
visible: Globals.enableMap
6162
}
6263
}
6364
}

Diff for: resources/web/map/js/trajectory_raw.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ function setupLayers() {
130130
}
131131

132132
function syncCrumbCoords(){
133-
map.getSource('breadcrumb').setData({
133+
let breadcrumb = map.getSource('breadcrumb');
134+
if (breadcrumb === undefined) return;
135+
breadcrumb.setData({
134136
type: 'Feature',
135137
geometry: {
136138
type: 'LineString',
@@ -142,10 +144,12 @@ function syncCrumbCoords(){
142144
function syncLayers() {
143145
// sync route datas with stored points
144146
for (let i = 0; i < lines.length; i++) {
145-
map.getSource(`route${i}`).setData(data[i]);
147+
let route = map.getSource(`route${i}`);
148+
if (route !== undefined) route.setData(data[i]);
146149
}
147150
// clear protection, since its only one point and temporary
148-
map.getSource('prot').setData({
151+
let prot = map.getSource('prot');
152+
if (prot !== undefined) prot.setData({
149153
type: 'FeatureCollection',
150154
features: []
151155
});

0 commit comments

Comments
 (0)