Fix no-go area parsing for namespaced XML elements
querySelectorAll('nogo') doesn't match <trails:nogo>. Now matches
both unprefixed and prefixed element names.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e12479293d
commit
6ccf7af7b1
1 changed files with 3 additions and 2 deletions
|
|
@ -88,10 +88,11 @@ function parseTracks(doc: Document): TrackPoint[][] {
|
|||
|
||||
function parseNoGoAreas(doc: Document): NoGoArea[] {
|
||||
const areas: NoGoArea[] = [];
|
||||
const nogos = doc.querySelectorAll("nogo");
|
||||
// Match both unprefixed and prefixed (trails:nogo) elements
|
||||
const nogos = doc.querySelectorAll("nogo, trails\\:nogo");
|
||||
for (const nogo of Array.from(nogos)) {
|
||||
const points: Array<{ lat: number; lon: number }> = [];
|
||||
const pts = nogo.querySelectorAll("point");
|
||||
const pts = nogo.querySelectorAll("point, trails\\:point");
|
||||
for (const pt of Array.from(pts)) {
|
||||
const lat = parseFloat(pt.getAttribute("lat") ?? "0");
|
||||
const lon = parseFloat(pt.getAttribute("lon") ?? "0");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue