Let map cope with non-features being returned by GIS.

Specifically, the raw positioning error vectors
introduced in commit 099cf909c1
This commit is contained in:
D. Berge
2020-08-11 17:13:29 +02:00
parent 099cf909c1
commit d55197937c

View File

@@ -88,15 +88,17 @@ const layers = {
},
onEachFeature (feature, layer) {
const p = feature.properties;
const popup = feature.geometry.type == "Point"
? `Raw sequence ${feature.properties.sequence}<br/>Point <b>${feature.properties.line} / ${feature.properties.point}</b><br/>${feature.properties.objref}<br/>${feature.properties.tstamp}`
: `Raw sequence ${p.sequence}<br/>
Line <b>${p.line}</b><br/>
${p.num_points} points${p.missing_shots ? " <i>("+p.missing_shots+" missing)</i>" : ""}<br/>
${Math.round(p.length)} m ${p.azimuth.toFixed(1)}°<br/>
${p.duration}<br/>
<table><tr><td><b>${p.fsp}</b></td><td>@ ${ftstamp(p.ts0)}</td></tr><tr><td><b>${p.lsp}</b></td><td>@ ${ftstamp(p.ts1)}</td></tr></table>`;
layer.bindTooltip(popup, {sticky: true});
if (feature.geometry) {
const popup = feature.geometry.type == "Point"
? `Raw sequence ${feature.properties.sequence}<br/>Point <b>${feature.properties.line} / ${feature.properties.point}</b><br/>${feature.properties.objref}<br/>${feature.properties.tstamp}`
: `Raw sequence ${p.sequence}<br/>
Line <b>${p.line}</b><br/>
${p.num_points} points${p.missing_shots ? " <i>("+p.missing_shots+" missing)</i>" : ""}<br/>
${Math.round(p.length)} m ${p.azimuth.toFixed(1)}°<br/>
${p.duration}<br/>
<table><tr><td><b>${p.fsp}</b></td><td>@ ${ftstamp(p.ts0)}</td></tr><tr><td><b>${p.lsp}</b></td><td>@ ${ftstamp(p.ts1)}</td></tr></table>`;
layer.bindTooltip(popup, {sticky: true});
}
}
}),
"Final lines": L.geoJSON(null, {