@@ -7,6 +7,9 @@ import type {
|
||||
import type {
|
||||
MuseumPoi
|
||||
} from '@/domain/museum'
|
||||
import {
|
||||
getPoiDisplayPolicy
|
||||
} from '@/domain/poiDisplay'
|
||||
import {
|
||||
dataSourceConfig
|
||||
} from '@/config/dataSource'
|
||||
@@ -56,18 +59,25 @@ const getNow = () => (
|
||||
: Date.now()
|
||||
)
|
||||
|
||||
const toRenderPoi = (poi: StaticNavPoiPayload): GuideRenderPoi => ({
|
||||
id: poi.id,
|
||||
name: poi.name,
|
||||
floorId: poi.floorId,
|
||||
primaryCategory: poi.primaryCategory,
|
||||
primaryCategoryZh: poi.primaryCategoryZh,
|
||||
iconType: poi.iconType || poi.primaryCategory,
|
||||
positionGltf: poi.positionGltf,
|
||||
sourceObjectName: poi.sourceObjectName,
|
||||
kind: poi.primaryCategory === 'touring_poi' ? 'hall' : 'facility',
|
||||
hallName: poi.primaryCategory === 'touring_poi' ? poi.name : undefined
|
||||
})
|
||||
const toRenderPoi = (poi: StaticNavPoiPayload): GuideRenderPoi => {
|
||||
const kind = poi.primaryCategory === 'touring_poi' ? 'hall' : 'facility'
|
||||
return {
|
||||
id: poi.id,
|
||||
name: poi.name,
|
||||
floorId: poi.floorId,
|
||||
primaryCategory: poi.primaryCategory,
|
||||
primaryCategoryZh: poi.primaryCategoryZh,
|
||||
iconType: poi.iconType || poi.primaryCategory,
|
||||
positionGltf: poi.positionGltf,
|
||||
sourceObjectName: poi.sourceObjectName,
|
||||
kind,
|
||||
hallName: poi.primaryCategory === 'touring_poi' ? poi.name : undefined,
|
||||
displayPolicy: getPoiDisplayPolicy({
|
||||
primaryCategory: poi.primaryCategory,
|
||||
kind
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const toGuideRenderPoi = (poi: MuseumPoi): GuideRenderPoi => ({
|
||||
id: poi.id,
|
||||
@@ -84,7 +94,11 @@ const toGuideRenderPoi = (poi: MuseumPoi): GuideRenderPoi => ({
|
||||
spaceId: poi.spaceId,
|
||||
sourcePlaceId: poi.sourcePlaceId,
|
||||
sourceSpaceId: poi.sourceSpaceId,
|
||||
entrances: poi.entrances
|
||||
entrances: poi.entrances,
|
||||
displayPolicy: poi.displayPolicy || getPoiDisplayPolicy({
|
||||
primaryCategory: poi.primaryCategory.id,
|
||||
kind: poi.kind
|
||||
})
|
||||
})
|
||||
|
||||
const toSgsRenderPoi = (poi: ReturnType<typeof toMuseumPoiFromSgs>) => toGuideRenderPoi(poi)
|
||||
|
||||
Reference in New Issue
Block a user