atriusmaps-node-sdk 3.3.395 → 3.3.397
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/dist/cjs/package.json.js +1 -1
- package/dist/cjs/plugins/wayfinder/src/wayfinder.js +9 -60
- package/dist/cjs/src/configs/postproc-mol-url-parms.js +1 -2
- package/dist/cjs/src/utils/geom.js +0 -3
- package/dist/package.json.js +1 -1
- package/dist/plugins/wayfinder/src/wayfinder.js +1 -1
- package/dist/src/configs/postproc-mol-url-parms.js +1 -1
- package/dist/src/utils/geom.js +1 -1
- package/package.json +1 -1
package/dist/cjs/package.json.js
CHANGED
|
@@ -357,26 +357,6 @@ function create (app, config) {
|
|
|
357
357
|
}
|
|
358
358
|
});
|
|
359
359
|
|
|
360
|
-
/**
|
|
361
|
-
* Calculates transit time and distance of shortest path to start location which satisfies passed options
|
|
362
|
-
* and returns copy of POI with these new properties
|
|
363
|
-
*
|
|
364
|
-
* @param {Endpoint} startLocation
|
|
365
|
-
* @param {RouteOptions} options
|
|
366
|
-
* @returns {Object} - POI
|
|
367
|
-
*/
|
|
368
|
-
app.bus.on('wayfinder/addPathTimeSingle', async ({ poi, startLocation, options = {} }) => {
|
|
369
|
-
if (!startLocation) return poi
|
|
370
|
-
return graphLoadedProm.then(graph => addPathTimeSingle(graph, options, poi, startLocation))
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
function addPathTimeSingle (graph, options, poi, start) {
|
|
374
|
-
const end = poiToNavigationEndpoint(poi, graph.floorIdToOrdinal);
|
|
375
|
-
const path = graph.findShortestPath(start, end, options);
|
|
376
|
-
|
|
377
|
-
return resolveAndAddPathProps(poi, path, start, 'start')
|
|
378
|
-
}
|
|
379
|
-
|
|
380
360
|
/**
|
|
381
361
|
* Calculates transit time and distance of shortest path from each POI to start location which satisfies passed options
|
|
382
362
|
* and returns list of copies of POI with these new properties
|
|
@@ -456,19 +436,22 @@ function create (app, config) {
|
|
|
456
436
|
* then adds the transit times and distances to create a total for each POI
|
|
457
437
|
* and returns list of copies of POI with these new properties
|
|
458
438
|
*
|
|
459
|
-
* @param {
|
|
460
|
-
* @param {
|
|
439
|
+
* @param {Poi} startLocation
|
|
440
|
+
* @param {Poi} endLocation
|
|
441
|
+
* @param {Endpoint} currentLocation
|
|
461
442
|
* @param {RouteOptions} options
|
|
462
443
|
* @param pois: array of pois
|
|
463
444
|
* @returns Array.<Object> - list of POIs
|
|
464
445
|
*/
|
|
465
|
-
app.bus.on('wayfinder/multipointAddPathTimeMultiple', async ({ pois, startLocation, endLocation, options = {} }) => {
|
|
466
|
-
if (!startLocation && !endLocation) return pois
|
|
467
|
-
return graphLoadedProm.then(graph => multipointAddPathTimeMultiple(graph, options, pois, startLocation, endLocation))
|
|
446
|
+
app.bus.on('wayfinder/multipointAddPathTimeMultiple', async ({ pois, startLocation, endLocation, currentLocation, options = {} }) => {
|
|
447
|
+
if (!startLocation && !endLocation && !currentLocation) return pois
|
|
448
|
+
return graphLoadedProm.then(graph => multipointAddPathTimeMultiple(graph, options, pois, startLocation, endLocation, currentLocation))
|
|
468
449
|
});
|
|
469
450
|
|
|
470
|
-
function multipointAddPathTimeMultiple (graph, options, pois,
|
|
451
|
+
function multipointAddPathTimeMultiple (graph, options, pois, startPoi, endPoi, currentLocation) {
|
|
471
452
|
try {
|
|
453
|
+
const start = startPoi ? poiToNavigationEndpoint(startPoi, graph.floorIdToOrdinal) : currentLocation;
|
|
454
|
+
const end = endPoi ? poiToNavigationEndpoint(endPoi, graph.floorIdToOrdinal) : null;
|
|
472
455
|
const poisList = R__namespace.clone(pois);
|
|
473
456
|
const poiLocations = poisList.map(poi => poiToNavigationEndpoint(poi, graph.floorIdToOrdinal));
|
|
474
457
|
|
|
@@ -536,40 +519,6 @@ function create (app, config) {
|
|
|
536
519
|
return (path && path.length) ? calculateTotalPathProperty(path, 'distance') : getGeoDistance(endLocation, startLocation)
|
|
537
520
|
}
|
|
538
521
|
|
|
539
|
-
/**
|
|
540
|
-
* Calculates transit time and distance of shortest path from start location to POI
|
|
541
|
-
* and calculates transit time and distance of shortest path from POI to end location,
|
|
542
|
-
* where both calculates must satisfy the passed options,
|
|
543
|
-
* then adds the transit times and distances to create a total for the POI
|
|
544
|
-
* and returns copy of POI with these new properties
|
|
545
|
-
*
|
|
546
|
-
* @param {Endpoint} endLocation
|
|
547
|
-
* @param {Endpoint} startLocation
|
|
548
|
-
* @param {RouteOptions} options
|
|
549
|
-
* @returns {Object} - POI
|
|
550
|
-
*/
|
|
551
|
-
app.bus.on('wayfinder/multipointAddPathTimeSingle', async ({ poi, startLocation, endLocation, options = {} }) => {
|
|
552
|
-
if (!startLocation && !endLocation) return poi
|
|
553
|
-
return graphLoadedProm.then(graph => multipointAddPathTimeSingle(graph, options, poi, startLocation, endLocation))
|
|
554
|
-
});
|
|
555
|
-
|
|
556
|
-
function multipointAddPathTimeSingle (graph, options, poi, start, end) {
|
|
557
|
-
const poiLocation = poiToNavigationEndpoint(poi, graph.floorIdToOrdinal);
|
|
558
|
-
|
|
559
|
-
let pathPrimary, pathSecondary;
|
|
560
|
-
if (start) { pathPrimary = graph.findShortestPath(start, poiLocation, options); }
|
|
561
|
-
if (end) { pathSecondary = graph.findShortestPath(poiLocation, end, options); }
|
|
562
|
-
|
|
563
|
-
// add two distances and times
|
|
564
|
-
if (start && end) {
|
|
565
|
-
return resolveAndAddMultipointPathProps(poi, pathPrimary, pathSecondary, start, end)
|
|
566
|
-
} else if (start) {
|
|
567
|
-
return resolveAndAddPathProps(poi, pathPrimary, start, 'start')
|
|
568
|
-
} else if (end) {
|
|
569
|
-
return resolveAndAddPathProps(poi, pathSecondary, end, 'end')
|
|
570
|
-
} else return poi
|
|
571
|
-
}
|
|
572
|
-
|
|
573
522
|
/**
|
|
574
523
|
* Resets plugin state
|
|
575
524
|
*/
|
|
@@ -25,8 +25,7 @@ const parmToPlugin = {
|
|
|
25
25
|
buildingId: 'mapRenderer',
|
|
26
26
|
floorId: 'mapRenderer',
|
|
27
27
|
visualTest: 'mapRenderer',
|
|
28
|
-
refInstallId: 'analytics2'
|
|
29
|
-
multipointRouting: ['online/getDirectionsFromTo', 'online/poiView']
|
|
28
|
+
refInstallId: 'analytics2'
|
|
30
29
|
};
|
|
31
30
|
|
|
32
31
|
// Note: see note about security for forceCreate on postproc-stateTracking - same thing
|
|
@@ -141,10 +141,7 @@ function getStructureAndFloorWithinFloorsAtPoint (structures, floorsToConsider,
|
|
|
141
141
|
|
|
142
142
|
// We will score the building/floor's "prominence" and pick the highest scoring building/floor
|
|
143
143
|
const prominenceScores = pointWithinFloorsBBox.map(ftc => prominence(ftc, mapviewBBox, floorsContainingPoint.some(fcp => fcp.floor.id === ftc.floor.id)));
|
|
144
|
-
console.log('!pointWithinFloorsBBox:', pointWithinFloorsBBox.map(ftc => ftc.floor.id));
|
|
145
|
-
console.log('!prominenceScores:', prominenceScores);
|
|
146
144
|
const bestScore = Math.max.apply(null, prominenceScores);
|
|
147
|
-
console.log('!bestScore:', bestScore);
|
|
148
145
|
|
|
149
146
|
return pointWithinFloorsBBox[prominenceScores.indexOf(bestScore)]
|
|
150
147
|
}
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="web-engine",s="3.3.
|
|
1
|
+
var e="web-engine",s="3.3.397",o="UNLICENSED",t="module",l="src/main.js",r=["demo","deploy","nodesdk","src/extModules/flexapi","services/*","libraries/*"],a={colors:"cat utils/colors1.txt && node utils/processColors.js | pbcopy && cat utils/colors2.txt","cypress:a11y":"APPLITOOLS_IS_DISABLED=true && cypress open --browser chrome --env INPUT_MODALITY='keyboard'","cypress:comp":"APPLITOOLS_IS_DISABLED=true && cypress open --component --browser chrome","cypress:e2e":"APPLITOOLS_IS_DISABLED=true && cypress open --e2e --browser chrome",demo:"cd demo/ && yarn start","e2e:comp":"cypress run --component","e2e:record":"yarn cypress run --env RECORD_MODE=true",e2eSDKTest:"yarn start-server-and-test 'cd ./deploy && yarn buildDev && yarn serveLocal' 8085 'cd ./cypress/e2e/sdk && npx http-server' 8080 'yarn cypress run --spec cypress/e2e/sdk/**'",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh",i18nOverrides:"yarn node utils/i18nOverrideCli src/i18n src/i18n-overrides",lint:"eslint .",mod:"demo/startMod.sh",mol:"demo/startMol.sh","mol:build":"demo/startMolBuild.sh",molProd:"cd deploy && yarn buildAndRunMol",prepare:"husky install",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch","test:vitest":"vitest run"},i=["defaults"],n={react:"^18.3.1"},c={"@azure/event-hubs":"^5.12.2","@dnd-kit/core":"^6.1.0","@dnd-kit/modifiers":"^7.0.0","@dnd-kit/sortable":"^8.0.0","@dnd-kit/utilities":"^3.2.2","@locus-labs/mod-badge":"^0.1.102","@locus-labs/mod-default-theme":"^0.0.113","@locus-labs/mod-footer":"^0.0.111","@locus-labs/mod-header":"^0.0.105","@locus-labs/mod-location-marker":"^0.0.104","@locus-labs/mod-map-legend":"^0.0.104","@locus-labs/mod-offscreen-indicator":"^0.0.104","@locus-labs/mod-pin":"^0.0.104","@locus-labs/mod-qr-code-card":"^0.0.104","@locus-labs/mod-qr-code-window":"^0.0.105","@locus-labs/mod-walk-time-matrix":"^0.0.103","@locus-labs/mol-desktop-building-level-selector":"^0.1.119","@locus-labs/mol-desktop-compass":"^0.1.120","@locus-labs/mol-desktop-default-theme":"^0.2.105","@locus-labs/mol-desktop-icon":"^0.1.131","@locus-labs/mol-desktop-logo":"^0.1.101","@locus-labs/mol-desktop-map-nav-button":"^0.1.130","@locus-labs/mol-desktop-tooltip":"^0.3.102","@locus-labs/mol-desktop-zoom-control":"^0.1.141","@locus-labs/mol-mobile-box":"^0.1.115","@locus-labs/mol-mobile-floating-action-button":"^0.0.117","@locus-labs/mol-mobile-icon":"^0.1.118","@locus-labs/mol-mobile-text":"^0.1.116","@locus-labs/mol-mobile-toast":"^0.1.102","@mapbox/mapbox-gl-draw":"^1.4.3","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@microsoft/applicationinsights-web":"^3.3.4","@turf/area":"^7.2.0","@turf/bbox-clip":"^7.2.0","@turf/bbox-polygon":"^7.2.0","@turf/circle":"^6.5.0","@turf/helpers":"^6.5.0","@turf/point-to-line-distance":"^6.5.0","@vitejs/plugin-react":"^4.0.1","axe-core":"^4.9.0",browserslist:"^4.24.2","crypto-browserify":"^3.12.0","cypress-axe":"^1.6.0","cypress-multi-reporters":"^1.6.4","cypress-real-events":"^1.14.0","file-loader":"^6.2.0",flexsearch:"^0.7.43","h3-js":"^4.1.0",i18next:"^20.3.4","i18next-browser-languagedetector":"^6.1.1","jest-transform-css":"6.0.1",jsdom:"^25.0.1",jsonschema:"^1.2.6",luxon:"^3.3.0","maplibre-gl":"^4.7.1","mini-css-extract-plugin":"^1.6.0","mocha-junit-reporter":"^2.2.1",mochawesome:"^7.1.3","node-polyfill-webpack-plugin":"^1.1.4","path-browserify":"^1.0.1",polished:"^4.0.2","prop-types":"^15.7.2","query-string":"^8.1.0",ramda:"^0.30.1",react:"^18.3.1","react-compound-slider":"^3.3.1","react-dom":"^18.3.1","react-json-editor-ajrm":"^2.5.13","react-qr-svg":"^2.2.1","react-svg":"^16.1.29","react-virtualized-auto-sizer":"^1.0.2","react-window":"^1.8.11","smoothscroll-polyfill":"^0.4.4","styled-components":"^6.1.14","styled-normalize":"^8.0.6","throttle-debounce":"^3.0.1",trackjs:"^3.7.4","ua-parser-js":"^0.7.23",uuid:"3.3.2",zousan:"^3.0.1","zousan-plus":"^4.0.1"},p={"@applitools/eyes-cypress":"^3.47.0","@babel/core":"^7.26.0","@babel/eslint-parser":"^7.25.9","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-assertions":"^7.26.0","@babel/plugin-transform-modules-commonjs":"^7.25.9","@babel/plugin-transform-runtime":"^7.25.9","@babel/preset-env":"^7.26.0","@babel/preset-react":"^7.25.9","@testing-library/jest-dom":"^6.6.3","@types/react":"^19.0.10","@types/react-dom":"^19.0.4","@typescript-eslint/eslint-plugin":"^7.13.0","@typescript-eslint/parser":"^7.13.0","babel-jest":"^27.0.6","babel-loader":"^8.2.2","babel-plugin-inline-json-import":"^0.3.2","babel-plugin-module-resolver":"^5.0.0","babel-plugin-styled-components":"^2.1.4","babel-polyfill":"^6.26.0","chai-colors":"^1.0.1","css-loader":"^5.2.4",cypress:"^12.17.4","cypress-browser-permissions":"^1.1.0","cypress-wait-until":"^1.7.2",eslint:"^8.57.0","eslint-config-standard":"^16.0.3","eslint-import-resolver-typescript":"^3.6.1","eslint-plugin-cypress":"^2.11.1","eslint-plugin-import":"^2.16.0","eslint-plugin-jest":"^28.6.0","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.1.0","eslint-plugin-react":"^7.12.4","eslint-plugin-standard":"^5.0.0","fetch-mock-jest":"^1.3.0",glob:"^10.3.3",husky:"^6.0.0",jest:"29.7.0","jest-environment-jsdom":"^29.7.0","lint-staged":"^11.0.1","node-fetch":"^2.6.0","null-loader":"^4.0.1",nx:"19.4.2","nx-remotecache-azure":"^19.0.0","start-server-and-test":"^2.0.0",typescript:"^5.4.5",vite:"^4.3.9",vitest:"^2.1.5",webpack:"^5.96.1","webpack-merge":"^6.0.1"},d="yarn@4.3.1",m={node:"20.x"},u={},b={name:e,version:s,private:!0,license:o,type:t,main:l,workspaces:r,scripts:a,"lint-staged":{"*.js":["eslint --fix"]},browserslist:i,resolutions:n,dependencies:c,devDependencies:p,packageManager:d,engines:m,nx:u};export{i as browserslist,b as default,c as dependencies,p as devDependencies,m as engines,o as license,l as main,e as name,u as nx,d as packageManager,n as resolutions,a as scripts,t as type,s as version,r as workspaces};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as t from"ramda";import n from"zousan";import{buildStructuresLookup as o}from"../../../src/utils/buildStructureLookup.js";import{distance as i}from"../../../src/utils/geodesy.js";import{findRoute as e}from"./findRoute.js";import{createNavGraph as r}from"./navGraph.js";import{enrichDebugNavGraph as a}from"./navGraphDebug.js";import{buildSegments as s}from"./segmentBuilder.js";const u={SECURITY:"SecurityLane",IMMIGRATION:"ImmigrationLane"};function
|
|
1
|
+
import*as t from"ramda";import n from"zousan";import{buildStructuresLookup as o}from"../../../src/utils/buildStructureLookup.js";import{distance as i}from"../../../src/utils/geodesy.js";import{findRoute as e}from"./findRoute.js";import{createNavGraph as r}from"./navGraph.js";import{enrichDebugNavGraph as a}from"./navGraphDebug.js";import{buildSegments as s}from"./segmentBuilder.js";const u={SECURITY:"SecurityLane",IMMIGRATION:"ImmigrationLane"};function l(l,d){const p=l.log.sublog("wayfinder"),c=async()=>{l.bus.send("venueData/loadNavGraph")};let f=new n;l.bus.on("wayfinder/_getNavGraph",(()=>f)),l.bus.on("venueData/navGraphLoaded",(async({navGraphData:t,structures:n})=>{const i=o(n),e=await y(),a=r(t,i.floorIdToOrdinal,i.floorIdToStructureId,e),s=await async function(t){const n=await l.bus.send("dynamicRouting/poisToAvoid");if(0===n.length)return[];const o=n[0]?.map((n=>t.findClosestNode(n.position.floorId,n.position.latitude,n.position.longitude).id));return o}(a);a.addNodesToAvoid(s),f.resolve(a)}));const y=async()=>{const n=await l.bus.get("poi/getByCategoryId",{categoryId:"security"});return t.pipe(t.map(m),t.filter(t.identity))(n)},m=n=>n.queue&&{type:t.path(["queue","queueType"],n),id:t.path(["queue","queueSubtype"],n)};l.bus.on("wayfinder/showNavLineFromPhysicalLocation",(async({toEndpoint:t,selectedSecurityLanes:n=null,requiresAccessibility:o})=>async function(t,n,o){const i=await b({fromEndpoint:t,toEndpoint:n,options:o});if(i){const{segments:t}=i;o.primary&&l.bus.send("map/resetNavlineFeatures"),l.bus.send("map/showNavlineFeatures",{segments:t,category:o.primary?"primary":"alternative"})}return i}(await l.bus.getFirst("user/getPhysicalLocation"),t,{selectedSecurityLanes:n,requiresAccessibility:o,primary:!0})));const g=(t,n)=>l.bus.get("poi/getById",{id:t}).then((o=>{if(o&&o.position)return w(o,n);throw Error("Unknown POI ID "+t)}));const I=["lat","lng","floorId","ordinal"],h=t.pipe(t.pick(I),t.keys,t.propEq(I.length,"length"),Boolean),w=(t,n)=>({lat:t.position.latitude,lng:t.position.longitude,floorId:t.position.floorId,ordinal:n(t.position.floorId),title:t.name});async function b({fromEndpoint:t,toEndpoint:n,options:o={}}){const i=await l.bus.get("poi/getAll")||{},r=Array.isArray(i)?i[0]:i,a=Object.values(r).filter((t=>t.category&&t.category.startsWith("security")));return f.then((async i=>{o.compareFindPaths=d.compareFindPaths;const r=e(i,t,n,o);if(!r)return null;t.floorId&&n.floorId&&T(t,n,r);const u=await l.bus.get("venueData/getFloorIdToNameMap"),c=await l.bus.get("venueData/getQueueTypes"),f=l.gt(),y=o.requiresAccessibility,{steps:m,segments:g}=s(r.waypoints,t,n,u,f,c,y,a);p.info("route",r);const I=Math.round(r.waypoints.reduce(((t,{eta:n})=>t+n),0)),h=Math.round(r.waypoints.reduce(((t,{distance:n})=>t+n),0));return{...r,segments:g,steps:m,time:I,distance:h}}))}l.bus.on("wayfinder/getNavigationEndpoint",(({ep:t})=>async function(t){return f.then((n=>{if(!t)throw Error("wayfinder: Invalid endpoint definition",t);if("number"==typeof t)return g(t,n.floorIdToOrdinal);if("string"==typeof t){if(t.match(/^\d+$/))return g(parseInt(t),n.floorIdToOrdinal);if(t.indexOf(",")>0){let[o,i,e,r]=t.split(",");if(!n.floorIdToStructureId(e))throw Error("Unknown floorId in endpoint: "+e);return r||(r="Starting Point"),{lat:parseFloat(o),lng:parseFloat(i),ordinal:n.floorIdToOrdinal(e),floorId:e,title:r}}}if(h(t))return t;if(t.latitude)return{lat:t.latitude,lng:t.longitude,floorId:t.floorId,ordinal:n.floorIdToOrdinal(t.floorId),title:t.title};if(t.position&&t.name)return w(t,n.floorIdToOrdinal);throw Error("Invalid start or end point: "+t)}))}(t))),l.bus.on("wayfinder/checkIfPathHasSecurity",(({fromEndpoint:n,toEndpoint:o,options:i={}})=>f.then((r=>{i.compareFindPaths=d.compareFindPaths;const a=e(r,n,o,i);if(!a)return{routeExists:!1};const s=n=>Boolean(a.waypoints.find(t.pathEq(n,["securityLane","type"])));return{routeExists:!0,queues:a.waypoints.filter((n=>t.pathEq(u.SECURITY,["securityLane","type"],n)||t.pathEq(u.IMMIGRATION,["securityLane","type"],n))),hasSecurity:s(u.SECURITY),hasImmigration:s(u.IMMIGRATION)}})))),l.bus.on("wayfinder/getRoute",b);const T=(t,n,o)=>l.bus.send("session/submitEvent",{type:"navigation",startPosition:{venueId:t.floorId.split("-")[0],buildingId:o.waypoints[0].position.structureId,floorId:o.waypoints[0].position.floorId,lat:o.waypoints[0].position.lat,lng:o.waypoints[0].position.lng},endPosition:{venueId:n.floorId.split("-")[0],buildingId:o.waypoints[o.waypoints.length-1].position.structureId,floorId:o.waypoints[o.waypoints.length-1].position.floorId,lat:o.waypoints[o.waypoints.length-1].position.lat,lng:o.waypoints[o.waypoints.length-1].position.lng}});function v(n,o,i,e){let r=t.clone(n);return r=S(r,i,e),o&&o.length?{...r,transitTime:E(o,"transitTime"),distance:E(o,"distance")}:(r.distance="start"===e?L(r,i):L(i,r),r.transitTime=O(r.distance),r)}function E(n,o){return t.aperture(2,n).map((([n,o])=>{return(i=o.id,n=>t.find((t=>t.dst===i),n.edges))(n);var i})).map(t.prop(o)).reduce(((t,n)=>t+n),0)}function S(t,n,o){return{...t,[o+"Information"]:{lat:n?.lat||n?.position?.latitude,lng:n?.lng||n?.position?.longitude,floorId:n?.floorId||n?.position?.floorId}}}function L(t,n){return i(n?.lat||n?.position?.latitude,n?.lng||n?.position?.longitude,t?.lat||t?.position?.latitude,t?.lng||t?.position?.longitude)}function O(t){return t/60}function P(n){const o=n.filter((t=>null!==t));return t.sortBy(t.propOr(1/0,"transitTime"),o)}function N(t,n){return t&&t.length?E(t,"transitTime"):O(n)}function A(t,n,o){return t&&t.length?E(t,"distance"):L(o,n)}return l.bus.on("wayfinder/addPathTimeMultiple",(async({pois:n,startLocation:o,options:i={}})=>o?f.then((e=>function(n,o,i,e){try{const r=t.clone(i),a=r.map((t=>w(t,n.floorIdToOrdinal))),s=n.findAllShortestPaths(e,a,o);return P(r.map(((t,n)=>v(t,s[n],e,"start"))))}catch(t){return p.error(t),i}}(e,i,n,o))):n)),l.bus.on("wayfinder/multipointAddPathTimeMultiple",(async({pois:n,startLocation:o,endLocation:i,currentLocation:e,options:r={}})=>o||i||e?f.then((a=>function(n,o,i,e,r,a){try{const s=e?w(e,n.floorIdToOrdinal):a,u=r?w(r,n.floorIdToOrdinal):null,l=t.clone(i),d=l.map((t=>w(t,n.floorIdToOrdinal)));let p,c,f;return s&&(p=n.findAllShortestPaths(s,d,o)),u&&(c=function(t,n,o,i){const e=[];for(const r of n)e.push(t.findShortestPath(r,o,i));return e}(n,d,u,o)),f=s&&u?l.map(((n,o)=>function(n,o,i,e,r){const a=A(o,e,n),s=A(i,n,r);if(!a||!s)return null;const u=N(o,a),l=N(i,s);let d=t.clone(n);return d=S(d,e,"start"),d=S(d,r,"end"),{...d,transitTime:u+l,distance:a+s,startInformation:{...d.startInformation,transitTime:u,distance:a},endInformation:{...d.endInformation,transitTime:l,distance:s}}}(n,p[o],c[o],s,u))):s?l.map(((t,n)=>v(t,p[n],s,"start"))):l.map(((t,n)=>v(t,c[n],u,"end"))),P(f)}catch(t){return p.error(t),i}}(a,r,n,o,i,e))):n)),l.bus.on("venueData/loadNewVenue",(()=>{f=new n,c()})),l.bus.on("poi/setDynamicData",(({plugin:t,idValuesMap:n})=>{"security"===t&&f.then((t=>t.updateWithSecurityWaitTime(n)))})),l.bus.on("wayfinder/getNavGraphFeatures",(()=>f.then((({_nodes:t})=>a(t))))),{init:c,internal:{resolveNavGraph:t=>f.resolve(t),prepareSecurityLanes:y}}}export{u as SecurityLaneType,l as create};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"query-string";const e={navFrom:"online/getDirectionsFromTo",navTo:"online/getDirectionsFromTo",waypoints:"online/getDirectionsFromTo",accessible:"online/getDirectionsFromTo",showNav:"online/getDirectionsFromTo",poiId:["online/getDirectionsFromTo","online/poiView"],vid:"venueDataLoader",stage:"venueDataLoader",contentStage:"venueDataLoader",accountId:"venueDataLoader",search:"online/headerOnline",ho:["online/getDirectionsFromTo","analytics2"],home:"online/homeView",zoom:"mapRenderer",pitch:"mapRenderer",bearing:"mapRenderer",lat:"mapRenderer",lng:"mapRenderer",radius:"mapRenderer",buildingId:"mapRenderer",floorId:"mapRenderer",visualTest:"mapRenderer",refInstallId:"analytics2"
|
|
1
|
+
import"query-string";const e={navFrom:"online/getDirectionsFromTo",navTo:"online/getDirectionsFromTo",waypoints:"online/getDirectionsFromTo",accessible:"online/getDirectionsFromTo",showNav:"online/getDirectionsFromTo",poiId:["online/getDirectionsFromTo","online/poiView"],vid:"venueDataLoader",stage:"venueDataLoader",contentStage:"venueDataLoader",accountId:"venueDataLoader",search:"online/headerOnline",ho:["online/getDirectionsFromTo","analytics2"],home:"online/homeView",zoom:"mapRenderer",pitch:"mapRenderer",bearing:"mapRenderer",lat:"mapRenderer",lng:"mapRenderer",radius:"mapRenderer",buildingId:"mapRenderer",floorId:"mapRenderer",visualTest:"mapRenderer",refInstallId:"analytics2"};function n(n,o,r){if(void 0!==o.lldebug)try{n.debug=JSON.parse(o.lldebug),null===n.debug&&(n.debug={})}catch(e){n.debug=!0}return Object.keys(e).forEach((i=>{if(void 0!==o[i]){let a=e[i];Array.isArray(a)||(a=[a]),a.forEach((e=>{let a=n.plugins[e];!a&&r&&(a=n.plugins[e]={}),a.deepLinkProps={...a.deepLinkProps,[i]:o[i]}}))}})),o.poiId&&o.showNav&&delete n.plugins["online/poiView"].deepLinkProps.poiId,n}export{n as setDeepLinksForParms};
|
package/dist/src/utils/geom.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{area as o}from"@turf/area";import{bboxClip as r}from"@turf/bbox-clip";import{bboxPolygon as t}from"@turf/bbox-polygon";import{polygon as l}from"@turf/helpers";import"@turf/point-to-line-distance";import*as e from"ramda";const n=(o,r)=>{const t=o[0],l=o[1];let e=!1;for(let o=0,n=r.length-1;o<r.length;n=o++){const u=r[o][0],
|
|
1
|
+
import{area as o}from"@turf/area";import{bboxClip as r}from"@turf/bbox-clip";import{bboxPolygon as t}from"@turf/bbox-polygon";import{polygon as l}from"@turf/helpers";import"@turf/point-to-line-distance";import*as e from"ramda";const n=(o,r)=>{const t=o[0],l=o[1];let e=!1;for(let o=0,n=r.length-1;o<r.length;n=o++){const u=r[o][0],f=r[o][1],i=r[n][0],s=r[n][1];f>l!=s>l&&t<(i-u)*(l-f)/(s-f)+u&&(e=!e)}return e},u=({n:o,s:r,e:t,w:l})=>[[o,t],[o,l],[r,l],[r,t],[o,t]],f={structure:null,floor:null};function i(l,i,s,a,p,m=!1){if(!e.length(l))return f;const h=(l=l.filter((o=>null==o.shouldDisplay||!0===o.shouldDisplay))).map((o=>({structure:o,floor:d(o,a)})));return function(l,i,s,d,a,p){const m=i.filter((o=>o.floor)).filter((o=>n([s,d],u(o.floor.bounds))));if(p){if(0===m.length)return f;const o=m.filter((o=>n([s,d],o.floor.boundsPolygon)));return o.length>=1?e.head(o):f}if(0===m.length){const o=l.filter((o=>n([s,d],u(o.bounds)))).map((o=>({structure:o,floor:null})));return o.length>=1?o[0]:f}if(1===m.length)return m[0];const h=m.filter((o=>n([s,d],o.floor.boundsPolygon))),b=m.map((l=>function({structure:l,floor:e},n,u){const f=c(e.boundsPolygon),i=t(n),s=r(f,n),d=o(s),a=o(i);return d*(u?150:100)/a}(l,a,h.some((o=>o.floor.id===l.floor.id))))),g=Math.max.apply(null,b);return m[b.indexOf(g)]}(l,h,i,s,p,m)}const s=o=>[o[1],o[0]],c=o=>l([o.map(s)]),d=(o,r)=>Object.values(o.levels).find((o=>o.ordinal===r)),a=(o,r)=>o.reduce(((o,t)=>Object.values(t.levels).find((o=>o.id===r))||o),void 0),p=(o,r)=>o.reduce(((o,t)=>m(t,r)?t:o),null),m=(o,r)=>Object.values(o.levels).reduce(((o,t)=>t.id===r||o),!1);function h(o,r,t,l,e,n,u,f){let i=0,s=0,c=0,d=0,a=0;const p=[{x:o,y:r}];for(let m=1,h=0;m<=20;++m)h=m/20,i=1-h,s=i*i,c=s*i,d=h*h,a=d*h,p.push({x:c*o+3*s*h*t+3*i*d*e+a*u,y:c*r+3*s*h*l+3*i*d*n+a*f});return p}export{h as bezierCurveTo,a as getFloor,i as getStructureAndFloorAtPoint,p as getStructureForFloorId,d as ordToFloor,n as pointInPolygon};
|
package/package.json
CHANGED