atriusmaps-node-sdk 3.3.367 → 3.3.369
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/sdkServer/src/sdkServer.js +1 -1
- package/dist/cjs/plugins/venueDataLoader/src/venueDataLoader.js +1 -6
- package/dist/cjs/src/extModules/geohasher.js +2 -2
- package/dist/cjs/src/utils/dom.js +1 -1
- package/dist/cjs/src/utils/geom.js +3 -3
- package/dist/cjs/src/utils/location.js +1 -1
- package/dist/package.json.js +1 -1
- package/dist/plugins/sdkServer/src/sdkServer.js +1 -1
- package/dist/src/utils/dom.js +1 -1
- package/dist/src/utils/geom.js +1 -1
- package/dist/src/utils/location.js +1 -1
- package/package.json +1 -1
package/dist/cjs/package.json.js
CHANGED
|
@@ -172,7 +172,7 @@ function registerEvents (app, sendEvent) {
|
|
|
172
172
|
|
|
173
173
|
app.bus.monitor('map/click', async ({ lat, lng, ord }) => {
|
|
174
174
|
const structures = await app.bus.get('venueData/getStructures');
|
|
175
|
-
const { building, floor } = geom.getBuildingAndFloorAtPoint(structures, lat, lng, ord
|
|
175
|
+
const { building, floor } = geom.getBuildingAndFloorAtPoint(structures, lat, lng, ord);
|
|
176
176
|
sendEvent('mapClicked', { lat, lng, ord, building, floor });
|
|
177
177
|
});
|
|
178
178
|
}
|
|
@@ -49,12 +49,7 @@ async function create (app, config) {
|
|
|
49
49
|
async function loadVenueData (vConfig, languagesToTry) {
|
|
50
50
|
// For all non-production stages, require SSO (if no assetStage defined we default to 'prod')
|
|
51
51
|
if (vConfig.assetStage && vConfig.assetStage !== 'prod' && location.hostname !== 'localhost' && USE_AUTH_WHEN_NOT_PROD_STAGE)
|
|
52
|
-
|
|
53
|
-
type: 'cognito',
|
|
54
|
-
config: {
|
|
55
|
-
userPoolWebClientId: '484dghfpojlldauo956d84jtrj'
|
|
56
|
-
}
|
|
57
|
-
};
|
|
52
|
+
;
|
|
58
53
|
|
|
59
54
|
const fetchJson = venueLoadingUtils.createFetchJson();
|
|
60
55
|
const fetchText = venueLoadingUtils.createFetchText();
|
|
@@ -50,8 +50,8 @@ function calculateAdjacent (srcHash, dir) {
|
|
|
50
50
|
|
|
51
51
|
function encode (latitude, longitude, precision) {
|
|
52
52
|
let isEven = 1;
|
|
53
|
-
const lat = [-90
|
|
54
|
-
const lng = [-180
|
|
53
|
+
const lat = [-90, 90.0];
|
|
54
|
+
const lng = [-180, 180.0];
|
|
55
55
|
let bit = 0;
|
|
56
56
|
let ch = 0;
|
|
57
57
|
precision = precision || 12;
|
|
@@ -9,7 +9,7 @@ const $$ = (expr, container) => Array.prototype.slice.call((document).querySelec
|
|
|
9
9
|
// const newDiv = ad({klass: "foo"}) = same as above with class of "foo"
|
|
10
10
|
// const newImg = ad({tag: "img", src: "test.png"}, "#top") = image at end of top
|
|
11
11
|
function ad (eConf, parent) {
|
|
12
|
-
const c = eConf
|
|
12
|
+
const c = eConf;
|
|
13
13
|
parent = parent ? (typeof parent === 'string' ? document.querySelector(parent) : parent) : document.body;
|
|
14
14
|
|
|
15
15
|
let tag = 'div';
|
|
@@ -70,8 +70,8 @@ function getStructureAtPoint (buildings, lat, lng, preciseFlag) {
|
|
|
70
70
|
pointInPolygon([lat, lng], getBoundsCoords(b)));
|
|
71
71
|
|
|
72
72
|
if (buildingsWithinBoundingBox.length === 0) return null
|
|
73
|
-
if (buildingsWithinBoundingBox.length === 1 &&
|
|
74
|
-
|
|
73
|
+
if (buildingsWithinBoundingBox.length === 1 && false)
|
|
74
|
+
;
|
|
75
75
|
|
|
76
76
|
const buildingsWithinBoundsPolygon = buildingsWithinBoundingBox
|
|
77
77
|
.filter(b => pointInPolygon([lat, lng], b.boundsPolygon));
|
|
@@ -110,7 +110,7 @@ const getFloor = (buildings, selectedLevelId) =>
|
|
|
110
110
|
Object.values(building.levels).find(floor => floor.id === selectedLevelId) || fmatch, undefined);
|
|
111
111
|
|
|
112
112
|
function getBuildingAndFloorAtPoint (buildings, lat, lng, ord, preciseFlag) {
|
|
113
|
-
const building = getStructureAtPoint(buildings, lat, lng
|
|
113
|
+
const building = getStructureAtPoint(buildings, lat, lng);
|
|
114
114
|
const floor = building
|
|
115
115
|
? ordToFloor(building, ord)
|
|
116
116
|
: null;
|
|
@@ -37,7 +37,7 @@ async function locationToEndpoint (app, location) {
|
|
|
37
37
|
}
|
|
38
38
|
} else {
|
|
39
39
|
if (floorId == null) {
|
|
40
|
-
const { building, floor } = geom.getBuildingAndFloorAtPoint(structures, lat, lng, ordinal
|
|
40
|
+
const { building, floor } = geom.getBuildingAndFloorAtPoint(structures, lat, lng, ordinal);
|
|
41
41
|
floorId = floor?.id;
|
|
42
42
|
structureId = building?.id;
|
|
43
43
|
}
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="web-engine",s="3.3.
|
|
1
|
+
var e="web-engine",s="3.3.369",o="UNLICENSED",r="module",l="src/main.js",t=["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/**'",e2eTest:"cypress run --browser chrome",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:e2e:video":"cypress run","test:vitest":"vitest"},i=["defaults"],n={"@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","@john-osullivan/react-window-dynamic-fork":"^1.9.0-alpha.1","@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/circle":"^6.5.0","@turf/helpers":"^6.5.0","@turf/point-to-line-distance":"^6.5.0","@vitejs/plugin-react":"^4.0.1",IObject:"^0.7.2","axe-core":"^4.9.0",browserslist:"^4.24.2","crypto-browserify":"^3.12.0","cypress-axe":"^1.5.0","cypress-multi-reporters":"^1.6.4","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:"^17.0.2","react-compound-slider":"^3.3.1","react-dom":"^17.0.2","react-json-editor-ajrm":"^2.5.13","react-qr-svg":"^2.2.1","react-svg":"^16.1.29","react-tageditor":"^0.2.3","react-virtualized-auto-sizer":"^1.0.2","smoothscroll-polyfill":"^0.4.4","styled-components":"5.1.0","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"},c={"@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","@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-polyfill":"^6.26.0","chai-colors":"^1.0.1","css-loader":"^5.2.4",cypress:"^12.17.2","cypress-browser-permissions":"^1.1.0","cypress-real-events":"^1.11.0","cypress-wait-until":"^1.7.1",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"},p="yarn@4.3.1",d={node:">=20"},m={},u={name:e,version:s,private:!0,license:o,type:r,main:l,workspaces:t,scripts:a,"lint-staged":{"*.js":["eslint --fix"]},browserslist:i,dependencies:n,devDependencies:c,packageManager:p,engines:d,nx:m};export{i as browserslist,u as default,n as dependencies,c as devDependencies,d as engines,o as license,l as main,e as name,m as nx,p as packageManager,a as scripts,r as type,s as version,t as workspaces};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getBuildingAndFloorAtPoint as e}from"../../../src/utils/geom.js";import t from"../../../src/utils/observable.js";import{headlessCommands as o,handleHeadless as n}from"./sdkHeadless.js";let a=null;function s(e){const t=(e,t)=>{const o={payload:e,type:"LL-server"};t&&(o.clientMsgId=t);try{window.postMessage(o,"*")}catch(e){window.postMessage((e=>JSON.parse(JSON.stringify(e)))(o),"*")}};function o(o){const n=o.data;n&&"LL-client"===n.type&&e.bus.get("clientAPI/execute",n.payload).then((e=>t(e,n.msgId))).catch((t=>{e.config.debug&&console.error(t),((e,t)=>{const o={error:!0,payload:e,type:"LL-server"};t&&(o.clientMsgId=t),window.postMessage(o,"*")})(t.message,n.msgId)}))}return a&&a(),window.addEventListener("message",o),a=()=>window.removeEventListener("message",o),(e,t)=>{const o={event:e,payload:t,type:"LL-server"};window.postMessage(o,"*")}}async function r(a,r){const i=a.env.isBrowser?s(a):function(e){const o=t();return e.eventListener=o,(e,t)=>o.fire(e,t)}(a);return function(t,o){t.bus.monitor("map/userMoveStart",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("userMoveStart",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a})})),t.bus.monitor("map/userMoving",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("userMoving",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a})})),t.bus.monitor("map/moveEnd",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("moveEnd",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a})})),t.bus.monitor("map/floorChanged",(({structure:e,floor:t})=>o("levelChange",{floorId:t?t.id:null,floorName:t?t.name:null,ord:t?t.ordinal:null,structureId:e?e.id:null,structureName:e?e.name:null}))),t.bus.monitor("map/poiClicked",(({poi:e})=>o("poiSelected",e))),t.bus.monitor("poiDetails/showPoi",(({poi:e})=>o("poiShown",e))),t.bus.monitor("map/click",(async({lat:n,lng:a,ord:s})=>{const r=await t.bus.get("venueData/getStructures"),{building:i,floor:l}=e(r,n,a,s
|
|
1
|
+
import{getBuildingAndFloorAtPoint as e}from"../../../src/utils/geom.js";import t from"../../../src/utils/observable.js";import{headlessCommands as o,handleHeadless as n}from"./sdkHeadless.js";let a=null;function s(e){const t=(e,t)=>{const o={payload:e,type:"LL-server"};t&&(o.clientMsgId=t);try{window.postMessage(o,"*")}catch(e){window.postMessage((e=>JSON.parse(JSON.stringify(e)))(o),"*")}};function o(o){const n=o.data;n&&"LL-client"===n.type&&e.bus.get("clientAPI/execute",n.payload).then((e=>t(e,n.msgId))).catch((t=>{e.config.debug&&console.error(t),((e,t)=>{const o={error:!0,payload:e,type:"LL-server"};t&&(o.clientMsgId=t),window.postMessage(o,"*")})(t.message,n.msgId)}))}return a&&a(),window.addEventListener("message",o),a=()=>window.removeEventListener("message",o),(e,t)=>{const o={event:e,payload:t,type:"LL-server"};window.postMessage(o,"*")}}async function r(a,r){const i=a.env.isBrowser?s(a):function(e){const o=t();return e.eventListener=o,(e,t)=>o.fire(e,t)}(a);return function(t,o){t.bus.monitor("map/userMoveStart",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("userMoveStart",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a})})),t.bus.monitor("map/userMoving",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("userMoving",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a})})),t.bus.monitor("map/moveEnd",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("moveEnd",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a})})),t.bus.monitor("map/floorChanged",(({structure:e,floor:t})=>o("levelChange",{floorId:t?t.id:null,floorName:t?t.name:null,ord:t?t.ordinal:null,structureId:e?e.id:null,structureName:e?e.name:null}))),t.bus.monitor("map/poiClicked",(({poi:e})=>o("poiSelected",e))),t.bus.monitor("poiDetails/showPoi",(({poi:e})=>o("poiShown",e))),t.bus.monitor("map/click",(async({lat:n,lng:a,ord:s})=>{const r=await t.bus.get("venueData/getStructures"),{building:i,floor:l}=e(r,n,a,s);o("mapClicked",{lat:n,lng:a,ord:s,building:i,floor:l})}))}(a,i),{init:async()=>{!function(e){e.bus.send("clientAPI/registerCustomType",{name:"latLngOrdLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"ord",type:"integer"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"latLngFloorLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"floorId",type:"string"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"poiIdLocation",spec:{type:"object",props:[{name:"poiId",type:"integer",min:0}]}}),e.bus.send("clientAPI/registerCustomType",{name:"location",spec:{type:"multi",types:[{type:"poiIdLocation"},{type:"latLngOrdLocation"},{type:"latLngFloorLocation"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"viewSettings",spec:{type:"object",props:[{name:"zoom",type:"float",optional:!0},{name:"pitch",type:"float",optional:!0},{name:"bearing",type:"float",optional:!0}]}})}(a),o.forEach((e=>a.bus.send("clientAPI/registerCommand",e))),n(a),r.headless||await import("../../../_virtual/_empty_module_placeholder.js").then((e=>{e.visualCommands.forEach((e=>a.bus.send("clientAPI/registerCommand",e))),e.handleVisual(a,i)}));const e=async()=>{await a.bus.send("system/readywhenyouare"),a.bus.get("clientAPI/execute",{command:"getCommandJSON"}).then((e=>i("ready",{commandJSON:e}))),!r.headless&&a.config.uiHide&&a.config.uiHide.sidebar&&a.env.isDesktop()&&a.bus.send("map/changePadding",{padding:{left:55,right:55,top:72,bottom:22}})};r.headless?Promise.all([new Promise((e=>a.bus.monitor("venueData/navGraphLoaded",e))),new Promise((e=>a.bus.monitor("venueData/poiDataLoaded",e)))]).then(e):a.bus.on("map/mapReadyToShow",e),a.bus.on("sdkServer/sendEvent",(({eventName:e,...t})=>i(e,t)))}}}export{r as create};
|
package/dist/src/utils/dom.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=(t,e)=>"string"==typeof t?(e||document).querySelector(t):t||null,e=(t,e)=>Array.prototype.slice.call(document.querySelectorAll(t));function n(t,e){const n=t
|
|
1
|
+
const t=(t,e)=>"string"==typeof t?(e||document).querySelector(t):t||null,e=(t,e)=>Array.prototype.slice.call(document.querySelectorAll(t));function n(t,e){const n=t;e=e?"string"==typeof e?document.querySelector(e):e:document.body;let l="div";n.tag&&(l=n.tag);const s=document.createElement(l);for(const t in n)null!=n[t]&&("klass"===t?s.setAttribute("class",n.klass):"tag"===t||("styles"===t?o(s,n.styles):"text"===t?s.textContent=n.text:"html"===t?s.innerHTML=n.html:s.setAttribute(t,n[t])));return e.appendChild(s),s}const o=(t,e)=>{for(const n in e)t.style[n]=e[n]};export{t as $,e as $$,n as ad,o as setStyles};
|
package/dist/src/utils/geom.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"@turf/helpers";import"@turf/point-to-line-distance";import*as n from"ramda";const e=(n,e)=>{const t=n[0],l=n[1];let r=!1;for(let n=0,u=e.length-1;n<e.length;u=n++){const o=e[n][0],s=e[n][1],i=e[u][0],c=e[u][1];s>l!=c>l&&t<(i-o)*(l-s)/(c-s)+o&&(r=!r)}return r};function t(t,l,u,o){if(!n.length(t))return null;const s=(t=t.filter((n=>null==n.shouldDisplay||!0===n.shouldDisplay))).filter((n=>e([l,u],(n=>{const{n:e,s:t,e:l,w:r}=n.bounds;return[[e,l],[e,r],[t,r],[t,l],[e,l]]})(n))));if(0===s.length)return null;
|
|
1
|
+
import"@turf/helpers";import"@turf/point-to-line-distance";import*as n from"ramda";const e=(n,e)=>{const t=n[0],l=n[1];let r=!1;for(let n=0,u=e.length-1;n<e.length;u=n++){const o=e[n][0],s=e[n][1],i=e[u][0],c=e[u][1];s>l!=c>l&&t<(i-o)*(l-s)/(c-s)+o&&(r=!r)}return r};function t(t,l,u,o){if(!n.length(t))return null;const s=(t=t.filter((n=>null==n.shouldDisplay||!0===n.shouldDisplay))).filter((n=>e([l,u],(n=>{const{n:e,s:t,e:l,w:r}=n.bounds;return[[e,l],[e,r],[t,r],[t,l],[e,l]]})(n))));if(0===s.length)return null;s.length;const i=s.filter((n=>e([l,u],n.boundsPolygon)));return 1===i.length?n.head(i):i.length?r(s):null}const l=n=>{if(!n.bounds)return 0;const{n:e,s:t,e:l,w:r}=n.bounds;return Math.abs((e-t)*(l-r))},r=n=>{return n.reduce((e=l,(n,t)=>e(n)<e(t)?n:t));var e},u=(n,e)=>Object.values(n.levels).find((n=>n.ordinal===e)),o=(n,e)=>n.reduce(((n,t)=>Object.values(t.levels).find((n=>n.id===e))||n),void 0);function s(n,e,l,r,o){const s=t(n,e,l);return{building:s,floor:s?u(s,r):null}}const i=(n,e)=>n.reduce(((n,t)=>c(t,e)?t:n),null),c=(n,e)=>Object.values(n.levels).reduce(((n,t)=>t.id===e||n),!1);function d(n,e,t,l,r,u,o,s){let i=0,c=0,d=0,f=0,a=0;const h=[{x:n,y:e}];for(let b=1,g=0;b<=20;++b)g=b/20,i=1-g,c=i*i,d=c*i,f=g*g,a=f*g,h.push({x:d*n+3*c*g*t+3*i*f*r+a*o,y:d*e+3*c*g*l+3*i*f*u+a*s});return h}export{d as bezierCurveTo,s as getBuildingAndFloorAtPoint,o as getFloor,t as getStructureAtPoint,i as getStructureForFloorId,u as ordToFloor,e as pointInPolygon};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFloor as o,getBuildingAndFloorAtPoint as t,getStructureForFloorId as n}from"./geom.js";async function l(l,i){if(i.poiId)return l.bus.get("wayfinder/getNavigationEndpoint",{ep:i.poiId});let{lat:a,lng:d,ord:e,ordinal:u,floorId:f,title:s="",structureId:c}=i;if(null==a||null==d)throw Error("To obtain a location, you must provide a lat,lng or a poiId");void 0===u&&void 0!==e&&(u=e);const g=await r(l);if(null==u){if(null==f)throw Error("Call to locationToEndpoint with no ordinal and no floorId");{const t=o(g,f);if(!t)throw Error(`floor with id ${f} not found.`);u=t.ordinal}}else if(null==f){const{building:o,floor:n}=t(g,a,d,u
|
|
1
|
+
import{getFloor as o,getBuildingAndFloorAtPoint as t,getStructureForFloorId as n}from"./geom.js";async function l(l,i){if(i.poiId)return l.bus.get("wayfinder/getNavigationEndpoint",{ep:i.poiId});let{lat:a,lng:d,ord:e,ordinal:u,floorId:f,title:s="",structureId:c}=i;if(null==a||null==d)throw Error("To obtain a location, you must provide a lat,lng or a poiId");void 0===u&&void 0!==e&&(u=e);const g=await r(l);if(null==u){if(null==f)throw Error("Call to locationToEndpoint with no ordinal and no floorId");{const t=o(g,f);if(!t)throw Error(`floor with id ${f} not found.`);u=t.ordinal}}else if(null==f){const{building:o,floor:n}=t(g,a,d,u);f=n?.id,c=o?.id}return null!=f&&null==c&&(c=n(g,f)?.id),{lat:a,lng:d,floorId:f,ordinal:u,title:s,structureId:c}}const r=async o=>o.bus.get("venueData/getVenueData").then((o=>o.structures));export{r as getStructures,l as locationToEndpoint};
|
package/package.json
CHANGED