Fix: license info in 'nearby images' now works for mapillary, add bbox search for panoramax

This commit is contained in:
Pieter Vander Vennet 2025-05-12 11:37:26 +02:00
parent 14fd4e0f4f
commit 7f5544c1e5
6 changed files with 47 additions and 15 deletions

View file

@ -7,7 +7,7 @@
import type { SpecialVisualizationState } from "../SpecialVisualization"
import type { P4CPicture } from "../../Logic/Web/NearbyImagesSearch"
import LinkableImage from "./LinkableImage.svelte"
import type { Feature, Point } from "geojson"
import type { Feature, Geometry, Point } from "geojson"
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
import Loading from "../Base/Loading.svelte"
import AllImageProviders from "../../Logic/ImageProviders/AllImageProviders"
@ -25,7 +25,7 @@
import { BBox } from "../../Logic/BBox"
import PanoramaxLink from "../BigComponents/PanoramaxLink.svelte"
import { GeoOperations } from "../../Logic/GeoOperations"
import type { PanoramaView } from "../../Logic/ImageProviders/ImageProvider"
import type { HotspotProperties, PanoramaView } from "../../Logic/ImageProviders/ImageProvider"
export let tags: UIEventSource<OsmTags>
export let state: SpecialVisualizationState
@ -52,6 +52,7 @@
[loadedImages]
)
// Panorama-views get a geojson feature to browse around
let asFeatures = result.map((p4cs) =>
p4cs.map(
(p4c) =>
@ -147,25 +148,27 @@
highlighted.set(feature.properties.id)
},
})
let nearbyFeatures: Store<Feature[]> = asFeatures.map((nearbyPoints) => {
let nearbyFeatures: Store<Feature<Geometry, HotspotProperties>[]> = asFeatures.map((nearbyPoints) => {
return [
{
type: "Feature",
geometry: { type: "Point", coordinates: GeoOperations.centerpointCoordinates(feature) },
properties: {
properties: <HotspotProperties>{
name: layer.title?.GetRenderValue(feature.properties).Subs(feature.properties).txt,
focus: true,
},
},
...nearbyPoints
.filter((p) => p.properties.spherical === "yes")
.filter((p) => p.properties["spherical"] === "yes")
.map((f) => ({
...f,
properties: {
properties: <HotspotProperties>{
name: "Nearby panorama",
pitch: "auto",
type: "scene",
gotoPanorama: f,
focus: false
},
})),
]