Feature(360): fix css, fix CSP

This commit is contained in:
Pieter Vander Vennet 2025-03-30 15:18:20 +02:00
parent 97df9abab2
commit a30f25f42a
4 changed files with 11 additions and 2 deletions

2
public/css/pannellum.css Normal file

File diff suppressed because one or more lines are too long

View file

@ -6,3 +6,4 @@
# So, we patch it up...
echo "Fixing pannellum..."
sed -i 's/^window./if(typeof window !== "undefined")\n&/' "./node_modules/pannellum/build/pannellum.js"
cp ./node_modules/pannellum/build/pannellum.css ./public/css/

View file

@ -166,6 +166,7 @@ class ImagesFromPanoramaxFetcher implements ImageFetcher {
private readonly _radius: number
private readonly _panoramax: Panoramax
name: string = "panoramax"
public static readonly apiUrls: ReadonlyArray<string> = ["https://panoramax.openstreetmap.fr", "https://api.panoramax.xyz", "https://panoramax.mapcomplete.org"]
constructor(url?: string, radius: number = 100) {
this._radius = radius
@ -216,6 +217,7 @@ class MapillaryFetcher implements ImageFetcher {
private readonly start_captured_at?: Date
private readonly end_captured_at?: Date
static apiUrls: string[] = ["*.fbcdn.net", "https://graph.mapillary.com"]
constructor(options?: {
panoramas?: undefined | "only" | "no"
@ -295,7 +297,11 @@ type P4CService = (typeof P4CImageFetcher.services)[number]
export class CombinedFetcher {
private readonly sources: ReadonlyArray<CachedFetcher>
public static apiUrls = [...P4CImageFetcher.apiUrls, Imgur.apiUrl, ...Imgur.supportingUrls]
public static apiUrls = [...P4CImageFetcher.apiUrls,
Imgur.apiUrl, ...Imgur.supportingUrls,
...MapillaryFetcher.apiUrls,
...ImagesFromPanoramaxFetcher.apiUrls
]
constructor(radius: number, maxage: Date, indexedFeatures: IndexedFeatureSource) {
this.sources = [

View file

@ -58,7 +58,7 @@
</script>
<head>
<link rel="stylesheet" href="./node_modules/pannellum/build/pannellum.css">
<link rel="stylesheet" href="./css/pannellum.css">
</head>
{#if image.isSpherical}
<div bind:this={viewerEl} class="w-full h-full" />