mirror of
https://github.com/Findus23/RainbowRoad.git
synced 2024-09-19 16:03:52 +02:00
openlayers 10
This commit is contained in:
parent
3c64e8af00
commit
3c52318ebf
5 changed files with 704 additions and 282 deletions
969
package-lock.json
generated
969
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -30,7 +30,7 @@
|
||||||
"micromodal": "^0.4.10",
|
"micromodal": "^0.4.10",
|
||||||
"navigo": "^8.11.1",
|
"navigo": "^8.11.1",
|
||||||
"node-fetch": "^3.2.10",
|
"node-fetch": "^3.2.10",
|
||||||
"ol": "^9.0.0"
|
"ol": "^10.0.0"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
|
|
|
@ -41,7 +41,6 @@ const map = new Map({
|
||||||
url: "https://maps.lw1.at/tiles/1.0.0/tracestack/webmercator_hq/{z}/{x}/{y}.png",
|
url: "https://maps.lw1.at/tiles/1.0.0/tracestack/webmercator_hq/{z}/{x}/{y}.png",
|
||||||
tilePixelRatio: 5,
|
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>'],
|
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
|
crossOrigin: null
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -76,7 +76,9 @@ export function initPopups(map: Map, vectorSource: VectorSource) {
|
||||||
content.appendChild(p)
|
content.appendChild(p)
|
||||||
}
|
}
|
||||||
const sourcesBlock = displaySources(crossing.sources)
|
const sourcesBlock = displaySources(crossing.sources)
|
||||||
content.appendChild(createElement("hr"))
|
if (sourcesBlock.children.length !== 0) {
|
||||||
|
content.appendChild(createElement("hr"))
|
||||||
|
}
|
||||||
content.appendChild(sourcesBlock)
|
content.appendChild(sourcesBlock)
|
||||||
overlay.setPosition(feature.getGeometry()?.getCoordinates());
|
overlay.setPosition(feature.getGeometry()?.getCoordinates());
|
||||||
|
|
||||||
|
|
10
src/text.ts
10
src/text.ts
|
@ -7,15 +7,17 @@ export function prettyDate(isoDate: string): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function displaySources(sources: Source[]) {
|
export function displaySources(sources: Source[]) {
|
||||||
|
const urlSources = sources.filter(s => s.url)
|
||||||
const sourcesBlock = createElement("div")
|
const sourcesBlock = createElement("div")
|
||||||
|
if (urlSources.length === 0) {
|
||||||
|
return sourcesBlock
|
||||||
|
}
|
||||||
sourcesBlock.classList.add("sources")
|
sourcesBlock.classList.add("sources")
|
||||||
|
console.log(sources)
|
||||||
const heading = createElement("p")
|
const heading = createElement("p")
|
||||||
heading.innerText = "Weitere Infomationen:"
|
heading.innerText = "Weitere Infomationen:"
|
||||||
sourcesBlock.appendChild(heading)
|
sourcesBlock.appendChild(heading)
|
||||||
sources.forEach(s => {
|
urlSources.forEach(s => {
|
||||||
if (!s.url) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const img = createElement("img")
|
const img = createElement("img")
|
||||||
const a = createElement("a")
|
const a = createElement("a")
|
||||||
a.rel = "noopener"
|
a.rel = "noopener"
|
||||||
|
|
Loading…
Reference in a new issue