Compare commits

...

4 commits

Author SHA1 Message Date
8c1a73c9d5
Fix: deduplicate .gitignore and reorder 2024-12-18 02:12:58 +01:00
c88ffdae55
Fix: remove checked-in file that is covered by .gitignore 2024-12-18 02:12:00 +01:00
375913492c
Fix: order of commands in npm run init
ELI should be downloaded before generate, because it depends on that
file. After clearing the generated assets directory, npm run init failed,
this commit fixes that.
2024-12-18 01:42:15 +01:00
Pieter Vander Vennet
6cb16877e8 Fix: imagepreview: improve typing; fix comparison tool 2024-12-17 19:03:05 +01:00
7 changed files with 13 additions and 143 deletions

6
.gitignore vendored
View file

@ -4,9 +4,10 @@ node_modules
.cache/*
.idea/*
scratch
src/assets/editor-layer-index.json
src/assets/generated/
assets/editor-layer-index.json
assets/generated/*
src/assets/generated/
assets/layers/favourite/favourite.json
public/*.webmanifest
/*.html
@ -20,8 +21,6 @@ missing_translations.txt
.DS_Store
Svg.ts
data/
src/assets/generated/nsi_stats/brand.json
src/assets/generated/nsi_stats/brand.summarized.json
Folder.DotSettings.user
index_*.ts
@ -29,7 +28,6 @@ index_*.ts
*.doctest.ts
service-worker.js
.env
src/assets/editor-layer-index.json
error_changeset_*

View file

@ -77,7 +77,7 @@
}
},
"scripts": {
"init": "npm ci && npm run prep:layeroverview && npm run generate && npm run download:editor-layer-index && npm run generate:layouts && npm run clean",
"init": "npm ci && npm run prep:layeroverview && npm run download:editor-layer-index && npm run generate && npm run generate:layouts && npm run clean",
"start": "npm run generate:layeroverview && npm run strt",
"strt": "vite --host | sed 's/localhost:/127.0.0.1:/g'",
"build": "./scripts/build.sh",

View file

@ -137,7 +137,7 @@
<AttributedImage
{state}
imgClass="h-32 shrink-0"
image={{ url: image }}
image={{ url: image, id: image }}
previewedImage={state.previewedImage}
/>
</div>

View file

@ -28,7 +28,7 @@
export let imgClass: string = undefined
export let state: SpecialVisualizationState = undefined
export let attributionFormat: "minimal" | "medium" | "large" = "medium"
export let previewedImage: UIEventSource<ProvidedImage> = undefined
export let previewedImage: UIEventSource<Partial<ProvidedImage>> = undefined
export let canZoom = previewedImage !== undefined
let loaded = false
let showBigPreview = new UIEventSource(false)
@ -37,13 +37,13 @@
if (!shown) {
previewedImage?.set(undefined)
}
})
}),
)
if (previewedImage) {
onDestroy(
previewedImage.addCallbackAndRun((previewedImage) => {
showBigPreview.set(previewedImage !== undefined && previewedImage?.id === image.id)
})
showBigPreview.set(previewedImage !== undefined && (previewedImage?.id ?? previewedImage?.url) === (image.id ?? image.url))
}),
)
}
@ -89,6 +89,8 @@
/>
</div>
</Popup>
{#if image.status !== undefined && image.status !== "ready" && image.status !== "hidden"}
<div class="flex h-full flex-col justify-center">
<Loading>
@ -113,6 +115,7 @@
class={imgClass ?? ""}
class:cursor-zoom-in={canZoom}
on:click={() => {
console.log("Setting",image.url)
previewedImage?.set(image)
}}
on:error={() => {

View file

@ -15,7 +15,7 @@
import Translations from "../i18n/Translations"
import DotMenu from "../Base/DotMenu.svelte"
export let image: ProvidedImage
export let image: Partial<ProvidedImage> & ({ id: string, url: string })
export let clss: string = undefined
let isLoaded = new UIEventSource(false)

View file

@ -8,7 +8,7 @@
import Zoomcontrol from "../Zoomcontrol"
import { onDestroy } from "svelte"
export let image: ProvidedImage
export let image: Partial<ProvidedImage>
let panzoomInstance = undefined
let panzoomEl: HTMLElement
export let isLoaded: UIEventSource<boolean> = undefined

View file

@ -1,131 +0,0 @@
[
{
"name": "CyclOSM",
"id": "cyclosm",
"url": "https://{switch:a,b,c}.tile-cyclosm.openstreetmap.fr/cyclosm/{zoom}/{x}/{y}.png",
"attribution": {
"text": "Rendering: CyclOSM (hosted by OpenStreetMap France) © Map data OpenStreetMap contributors",
"url": "https://www.cyclosm.org/"
},
"type": "tms",
"category": "osmbasedmap",
"max_zoom": 20
},
{
"name": "Esri World Imagery",
"id": "EsriWorldImagery",
"url": "https://{switch:services,server}.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{zoom}/{y}/{x}",
"attribution": {
"required": true,
"text": "Terms & Feedback",
"url": "https://wiki.openstreetmap.org/wiki/Esri"
},
"type": "tms",
"category": "photo",
"max_zoom": 22,
"default": true
},
{
"name": "Esri World Imagery (Clarity) Beta",
"id": "EsriWorldImageryClarity",
"url": "https://clarity.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/MapServer/tile/{zoom}/{y}/{x}",
"attribution": {
"required": true,
"text": "Terms & Feedback",
"url": "https://wiki.openstreetmap.org/wiki/Esri"
},
"type": "tms",
"category": "photo",
"max_zoom": 22,
"default": true
},
{
"name": "Mapbox Satellite",
"id": "Mapbox",
"url": "https://{switch:a,b,c,d}.tiles.mapbox.com/v4/mapbox.satellite/{zoom}/{x}/{y}.jpg?access_token=pk.eyJ1Ijoib3BlbnN0cmVldG1hcCIsImEiOiJjbGZkempiNDkyandvM3lwY3M4MndpdWdzIn0.QnvRv52n3qffVEKmQa9vJA",
"attribution": {
"required": true,
"text": "Terms & Feedback",
"url": "https://www.mapbox.com/about/maps"
},
"type": "tms",
"category": "photo",
"max_zoom": 22,
"default": true
},
{
"name": "OpenAerialMap Mosaic, by Kontur.io",
"id": "OpenAerialMapMosaic",
"url": "https://apps.kontur.io/raster-tiler/oam/mosaic/{zoom}/{x}/{y}.png",
"type": "tms",
"category": "photo",
"min_zoom": 1,
"max_zoom": 31,
"default": true
},
{
"name": "OpenStreetMap (Basque Style)",
"id": "osmfr-basque",
"url": "https://tile.openstreetmap.bzh/eu/{zoom}/{x}/{y}.png",
"attribution": {
"required": true,
"text": "Tiles © OpenStreetMap France, data © OpenStreetMap contributors, ODbL",
"url": "https://www.openstreetmap.org/"
},
"type": "tms",
"category": "osmbasedmap",
"max_zoom": 20
},
{
"name": "OpenStreetMap (Breton Style)",
"id": "osmfr-breton",
"url": "https://tile.openstreetmap.bzh/br/{zoom}/{x}/{y}.png",
"attribution": {
"required": true,
"text": "Tiles © OpenStreetMap France, data © OpenStreetMap contributors, ODbL",
"url": "https://www.openstreetmap.org/"
},
"type": "tms",
"category": "osmbasedmap",
"max_zoom": 20
},
{
"name": "OpenStreetMap (French Style)",
"id": "osmfr",
"url": "https://{switch:a,b,c}.tile.openstreetmap.fr/osmfr/{zoom}/{x}/{y}.png",
"attribution": {
"required": true,
"text": "Tiles © cquest@Openstreetmap France, data © OpenStreetMap contributors, ODBL",
"url": "https://www.openstreetmap.org/"
},
"type": "tms",
"category": "osmbasedmap",
"max_zoom": 20
},
{
"name": "OpenStreetMap (HOT Style)",
"id": "HDM_HOT",
"url": "https://{switch:a,b,c}.tile.openstreetmap.fr/hot/{zoom}/{x}/{y}.png",
"attribution": {
"required": true,
"text": "© OpenStreetMap contributors, tiles courtesy of Humanitarian OpenStreetMap Team",
"url": "https://www.hotosm.org/"
},
"type": "tms",
"category": "osmbasedmap",
"max_zoom": 20
},
{
"name": "OpenStreetMap (Occitan Style)",
"id": "osmfr-occitan",
"url": "https://tile.openstreetmap.bzh/oc/{zoom}/{x}/{y}.png",
"attribution": {
"required": true,
"text": "Tiles © OpenStreetMap France, data © OpenStreetMap contributors, ODbL",
"url": "https://www.openstreetmap.org/"
},
"type": "tms",
"category": "osmbasedmap",
"max_zoom": 20
}
]