@twinmatrix/spatialverse-sdk-web 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +9 -9
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js +213 -294
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js +40 -41
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/3DMap/MainMap.js +170 -196
- package/lib/cjs/meta-atlas-sdk/3DMap/MainMap.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js +167 -215
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.js +28 -30
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js +861 -1170
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js +166 -159
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/interfaces.js +6 -6
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/interfaces.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/mapObjectsHelper.js +6 -6
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/mapObjectsHelper.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routeLayers.js +3 -3
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routeLayers.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js +523 -610
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js +149 -154
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/customStyles.js +2 -2
- package/lib/cjs/meta-atlas-sdk/customStyles.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/customerLayer.js +15 -29
- package/lib/cjs/meta-atlas-sdk/customerLayer.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/customerLayerVariant.js +5 -5
- package/lib/cjs/meta-atlas-sdk/customerLayerVariant.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/meta-atlas-sdk.js +809 -1033
- package/lib/cjs/meta-atlas-sdk/meta-atlas-sdk.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/helpers.js +32 -49
- package/lib/cjs/meta-atlas-sdk/utils/helpers.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/local-storage.js +21 -34
- package/lib/cjs/meta-atlas-sdk/utils/local-storage.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/mapobjects-store.js +6 -6
- package/lib/cjs/meta-atlas-sdk/utils/mapobjects-store.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/routing-store.js +6 -6
- package/lib/cjs/meta-atlas-sdk/utils/routing-store.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/routing-visualizer/index.js +363 -491
- package/lib/cjs/meta-atlas-sdk/utils/routing-visualizer/index.js.map +1 -1
- package/lib/cjs/react/MetaAtlasMap.js +127 -0
- package/lib/cjs/react/MetaAtlasMap.js.map +1 -0
- package/lib/cjs/react/hooks/useDrawing/index.js +17 -18
- package/lib/cjs/react/hooks/useDrawing/index.js.map +1 -1
- package/lib/cjs/react/hooks/useFocus/index.js +48 -55
- package/lib/cjs/react/hooks/useFocus/index.js.map +1 -1
- package/lib/cjs/react/hooks/useMapEvents/index.js +40 -47
- package/lib/cjs/react/hooks/useMapEvents/index.js.map +1 -1
- package/lib/cjs/react/hooks/useMapOverlays/index.js +20 -21
- package/lib/cjs/react/hooks/useMapOverlays/index.js.map +1 -1
- package/lib/cjs/react/hooks/useMetaAtlas/index.js +77 -95
- package/lib/cjs/react/hooks/useMetaAtlas/index.js.map +1 -1
- package/lib/cjs/react/hooks/useMetaAtlas.js +78 -96
- package/lib/cjs/react/hooks/useMetaAtlas.js.map +1 -1
- package/lib/cjs/react/hooks/useRouting/index.js +21 -20
- package/lib/cjs/react/hooks/useRouting/index.js.map +1 -1
- package/lib/cjs/react/hooks/useSearch/index.js +35 -34
- package/lib/cjs/react/hooks/useSearch/index.js.map +1 -1
- package/lib/cjs/react/hooks/useStampRally/index.js +26 -23
- package/lib/cjs/react/hooks/useStampRally/index.js.map +1 -1
- package/lib/cjs/react/hooks/useStampRally/utils.js +2 -2
- package/lib/cjs/react/hooks/useStampRally/utils.js.map +1 -1
- package/lib/cjs/react/index.js +31 -31
- package/lib/cjs/react/index.js.map +1 -1
- package/lib/cjs/react/stores/useMapDataStore.js +47 -62
- package/lib/cjs/react/stores/useMapDataStore.js.map +1 -1
- package/lib/cjs/react/stores/useMetaAtlasStore.js +27 -40
- package/lib/cjs/react/stores/useMetaAtlasStore.js.map +1 -1
- package/lib/esm/index.js +3 -7
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js +4 -3
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js +14 -12
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/3DMap/MainMap.js +204 -200
- package/lib/esm/meta-atlas-sdk/3DMap/MainMap.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js +6 -6
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.js +4 -3
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js +53 -42
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js +18 -16
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/mapObjectsHelper.js +3 -3
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/mapObjectsHelper.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js +73 -79
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js +16 -15
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/customerLayer.js +4 -1
- package/lib/esm/meta-atlas-sdk/customerLayer.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/meta-atlas-sdk.js +148 -124
- package/lib/esm/meta-atlas-sdk/meta-atlas-sdk.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/utils/helpers.js +4 -2
- package/lib/esm/meta-atlas-sdk/utils/helpers.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/utils/local-storage.js +6 -1
- package/lib/esm/meta-atlas-sdk/utils/local-storage.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/utils/routing-visualizer/index.js +115 -109
- package/lib/esm/meta-atlas-sdk/utils/routing-visualizer/index.js.map +1 -1
- package/lib/esm/react/MetaAtlasMap.js +120 -0
- package/lib/esm/react/MetaAtlasMap.js.map +1 -0
- package/lib/esm/react/hooks/useDrawing/index.js +2 -2
- package/lib/esm/react/hooks/useDrawing/index.js.map +1 -1
- package/lib/esm/react/hooks/useFocus/index.js +4 -3
- package/lib/esm/react/hooks/useFocus/index.js.map +1 -1
- package/lib/esm/react/hooks/useMapEvents/index.js +9 -6
- package/lib/esm/react/hooks/useMapEvents/index.js.map +1 -1
- package/lib/esm/react/hooks/useMapOverlays/index.js +2 -2
- package/lib/esm/react/hooks/useMapOverlays/index.js.map +1 -1
- package/lib/esm/react/hooks/useMetaAtlas/index.js +162 -60
- package/lib/esm/react/hooks/useMetaAtlas/index.js.map +1 -1
- package/lib/esm/react/hooks/useMetaAtlas.js +162 -60
- package/lib/esm/react/hooks/useMetaAtlas.js.map +1 -1
- package/lib/esm/react/hooks/useRouting/index.js +2 -2
- package/lib/esm/react/hooks/useRouting/index.js.map +1 -1
- package/lib/esm/react/hooks/useSearch/index.js +2 -2
- package/lib/esm/react/hooks/useSearch/index.js.map +1 -1
- package/lib/esm/react/hooks/useStampRally/index.js +15 -12
- package/lib/esm/react/hooks/useStampRally/index.js.map +1 -1
- package/lib/esm/react/hooks/useStampRally/utils.js +1 -1
- package/lib/esm/react/hooks/useStampRally/utils.js.map +1 -1
- package/lib/esm/react/index.js +11 -15
- package/lib/esm/react/index.js.map +1 -1
- package/lib/esm/react/stores/useMapDataStore.js +17 -21
- package/lib/esm/react/stores/useMapDataStore.js.map +1 -1
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.d.ts +30 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.d.ts.map +1 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.d.ts +5 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.d.ts.map +1 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.d.ts +21 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.d.ts.map +1 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.d.ts +27 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.d.ts.map +1 -0
- package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.d.ts +18 -0
- package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.d.ts.map +1 -0
- package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.d.ts +37 -0
- package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.d.ts.map +1 -0
- package/package.json +10 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchMapObjectsData.js","names":["cloneDeep","LineDirection","RouteDimension","useRouteDataStore","nearestPointOnLine","distance","lineString","cleanCoords","getEdgeData","mapObjectId","routeData","getState","data","hasOwnProperty","Edge","edges","undefined","routeNetworkData","getRouteNetworkData","whereDimension","length","console","error","minDistance","Infinity","closestPoint","closestLine","map","lineFeature","cleanedFeature","nearestPoint","sourceCoords","dist","geometry","coordinates","linesCoords","lineProps","title","zone","properties","wheelchair","direction","TwoWay","dimension_where","lines","edge","id","name","coords","where","what","includeChildren","Network","completeRouteNetworkData","whereDimensionRouteNetworkData","index","feature","includes","push","getPortalLinks","edgeData","portalEdgeData","portal","getPortalDataForIds","mapObjectIds","filteredEdgeData","Object","keys","filter","key","reduce","obj","getImmigrationDataForTaxonomy1","taxonomy1Path"],"sources":["../../../../src/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.ts"],"sourcesContent":["import { cloneDeep } from 'lodash';\nimport {Edge, LineDirection, RouteDimension, UserPosition} from './routing-core/interfaces';\nimport useRouteDataStore from '../utils/routing-store';\nimport nearestPointOnLine from '@turf/nearest-point-on-line';\nimport distance from '@turf/distance';\nimport { lineString, cleanCoords } from '@turf/turf';\n\nexport function getEdgeData(mapObjectId: string | UserPosition) {\n const routeData = useRouteDataStore.getState().data;\n\n if(typeof(mapObjectId) === 'string'){\n if (\n !mapObjectId ||\n !routeData.hasOwnProperty(RouteDimension.Edge) ||\n !routeData[RouteDimension.Edge].edges.hasOwnProperty(mapObjectId)\n ) {\n return undefined;\n }\n \n return cloneDeep(routeData[RouteDimension.Edge].edges[mapObjectId]);\n }\n else {\n const routeNetworkData = getRouteNetworkData(mapObjectId.whereDimension);\n if(routeNetworkData.length < 1){\n console.error('RouteNetworkData is empty');\n return null;\n }\n let minDistance = Infinity;\n let closestPoint;\n let closestLine;\n routeNetworkData.map((lineFeature)=>{\n const cleanedFeature = cleanCoords(lineFeature);\n const nearestPoint = nearestPointOnLine(cleanedFeature, mapObjectId.sourceCoords);\n const dist = distance(nearestPoint.geometry.coordinates, mapObjectId.sourceCoords);\n if(dist < minDistance){\n minDistance = dist;\n closestPoint = nearestPoint;\n closestLine = lineFeature;\n }\n })\n const linesCoords = [mapObjectId.sourceCoords, closestPoint.geometry.coordinates];\n const lineProps = {\n title: 'user_edgeLine',\n zone: closestLine.properties.zone,\n wheelchair: 1,\n direction: LineDirection.TwoWay,\n dimension_where: mapObjectId.whereDimension\n };\n const lines = [lineString(linesCoords, lineProps)];\n const edge: Edge = {\n id: 'user_position',\n name: 'Custom Position',\n coords: mapObjectId.sourceCoords,\n lines: lines,\n where: mapObjectId.whereDimension,\n what: '',\n zone: closestLine.properties.zone\n };\n routeData[RouteDimension.Edge][edge.id] = edge;\n return edge;\n }\n}\n\n\nexport function getRouteNetworkData(whereDimension: string, includeChildren = true) {\n const routeData = useRouteDataStore.getState().data;\n if (!routeData.hasOwnProperty(RouteDimension.Network)) {\n return [];\n }\n\n const completeRouteNetworkData = routeData[RouteDimension.Network];\n const whereDimensionRouteNetworkData = [];\n for (let index = 0; index < completeRouteNetworkData.length; index++) {\n const feature = completeRouteNetworkData[index];\n if (feature && feature.properties && feature.properties.dimension_where) {\n if (includeChildren) {\n if (feature.properties.dimension_where.includes(whereDimension)) {\n whereDimensionRouteNetworkData.push(feature);\n }\n }\n else {\n if (feature.properties.dimension_where === (whereDimension)) {\n whereDimensionRouteNetworkData.push(feature);\n }\n }\n }\n }\n\n return cloneDeep(whereDimensionRouteNetworkData);\n}\n\n// NOTE: whereDimension is unused at the moment, as we are fetching the whole portal data at once on the algorithm side now.\nexport function getPortalLinks(whereDimension: string) {\n const routeData = useRouteDataStore.getState().data;\n if (!routeData.hasOwnProperty('portal')) {\n return {\n edgeData: {},\n lines: []\n };\n }\n\n const portalEdgeData = routeData.portal;\n return portalEdgeData;\n}\n\nexport function getPortalDataForIds(mapObjectIds: string[]) {\n const routeData = useRouteDataStore.getState().data;\n if (!routeData.hasOwnProperty('portal')) {\n return {};\n }\n\n const portalEdgeData = routeData.portal;\n\n // PortalEdgeData will include information for both anchor and non-anchor lifts, so filter to keep only required data\n const filteredEdgeData = Object.keys(portalEdgeData.edgeData)\n .filter((key) => mapObjectIds.includes(key))\n .reduce((obj: any, key) => {\n obj[key] = portalEdgeData.edgeData[key];\n return obj;\n }, {});\n\n return {\n edgeData: filteredEdgeData,\n lines: portalEdgeData.lines,\n };\n}\n\nexport function getImmigrationDataForTaxonomy1(taxonomy1Path: string) {\n const routeData = useRouteDataStore.getState().data;\n if (\n !taxonomy1Path ||\n !routeData.hasOwnProperty('what.service.immigration') ||\n !routeData['what.service.immigration'].hasOwnProperty(taxonomy1Path)\n ) {\n return [];\n }\n return routeData['what.service.immigration'][taxonomy1Path];\n}\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,QAAQ;
|
|
1
|
+
{"version":3,"file":"fetchMapObjectsData.js","names":["cloneDeep","LineDirection","RouteDimension","useRouteDataStore","nearestPointOnLine","distance","lineString","cleanCoords","getEdgeData","mapObjectId","routeData","getState","data","hasOwnProperty","Edge","edges","undefined","routeNetworkData","getRouteNetworkData","whereDimension","length","console","error","minDistance","Infinity","closestPoint","closestLine","map","lineFeature","cleanedFeature","nearestPoint","sourceCoords","dist","geometry","coordinates","linesCoords","lineProps","title","zone","properties","wheelchair","direction","TwoWay","dimension_where","lines","edge","id","name","coords","where","what","includeChildren","arguments","Network","completeRouteNetworkData","whereDimensionRouteNetworkData","index","feature","includes","push","getPortalLinks","edgeData","portalEdgeData","portal","getPortalDataForIds","mapObjectIds","filteredEdgeData","Object","keys","filter","key","reduce","obj","getImmigrationDataForTaxonomy1","taxonomy1Path"],"sources":["../../../../src/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.ts"],"sourcesContent":["import { cloneDeep } from 'lodash';\nimport {Edge, LineDirection, RouteDimension, UserPosition} from './routing-core/interfaces';\nimport useRouteDataStore from '../utils/routing-store';\nimport nearestPointOnLine from '@turf/nearest-point-on-line';\nimport distance from '@turf/distance';\nimport { lineString, cleanCoords } from '@turf/turf';\n\nexport function getEdgeData(mapObjectId: string | UserPosition) {\n const routeData = useRouteDataStore.getState().data;\n\n if(typeof(mapObjectId) === 'string'){\n if (\n !mapObjectId ||\n !routeData.hasOwnProperty(RouteDimension.Edge) ||\n !routeData[RouteDimension.Edge].edges.hasOwnProperty(mapObjectId)\n ) {\n return undefined;\n }\n \n return cloneDeep(routeData[RouteDimension.Edge].edges[mapObjectId]);\n }\n else {\n const routeNetworkData = getRouteNetworkData(mapObjectId.whereDimension);\n if(routeNetworkData.length < 1){\n console.error('RouteNetworkData is empty');\n return null;\n }\n let minDistance = Infinity;\n let closestPoint;\n let closestLine;\n routeNetworkData.map((lineFeature)=>{\n const cleanedFeature = cleanCoords(lineFeature);\n const nearestPoint = nearestPointOnLine(cleanedFeature, mapObjectId.sourceCoords);\n const dist = distance(nearestPoint.geometry.coordinates, mapObjectId.sourceCoords);\n if(dist < minDistance){\n minDistance = dist;\n closestPoint = nearestPoint;\n closestLine = lineFeature;\n }\n })\n const linesCoords = [mapObjectId.sourceCoords, closestPoint.geometry.coordinates];\n const lineProps = {\n title: 'user_edgeLine',\n zone: closestLine.properties.zone,\n wheelchair: 1,\n direction: LineDirection.TwoWay,\n dimension_where: mapObjectId.whereDimension\n };\n const lines = [lineString(linesCoords, lineProps)];\n const edge: Edge = {\n id: 'user_position',\n name: 'Custom Position',\n coords: mapObjectId.sourceCoords,\n lines: lines,\n where: mapObjectId.whereDimension,\n what: '',\n zone: closestLine.properties.zone\n };\n routeData[RouteDimension.Edge][edge.id] = edge;\n return edge;\n }\n}\n\n\nexport function getRouteNetworkData(whereDimension: string, includeChildren = true) {\n const routeData = useRouteDataStore.getState().data;\n if (!routeData.hasOwnProperty(RouteDimension.Network)) {\n return [];\n }\n\n const completeRouteNetworkData = routeData[RouteDimension.Network];\n const whereDimensionRouteNetworkData = [];\n for (let index = 0; index < completeRouteNetworkData.length; index++) {\n const feature = completeRouteNetworkData[index];\n if (feature && feature.properties && feature.properties.dimension_where) {\n if (includeChildren) {\n if (feature.properties.dimension_where.includes(whereDimension)) {\n whereDimensionRouteNetworkData.push(feature);\n }\n }\n else {\n if (feature.properties.dimension_where === (whereDimension)) {\n whereDimensionRouteNetworkData.push(feature);\n }\n }\n }\n }\n\n return cloneDeep(whereDimensionRouteNetworkData);\n}\n\n// NOTE: whereDimension is unused at the moment, as we are fetching the whole portal data at once on the algorithm side now.\nexport function getPortalLinks(whereDimension: string) {\n const routeData = useRouteDataStore.getState().data;\n if (!routeData.hasOwnProperty('portal')) {\n return {\n edgeData: {},\n lines: []\n };\n }\n\n const portalEdgeData = routeData.portal;\n return portalEdgeData;\n}\n\nexport function getPortalDataForIds(mapObjectIds: string[]) {\n const routeData = useRouteDataStore.getState().data;\n if (!routeData.hasOwnProperty('portal')) {\n return {};\n }\n\n const portalEdgeData = routeData.portal;\n\n // PortalEdgeData will include information for both anchor and non-anchor lifts, so filter to keep only required data\n const filteredEdgeData = Object.keys(portalEdgeData.edgeData)\n .filter((key) => mapObjectIds.includes(key))\n .reduce((obj: any, key) => {\n obj[key] = portalEdgeData.edgeData[key];\n return obj;\n }, {});\n\n return {\n edgeData: filteredEdgeData,\n lines: portalEdgeData.lines,\n };\n}\n\nexport function getImmigrationDataForTaxonomy1(taxonomy1Path: string) {\n const routeData = useRouteDataStore.getState().data;\n if (\n !taxonomy1Path ||\n !routeData.hasOwnProperty('what.service.immigration') ||\n !routeData['what.service.immigration'].hasOwnProperty(taxonomy1Path)\n ) {\n return [];\n }\n return routeData['what.service.immigration'][taxonomy1Path];\n}\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,QAAQ;AAAC,SACrBC,aAAa,EAAEC,cAAc;AAAA,OACpCC,iBAAiB;AACxB,OAAOC,kBAAkB,MAAM,6BAA6B;AAC5D,OAAOC,QAAQ,MAAM,gBAAgB;AACrC,SAASC,UAAU,EAAEC,WAAW,QAAQ,YAAY;AAEpD,OAAO,SAASC,WAAWA,CAACC,WAAkC,EAAE;EAC9D,MAAMC,SAAS,GAAGP,iBAAiB,CAACQ,QAAQ,CAAC,CAAC,CAACC,IAAI;EAEnD,IAAG,OAAOH,WAAY,KAAK,QAAQ,EAAC;IAClC,IACE,CAACA,WAAW,IACZ,CAACC,SAAS,CAACG,cAAc,CAACX,cAAc,CAACY,IAAI,CAAC,IAC9C,CAACJ,SAAS,CAACR,cAAc,CAACY,IAAI,CAAC,CAACC,KAAK,CAACF,cAAc,CAACJ,WAAW,CAAC,EACjE;MACA,OAAOO,SAAS;IAClB;IAEA,OAAOhB,SAAS,CAACU,SAAS,CAACR,cAAc,CAACY,IAAI,CAAC,CAACC,KAAK,CAACN,WAAW,CAAC,CAAC;EACrE,CAAC,MACI;IACH,MAAMQ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AAChE,SAAS,CAACG,cAAc,CAAC,0BAA0B,CAAC,IACrD,CAACH,SAAS,CAAC,0BAA0B,CAAC,CAACG,cAAc,CAAC6D,aAAa,CAAC,EACpE;IACA,OAAO,EAAE;EACX;EACA,OAAOhE,SAAS,CAAC,0BAA0B,CAAC,CAACgE,aAAa,CAAC;AAC7D","ignoreList":[]}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
+
import focusTree from "./focustree.json.js";
|
|
7
|
+
import whatTaxonomies from "./whatTaxonomies.json.js";
|
|
3
8
|
import length from '@turf/length';
|
|
4
9
|
import { feature as turfFeature, lineString as turfLine, point as turfPoint, polygon as turfPolygon } from '@turf/helpers';
|
|
5
10
|
import center from '@turf/center';
|
|
6
11
|
import lineSliceAlong from '@turf/line-slice-along';
|
|
7
12
|
import booleanPointInPolygon from '@turf/boolean-point-in-polygon';
|
|
8
13
|
import axios from 'axios';
|
|
9
|
-
import { LocalStorage } from
|
|
10
|
-
import { PublishedDataType, Status, getPublishedData } from
|
|
11
|
-
import useMapObjectsDataStore from
|
|
12
|
-
|
|
13
|
-
// Type for clicked features that includes both metaFeature data and raw click event
|
|
14
|
+
import { LocalStorage } from "../utils/local-storage.js";
|
|
15
|
+
import { PublishedDataType, Status, getPublishedData } from "./fetch-published-json.js";
|
|
16
|
+
import useMapObjectsDataStore from "../utils/mapobjects-store.js"; // Type for clicked features that includes both metaFeature data and raw click event
|
|
14
17
|
var SortType = /*#__PURE__*/function (SortType) {
|
|
15
18
|
SortType["Name"] = "Name";
|
|
16
19
|
SortType["WhereDimension"] = "WhereDimension";
|
|
@@ -25,21 +28,22 @@ export let FilterType = /*#__PURE__*/function (FilterType) {
|
|
|
25
28
|
return FilterType;
|
|
26
29
|
}({});
|
|
27
30
|
export class MetaAtlasCore {
|
|
28
|
-
defaultFocusedTaxonomy = 'where.changi';
|
|
29
|
-
searchableGeoJsonFeatures = [];
|
|
30
|
-
currentFocus = this.defaultFocusedTaxonomy;
|
|
31
|
-
// For ATOMS API
|
|
32
|
-
token = '';
|
|
33
|
-
empApi = '';
|
|
34
|
-
atomsAPIAccessToken = '';
|
|
35
|
-
apiRequestLimit = 5000;
|
|
36
|
-
|
|
37
|
-
// For Routing & Search
|
|
38
|
-
secretKeyForDecryption = '';
|
|
39
|
-
routingStatus = Status.Awaiting;
|
|
40
|
-
searchStatus = Status.Awaiting;
|
|
41
|
-
storage = new LocalStorage();
|
|
42
31
|
constructor() {
|
|
32
|
+
_defineProperty(this, "defaultFocusedTaxonomy", 'where.changi');
|
|
33
|
+
_defineProperty(this, "searchableGeoJsonFeatures", []);
|
|
34
|
+
_defineProperty(this, "currentFocus", this.defaultFocusedTaxonomy);
|
|
35
|
+
// For ATOMS API
|
|
36
|
+
_defineProperty(this, "token", '');
|
|
37
|
+
_defineProperty(this, "empApi", '');
|
|
38
|
+
_defineProperty(this, "atomsAPIAccessToken", '');
|
|
39
|
+
_defineProperty(this, "apiRequestLimit", 5000);
|
|
40
|
+
// For Routing & Search
|
|
41
|
+
_defineProperty(this, "secretKeyForDecryption", '');
|
|
42
|
+
_defineProperty(this, "routingStatus", Status.Awaiting);
|
|
43
|
+
_defineProperty(this, "searchStatus", Status.Awaiting);
|
|
44
|
+
_defineProperty(this, "storage", new LocalStorage());
|
|
45
|
+
_defineProperty(this, "ignoredLayers", ['Aerodrome', 'Aerodrome names', 'Aerobridge', 'Aerobridge gates', 'Airplanes', 'Airplanes outline', 'Building Extrusion', 'Building icon', 'Building overlay', 'Building overlay outline', 'Building underlay', 'Building underlay icon', 'Building underlay selected outline', 'building_outline', 'Changi Airport Connector', 'Changi Airport Connector Text', 'Changi Walkway Text', 'T2 overlay outline copy', 'Building overlay base', 'Skytrain track outdoor']);
|
|
46
|
+
_defineProperty(this, "nonFloorLayers", ['where.changi', 'where.changi.tarmac', 'where.changi.tarmac.public', 'where.changi.tarmac.private', 'where.changi.terminals', 'where.changi.terminals.jewel', 'where.changi.terminals.t1', 'where.changi.terminals.t2', 'where.changi.terminals.t3', 'where.changi.terminals.t4', 'where.hkcec.main_bldg', 'where.gbtb.flower_dome', 'where.lima', 'where.lima.mahsuri_center', 'where.lima.maritime', 'where.malaysia', 'where.malaysia.bcck', 'where.malaysia.rmh', 'where.malaysia.pm', 'where.indonesia.fairmont_jakarta']);
|
|
43
47
|
this.lastClicked = {
|
|
44
48
|
mapObjectId: null,
|
|
45
49
|
coordinates: null,
|
|
@@ -66,14 +70,15 @@ export class MetaAtlasCore {
|
|
|
66
70
|
});
|
|
67
71
|
const config = {
|
|
68
72
|
method: 'post',
|
|
69
|
-
url:
|
|
73
|
+
url: "".concat(this.empApi, "/authentication"),
|
|
70
74
|
headers: {
|
|
71
75
|
'Content-Type': 'application/json'
|
|
72
76
|
},
|
|
73
77
|
data: data
|
|
74
78
|
};
|
|
75
79
|
axios(config).then(async response => {
|
|
76
|
-
|
|
80
|
+
var _response$data;
|
|
81
|
+
if (response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.accessToken) {
|
|
77
82
|
this.atomsAPIAccessToken = response.data.accessToken;
|
|
78
83
|
onAuthenticationResponse({
|
|
79
84
|
authenticated: true
|
|
@@ -107,15 +112,13 @@ export class MetaAtlasCore {
|
|
|
107
112
|
setLastClickedFeature(featureData) {
|
|
108
113
|
if (featureData.mapObjectId) {
|
|
109
114
|
this.getMapObjectById(featureData.mapObjectId, res => {
|
|
110
|
-
const mo = res
|
|
115
|
+
const mo = res === null || res === void 0 ? void 0 : res[0];
|
|
111
116
|
if (mo) {
|
|
112
|
-
this.lastClicked = {
|
|
113
|
-
|
|
114
|
-
properties: {
|
|
115
|
-
...featureData.properties,
|
|
117
|
+
this.lastClicked = _objectSpread(_objectSpread({}, featureData), {}, {
|
|
118
|
+
properties: _objectSpread(_objectSpread({}, featureData.properties), {}, {
|
|
116
119
|
booth_info: mo.properties.booth_info
|
|
117
|
-
}
|
|
118
|
-
};
|
|
120
|
+
})
|
|
121
|
+
});
|
|
119
122
|
}
|
|
120
123
|
});
|
|
121
124
|
} else {
|
|
@@ -240,8 +243,6 @@ export class MetaAtlasCore {
|
|
|
240
243
|
let isViewingFloor = booleanPointInPolygon(centerPoint, fBounds);
|
|
241
244
|
return isViewingBuilding || isViewingFloor;
|
|
242
245
|
}
|
|
243
|
-
ignoredLayers = ['Aerodrome', 'Aerodrome names', 'Aerobridge', 'Aerobridge gates', 'Airplanes', 'Airplanes outline', 'Building Extrusion', 'Building icon', 'Building overlay', 'Building overlay outline', 'Building underlay', 'Building underlay icon', 'Building underlay selected outline', 'building_outline', 'Changi Airport Connector', 'Changi Airport Connector Text', 'Changi Walkway Text', 'T2 overlay outline copy', 'Building overlay base', 'Skytrain track outdoor'];
|
|
244
|
-
nonFloorLayers = ['where.changi', 'where.changi.tarmac', 'where.changi.tarmac.public', 'where.changi.tarmac.private', 'where.changi.terminals', 'where.changi.terminals.jewel', 'where.changi.terminals.t1', 'where.changi.terminals.t2', 'where.changi.terminals.t3', 'where.changi.terminals.t4', 'where.hkcec.main_bldg', 'where.gbtb.flower_dome', 'where.lima', 'where.lima.mahsuri_center', 'where.lima.maritime', 'where.malaysia', 'where.malaysia.bcck', 'where.malaysia.rmh', 'where.malaysia.pm', 'where.indonesia.fairmont_jakarta'];
|
|
245
246
|
filterBaseMapWhereDimension(layersData, whereTaxonomyPath) {
|
|
246
247
|
let dimensionWhere = whereTaxonomyPath;
|
|
247
248
|
if (!dimensionWhere) {
|
|
@@ -342,7 +343,8 @@ export class MetaAtlasCore {
|
|
|
342
343
|
return splitstr[splitstr.length - 1];
|
|
343
344
|
}
|
|
344
345
|
}
|
|
345
|
-
getFlyToLocation(whereTaxonomyPath
|
|
346
|
+
getFlyToLocation(whereTaxonomyPath) {
|
|
347
|
+
let isMobile = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
346
348
|
let location = this.getLocationNameFromWhereTaxonomyPath(whereTaxonomyPath);
|
|
347
349
|
const getConfigForNode = node => {
|
|
348
350
|
const cameraConfigs = isMobile ? node.mobile : node.web;
|
|
@@ -621,7 +623,8 @@ export class MetaAtlasCore {
|
|
|
621
623
|
normalize(string) {
|
|
622
624
|
return string.trim().toLowerCase();
|
|
623
625
|
}
|
|
624
|
-
relevanceSort(metaFeatures, query
|
|
626
|
+
relevanceSort(metaFeatures, query) {
|
|
627
|
+
let isStrict = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
625
628
|
function score(metaFeature) {
|
|
626
629
|
const noMatch = [-1, 0, metaFeature.name];
|
|
627
630
|
if (metaFeature.name) {
|
|
@@ -660,7 +663,8 @@ export class MetaAtlasCore {
|
|
|
660
663
|
return scoreB[0] - scoreA[0] || scoreB[1] - scoreA[1] || scoreA[2].localeCompare(scoreB[2]);
|
|
661
664
|
}).filter(s => score(s)[0] >= 0);
|
|
662
665
|
}
|
|
663
|
-
sort(metaFeatures, sortType
|
|
666
|
+
sort(metaFeatures, sortType) {
|
|
667
|
+
let query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
664
668
|
const compare = (a, b) => {
|
|
665
669
|
if (!a || !b) {
|
|
666
670
|
return 0;
|
|
@@ -743,7 +747,10 @@ export class MetaAtlasCore {
|
|
|
743
747
|
onSearchStatusUpdateCallback(status === Status.Ready ? true : false);
|
|
744
748
|
}
|
|
745
749
|
}
|
|
746
|
-
getMapObjectsByFilteredLocalRef(boothId
|
|
750
|
+
getMapObjectsByFilteredLocalRef(boothId) {
|
|
751
|
+
let searchSubString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
752
|
+
let sortType = arguments.length > 2 ? arguments[2] : undefined;
|
|
753
|
+
let onResponseCallback = arguments.length > 3 ? arguments[3] : undefined;
|
|
747
754
|
const uniqueIds = new Set();
|
|
748
755
|
const metaFeatures = [];
|
|
749
756
|
const boothIdToSearch = this.normalize(String(boothId));
|
|
@@ -774,7 +781,10 @@ export class MetaAtlasCore {
|
|
|
774
781
|
const sortedFeatures = this.sort(metaFeatures, sortType, boothId);
|
|
775
782
|
onResponseCallback(sortedFeatures);
|
|
776
783
|
}
|
|
777
|
-
getMapObjectsByName(name
|
|
784
|
+
getMapObjectsByName(name) {
|
|
785
|
+
let searchSubString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
786
|
+
let sortType = arguments.length > 2 ? arguments[2] : undefined;
|
|
787
|
+
let onResponseCallback = arguments.length > 3 ? arguments[3] : undefined;
|
|
778
788
|
const uniqueIds = new Set();
|
|
779
789
|
const metaFeatures = [];
|
|
780
790
|
const nameToSearch = this.normalize(String(name));
|
|
@@ -998,12 +1008,13 @@ export class MetaAtlasCore {
|
|
|
998
1008
|
}
|
|
999
1009
|
onResponseCallback(metaFeatures);
|
|
1000
1010
|
}
|
|
1001
|
-
getMapObjectsApi(
|
|
1011
|
+
getMapObjectsApi() {
|
|
1012
|
+
let query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
1002
1013
|
return new Promise((resolve, reject) => {
|
|
1003
1014
|
axios({
|
|
1004
|
-
url:
|
|
1015
|
+
url: "".concat(this.empApi, "/map-objects").concat(query),
|
|
1005
1016
|
headers: {
|
|
1006
|
-
Authorization:
|
|
1017
|
+
Authorization: "Bearer ".concat(this.atomsAPIAccessToken)
|
|
1007
1018
|
},
|
|
1008
1019
|
method: 'get'
|
|
1009
1020
|
}).then(response => {
|
|
@@ -1016,8 +1027,8 @@ export class MetaAtlasCore {
|
|
|
1016
1027
|
});
|
|
1017
1028
|
}
|
|
1018
1029
|
getMapObjectsByWhatTaxonomyAPI(whatTaxonomyPath, onResponseCallback) {
|
|
1019
|
-
let query =
|
|
1020
|
-
if (whatTaxonomyPath) query +=
|
|
1030
|
+
let query = "?$limit=".concat(this.apiRequestLimit);
|
|
1031
|
+
if (whatTaxonomyPath) query += "&taxonomy2Path=".concat(whatTaxonomyPath);
|
|
1021
1032
|
this.getMapObjectsApi(query).then(onResponseCallback).catch(onResponseCallback);
|
|
1022
1033
|
}
|
|
1023
1034
|
}
|