Compare commits
No commits in common. "6220dd76d5a70c1dc6fe27646367f73d969c8fc5" and "bd31c08c1655c4316ef33505be5421f1eb04570e" have entirely different histories.
6220dd76d5
...
bd31c08c16
|
@ -13,13 +13,11 @@ const res = await fetch("https://whereis.chandlerswift.com/api/0/last");
|
||||||
const locs = await res.json();
|
const locs = await res.json();
|
||||||
const loc = locs[0];
|
const loc = locs[0];
|
||||||
|
|
||||||
let geometry = new Point(fromLonLat([loc.lon, loc.lat]));
|
|
||||||
|
|
||||||
const vectorLayer = new VectorLayer({
|
const vectorLayer = new VectorLayer({
|
||||||
source: new VectorSource({
|
source: new VectorSource({
|
||||||
features: [
|
features: [
|
||||||
new Feature({
|
new Feature({
|
||||||
geometry: geometry,
|
geometry: new Point(fromLonLat([loc.lon, loc.lat])),
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
|
@ -31,11 +29,4 @@ const vectorLayer = new VectorLayer({
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
setInterval(async function(){
|
|
||||||
const res = await fetch("https://whereis.chandlerswift.com/api/0/last");
|
|
||||||
const locs = await res.json();
|
|
||||||
const loc = locs[0];
|
|
||||||
geometry.setCoordinates(fromLonLat([loc.lon, loc.lat]));
|
|
||||||
}, 10 * 1000);
|
|
||||||
|
|
||||||
export default vectorLayer;
|
export default vectorLayer;
|
||||||
|
|
|
@ -25,5 +25,4 @@ let layers = [];
|
||||||
export default {
|
export default {
|
||||||
name: "Light Pollution",
|
name: "Light Pollution",
|
||||||
layers: layers,
|
layers: layers,
|
||||||
details: "For legend and more information, see <a href='https://www.cleardarksky.com/'>cleardarksky.com</a>.",
|
|
||||||
};
|
};
|
||||||
|
|
1
main.js
1
main.js
|
@ -28,7 +28,6 @@ for (let category of layerCategories) {
|
||||||
catDiv.innerHTML = `
|
catDiv.innerHTML = `
|
||||||
<details ${category.layers.filter(l => l.enabled).length > 0 ? "open" : ""}>
|
<details ${category.layers.filter(l => l.enabled).length > 0 ? "open" : ""}>
|
||||||
<summary>${category.name}</summary>
|
<summary>${category.name}</summary>
|
||||||
${category.details ? "<p>" + category.details + "</p>" : ""}
|
|
||||||
<ul></ul>
|
<ul></ul>
|
||||||
</details>
|
</details>
|
||||||
`;
|
`;
|
||||||
|
|
Loading…
Reference in a new issue