Use Leaflet for map
This commit is contained in:
@@ -5,7 +5,8 @@ import {
|
||||
fetchReport,
|
||||
printReport,
|
||||
getImageSrc,
|
||||
OBJECT_ORDER
|
||||
OBJECT_ORDER,
|
||||
attachMap
|
||||
} from "../ds.js";
|
||||
|
||||
document.addEventListener('readystatechange', async () => {
|
||||
@@ -27,8 +28,15 @@ document.addEventListener('readystatechange', async () => {
|
||||
}
|
||||
|
||||
resType = resKeys[0].split(' ')[0];
|
||||
// TODO use coordinates for map
|
||||
const coordinates = resource['Coordinates'];
|
||||
// TODO use match...
|
||||
const coordinates = resource['Object Coordinates']
|
||||
.replace(/^.*coordinates\':\s?\[(\d+\.\d+,\s?\d+\.\d+)\].*$/, "$1")
|
||||
.split(', ');
|
||||
|
||||
let lat, long;
|
||||
[long, lat] = coordinates;
|
||||
|
||||
attachMap([lat, long]);
|
||||
|
||||
resKeys = resKeys.filter(e => !e.includes('Coordinates'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user