mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
fix(geomap): not rendering on desktop (closes #2085)
This commit is contained in:
parent
96a5729b60
commit
c5d64c182b
@ -224,9 +224,14 @@ export default class GeoMapTypeWidget extends TypeWidget {
|
|||||||
this.gpxLoaded = true;
|
this.gpxLoaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: This is not very efficient as it's probably a string response that is parsed and then converted back to string and parsed again.
|
const xmlResponse = await server.get<XMLDocument | Uint8Array>(`notes/${note.noteId}/open`);
|
||||||
const xmlResponse = await server.get<XMLDocument>(`notes/${note.noteId}/open`);
|
let stringResponse: string;
|
||||||
const stringResponse = new XMLSerializer().serializeToString(xmlResponse);
|
if (xmlResponse instanceof Uint8Array) {
|
||||||
|
stringResponse = new TextDecoder().decode(xmlResponse);
|
||||||
|
} else {
|
||||||
|
// TODO: This is not very efficient as it's probably a string response that is parsed and then converted back to string and parsed again.
|
||||||
|
stringResponse = new XMLSerializer().serializeToString(xmlResponse)
|
||||||
|
}
|
||||||
|
|
||||||
const track = new this.L.GPX(stringResponse, {});
|
const track = new this.L.GPX(stringResponse, {});
|
||||||
track.addTo(this.geoMapWidget.map);
|
track.addTo(this.geoMapWidget.map);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user