1
0
Fork 0
mirror of https://github.com/Findus23/RainbowRoad.git synced 2024-09-16 12:33:51 +02:00

openlayers 10

This commit is contained in:
Lukas Winkler 2024-08-10 14:55:22 +02:00
parent 3c64e8af00
commit 3c52318ebf
Signed by: lukas
GPG key ID: 54DE4D798D244853
5 changed files with 704 additions and 282 deletions

969
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -30,7 +30,7 @@
"micromodal": "^0.4.10",
"navigo": "^8.11.1",
"node-fetch": "^3.2.10",
"ol": "^9.0.0"
"ol": "^10.0.0"
},
"author": "",
"license": "ISC"

View file

@ -41,7 +41,6 @@ const map = new Map({
url: "https://maps.lw1.at/tiles/1.0.0/tracestack/webmercator_hq/{z}/{x}/{y}.png",
tilePixelRatio: 5,
attributions: ['Data: © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>, <a href="http://viewfinderpanoramas.org/">SRTM</a>, <a href="https://portal.opentopography.org/datasetMetadata?otCollectionID=OT.032021.4326.2">NASADEM</a>, <a href="https://worldcover2021.esa.int">ESA WorldCover</a>; Maps © <a href="https://www.tracestrack.com/">Tracestrack</a>'],
opaque: true,
crossOrigin: null
}),
}),

View file

@ -76,7 +76,9 @@ export function initPopups(map: Map, vectorSource: VectorSource) {
content.appendChild(p)
}
const sourcesBlock = displaySources(crossing.sources)
content.appendChild(createElement("hr"))
if (sourcesBlock.children.length !== 0) {
content.appendChild(createElement("hr"))
}
content.appendChild(sourcesBlock)
overlay.setPosition(feature.getGeometry()?.getCoordinates());

View file

@ -7,15 +7,17 @@ export function prettyDate(isoDate: string): string {
}
export function displaySources(sources: Source[]) {
const urlSources = sources.filter(s => s.url)
const sourcesBlock = createElement("div")
if (urlSources.length === 0) {
return sourcesBlock
}
sourcesBlock.classList.add("sources")
console.log(sources)
const heading = createElement("p")
heading.innerText = "Weitere Infomationen:"
sourcesBlock.appendChild(heading)
sources.forEach(s => {
if (!s.url) {
return
}
urlSources.forEach(s => {
const img = createElement("img")
const a = createElement("a")
a.rel = "noopener"