修复导览点位可见性与构建门禁
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
isIndoorNavigableFloor
|
||||
} from '@/domain/guideFloor'
|
||||
import {
|
||||
isVisitorRestrictedPlaceName,
|
||||
normalizePoiSemanticValue
|
||||
} from '@/domain/poiCategories'
|
||||
|
||||
@@ -193,6 +194,16 @@ const isPoiAccessible = (poi: StaticNavPoiPayload) => (
|
||||
|| poi.categories?.some((category) => category.topCategory === 'accessibility_special_service') === true
|
||||
)
|
||||
|
||||
const resolveStaticPoiVisitorVisible = (
|
||||
poi: StaticNavPoiPayload,
|
||||
semanticType: string
|
||||
) => (
|
||||
typeof poi.visitorVisible === 'boolean'
|
||||
? poi.visitorVisible
|
||||
: semanticType !== 'service_space'
|
||||
&& ![poi.name, poi.sourceObjectName].some(isVisitorRestrictedPlaceName)
|
||||
)
|
||||
|
||||
export const toMuseumPoi = (poi: StaticNavPoiPayload): MuseumPoi => {
|
||||
const categoryFallbackIconType = poi.categories?.[0]?.iconType
|
||||
const iconType = getStaticPoiSemanticType(poi, poi.iconType || categoryFallbackIconType)
|
||||
@@ -214,6 +225,7 @@ export const toMuseumPoi = (poi: StaticNavPoiPayload): MuseumPoi => {
|
||||
sourceObjectName: poi.sourceObjectName,
|
||||
sourceConfidence: poi.sourceConfidence,
|
||||
navigationReadiness: poi.navigationReadiness,
|
||||
visitorVisible: resolveStaticPoiVisitorVisible(poi, iconType),
|
||||
accessible: isPoiAccessible(poi),
|
||||
kind,
|
||||
hallName: kind === 'hall' ? poi.name : undefined
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
isIndoorNavigableFloor
|
||||
} from '@/domain/guideFloor'
|
||||
import {
|
||||
isVisitorRestrictedPlaceName,
|
||||
isPoiSearchCategorySupported,
|
||||
normalizePoiSemanticValue
|
||||
} from '@/domain/poiCategories'
|
||||
@@ -146,6 +147,7 @@ const spaceCategoryBySgsType: Record<string, MuseumCategory> = {
|
||||
const categoryBySgsType: Record<string, MuseumCategory & { accessible?: boolean }> = {
|
||||
exhibition_hall: hallCategory,
|
||||
theater: spaceCategoryBySgsType.theater,
|
||||
service_space: spaceCategoryBySgsType.service_space,
|
||||
commercial: spaceCategoryBySgsType.commercial,
|
||||
restaurant: spaceCategoryBySgsType.restaurant,
|
||||
cafe: spaceCategoryBySgsType.cafe,
|
||||
@@ -414,6 +416,25 @@ const categoryForBusinessType = (businessType?: string | null): MuseumCategory =
|
||||
}
|
||||
}
|
||||
|
||||
const resolveSgsPoiVisitorVisible = (
|
||||
source: {
|
||||
visitorVisible?: boolean | null
|
||||
name?: string | null
|
||||
sourceNodeName?: string | null
|
||||
anchorNodeName?: string | null
|
||||
},
|
||||
category: MuseumCategory
|
||||
) => (
|
||||
typeof source.visitorVisible === 'boolean'
|
||||
? source.visitorVisible
|
||||
: category.id !== 'space_service'
|
||||
&& ![
|
||||
source.name,
|
||||
source.sourceNodeName,
|
||||
source.anchorNodeName
|
||||
].some(isVisitorRestrictedPlaceName)
|
||||
)
|
||||
|
||||
interface SgsHallPoiBuildOptions {
|
||||
fallbackY?: number
|
||||
}
|
||||
@@ -658,9 +679,10 @@ export const toMuseumPoiFromSgs = (
|
||||
}
|
||||
],
|
||||
positionGltf: normalizePosition(poi),
|
||||
sourceObjectName: poi.anchorNodeName || undefined,
|
||||
sourceObjectName: poi.anchorNodeName || undefined,
|
||||
sourceConfidence: 'backend-sgs-sdk',
|
||||
navigationReadiness: '位置预览',
|
||||
visitorVisible: resolveSgsPoiVisitorVisible(poi, category),
|
||||
accessible: category.accessible === true,
|
||||
kind,
|
||||
hallId: kind === 'hall' ? spatialAreaId || stringifyId(poi.id) : undefined,
|
||||
@@ -825,6 +847,7 @@ export const toMuseumSpacePointFromSgs = (
|
||||
sourceObjectName: space.sourceNodeName || undefined,
|
||||
sourceConfidence: spacePosition.sourceConfidence,
|
||||
navigationReadiness: '位置预览',
|
||||
visitorVisible: resolveSgsPoiVisitorVisible(space, category),
|
||||
accessible: false,
|
||||
kind: 'space',
|
||||
hallId: category.id === hallCategory.id ? spaceId : undefined,
|
||||
@@ -895,8 +918,9 @@ const createSpaceFallbackHallPoi = (
|
||||
positionGltf: position,
|
||||
sourceObjectName: space.sourceNodeName || undefined,
|
||||
sourceConfidence: spacePosition.sourceConfidence,
|
||||
navigationReadiness: '位置预览',
|
||||
accessible: false,
|
||||
navigationReadiness: '位置预览',
|
||||
visitorVisible: resolveSgsPoiVisitorVisible(space, category),
|
||||
accessible: false,
|
||||
kind: 'hall',
|
||||
hallId,
|
||||
hallName: normalizedText(space.name),
|
||||
@@ -983,6 +1007,7 @@ export const toMuseumHallPoisFromSgs = (
|
||||
? spacePosition?.sourceConfidence || sgsSpaceCenterConfidence
|
||||
: sgsHallEntranceConfidence,
|
||||
navigationReadiness: '位置预览',
|
||||
visitorVisible: resolveSgsPoiVisitorVisible(matchedSpace, category),
|
||||
accessible: false,
|
||||
kind: 'hall',
|
||||
hallId,
|
||||
|
||||
@@ -65,6 +65,7 @@ export interface SgsPoiPayload {
|
||||
y?: number | null
|
||||
z?: number | null
|
||||
status?: string | null
|
||||
visitorVisible?: boolean | null
|
||||
anchorNodeName?: string | null
|
||||
description?: string | null
|
||||
iconUrl?: string | null
|
||||
@@ -87,6 +88,7 @@ export interface SgsSpacePayload {
|
||||
center?: SgsPositionPayload | null
|
||||
sourceNodeName?: string | null
|
||||
status?: string | null
|
||||
visitorVisible?: boolean | null
|
||||
colorHex?: string | null
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ export interface StaticNavPoiPayload {
|
||||
sourceObjectName?: string
|
||||
navigationReadiness?: string
|
||||
sourceConfidence?: string
|
||||
visitorVisible?: boolean | null
|
||||
}
|
||||
|
||||
export interface StaticNavManifestFloorModelPayload {
|
||||
|
||||
Reference in New Issue
Block a user