@expofp/floorplan 3.1.4 → 3.1.6
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/browser/{CookieConsent-A4g2GEnB.js → CookieConsent-BQRtYE9s.js} +31 -31
- package/dist/browser/{Debug-okM_H6zB.js → Debug-CqIDicZk.js} +8 -8
- package/dist/browser/{Demo-3Yx1xi6F.js → Demo-DHwBBvDj.js} +10 -10
- package/dist/browser/{Free-Iqh_45NP.js → Free-CGFqucK0.js} +10 -10
- package/dist/browser/{Gallery-CMu4jjUa.js → Gallery-brxxV-es.js} +10 -10
- package/dist/browser/{GpsLoader-xmUlSf3T.js → GpsLoader-huNG_SEW.js} +8 -8
- package/dist/browser/{KioskStore-DomUDeuw.js → KioskStore-OxVGiMqM.js} +3 -3
- package/dist/browser/{Mapbox-D3-e_F58.js → Mapbox-B6Bc6kvJ.js} +8 -8
- package/dist/browser/{SetKioskMode-BOvxWaGI.js → SetKioskMode-kMWI1Ank.js} +7 -7
- package/dist/browser/{ShowKiosk-xp1WbCm-.js → ShowKiosk-BIauf0VT.js} +9 -9
- package/dist/browser/{ThreeComponent-C7dPjvKl.js → ThreeComponent-BB2oeLUQ.js} +9 -9
- package/dist/browser/{TouchHand-QzRQPyEl.js → TouchHand-s_3z3HHs.js} +6 -6
- package/dist/browser/{ViewerMenuPanel-lREjYMl2.js → ViewerMenuPanel-DmR7UZRv.js} +9 -9
- package/dist/browser/{add-debug-secret-listener-s_Acfb_j.js → add-debug-secret-listener-DzCEnj9u.js} +1 -1
- package/dist/browser/{boolean-editor-BN7VDvLb.js → boolean-editor-7sR_iyHL.js} +6 -6
- package/dist/browser/{bootIntercom-BsKv9v5g.js → bootIntercom-CdouL-BE.js} +1 -1
- package/dist/browser/bundle.json +44 -44
- package/dist/browser/{chunk-CilcQ-DK.js → chunk-5s3M-J3g.js} +1 -1
- package/dist/browser/{classnames-BG0vlDcj.js → classnames-DLZ1u1dy.js} +2 -2
- package/dist/browser/{client-CfMi8siJ.js → client-D37dTvOp.js} +4 -4
- package/dist/browser/{data-a-dtD_1P.js → data-CGWR_QAC.js} +5 -5
- package/dist/browser/{debug-overlay-CoH7X4al.js → debug-overlay-C0eS2gGV.js} +10 -10
- package/dist/browser/{debug-ui-DouD3wg5.js → debug-ui-CC3jwsbR.js} +6 -6
- package/dist/browser/{dist-CzsjAsAg.js → dist-DshHlWqx.js} +5 -5
- package/dist/browser/{exports-BWEh5Wje.js → exports-DotumsAg.js} +1 -1
- package/dist/browser/{favicon-CmG6QFs2.js → favicon-DMl0QnQC.js} +1 -1
- package/dist/browser/{fetch-retry.umd-B_g_JELw.js → fetch-retry.umd-DIvq8vBo.js} +2 -2
- package/dist/browser/{flex-BQA_6ztI.js → flex-CvtwJKEH.js} +6 -6
- package/dist/browser/{floorplan.loader-CrKDeH3d.js → floorplan.loader-DNg31ZpC.js} +9 -9
- package/dist/browser/{floorplan.ready-xulLyTpM.js → floorplan.ready-CcU0CPvR.js} +10 -10
- package/dist/browser/{fuse-Cxy73jl3.js → fuse-FpOCifji.js} +2 -2
- package/dist/browser/index.js +11 -11
- package/dist/browser/{is-debug-BMJczZcU.js → is-debug-DTyH3H5u.js} +2 -2
- package/dist/browser/{jsx-runtime-DDrJF8xL.js → jsx-runtime-DGpX2A7L.js} +2 -2
- package/dist/browser/{lib-B1mH8TSv.js → lib-o2gJt9qP.js} +4 -4
- package/dist/browser/{main-CTfIntH-.js → main-D8Wb0Q22.js} +1 -1
- package/dist/browser/{mobx-CNTM25Oc.js → mobx-TBqijVh8.js} +4 -4
- package/dist/browser/{particles.min-DHOz1yro.js → particles.min-Doq-QEvC.js} +2 -2
- package/dist/browser/{prop-types-B-y83www.js → prop-types-Ca2dELmw.js} +2 -2
- package/dist/browser/{react-VoeHpohi.js → react-CeEvNmEB.js} +2 -2
- package/dist/browser/{react-dom-CN7XBo22.js → react-dom-BB0C4Sxg.js} +3 -3
- package/dist/browser/{reset-all-settings-x3j4rKGC.js → reset-all-settings-BAfPvEum.js} +1 -1
- package/dist/browser/{settings-DYv1eHiY.js → settings-VfT-AYP7.js} +6 -6
- package/dist/browser/{src-CdV1RTUv.js → src-BLrvRGCp.js} +4 -4
- package/dist/browser/{store-BkBqfYWF.js → store-DZdC2ZQ6.js} +22 -16
- package/dist/browser/{ui-DqL_r_LU.js → ui-Dyvo4yyp.js} +6 -6
- package/dist/esm/components/Layout.js +1 -1
- package/dist/esm/components/LogoOverlay.js +1 -1
- package/dist/esm/components/Map/Map.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-wf.js +1 -1
- package/dist/esm/components/Mapbox/utils/data.js +1 -1
- package/dist/esm/floorplan.ready.js +1 -1
- package/dist/esm/store/MapboxStore.js +1 -1
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/utils/gps.js +1 -1
- package/package.json +4 -4
- /package/dist/esm/{components/Mapbox/utils → data}/fpGeo.d.ts +0 -0
- /package/dist/esm/{components/Mapbox/utils → data}/fpGeo.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__esDecorate as i,__runInitializers as r}from"tslib";import{action as m,computed as k,observable as d}from"mobx";import{Point as Ve,lineLength as Me}from"simple-geometry";import o,{boothStore as je,layersStore as x}from".";import{fpGeo as T}from"../components/Mapbox/utils/fpGeo";import We from"../core/Rect";import{GaEventActions as Ke,sendEventToGa as Xe}from"../tools/gtag";import{convertGpsToLocal as Be,isValidPointCoords as Ce,calculateRelativeBearing as Ye}from"../utils/gps";import{getLayerSvg as He,svgArea as Je}from"../data/svg";import{getGraphLines as Qe,boothToWaypoint as Fe,graphDataSource as Ge}from"../wayfinding";import{LayersMode as et}from"./LayerStore";import{uiState as p}from"./index";import{calcSpeed as Ue}from"../utils/calcSpeed";import{calcTravelTime as Oe}from"../utils/calcTravelTime";import{DEFAULT_UNITS as Ne,ORIENTATION_GRANTED_KEY as tt}from"../constants";import{areLayersEnabled as st}from"../utils/areLayersEnabled";import{distancePointToRouteOnLayer as at,findBoothInRadius as it}from"../components/Map/drawing/config/route-snapping";import Ze from"../data";import qe from"../tools/logger";import rt from"../tools/settings";const g=a=>typeof a=="string"?Number(a.replace(",",".")):a;let nt=(()=>{let a=[],n,l=[],f=[],h,v=[],R=[],L,E=[],z=[],P,D=[],I=[],w,A=[],M=[],B,C=[],F=[],G,U=[],O=[],N,Z=[],q=[],$,V=[],j=[],W,K=[],X=[],Y,H=[],J=[],Q,ee=[],te=[],se,ae=[],ie=[],re,ne=[],oe=[],le,ce,ue,de,fe,he,me,pe,_e,ge,ye,ke,be,ve=[],Re=[],xe,Se,Te,Le,Ee,ze,Pe=[],De=[],Ie,we;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[d],h=[d],L=[d],P=[d],w=[d],B=[d],G=[d],N=[d],$=[d],W=[d],Y=[d],Q=[d],se=[d],re=[d],le=[k],ce=[m],ue=[m],de=[k({keepAlive:!0})],fe=[k({keepAlive:!0})],he=[m],me=[m],pe=[k({keepAlive:!0})],_e=[k({keepAlive:!0})],ge=[m],ye=[m],ke=[m],be=[d],xe=[k],Se=[m],Te=[m],Le=[m],Ee=[m],ze=[d],Ie=[m],we=[k({keepAlive:!0})],i(this,null,le,{kind:"getter",name:"canFindLocation",static:!1,private:!1,access:{has:e=>"canFindLocation"in e,get:e=>e.canFindLocation},metadata:t},null,a),i(this,null,ce,{kind:"method",name:"selectRoute",static:!1,private:!1,access:{has:e=>"selectRoute"in e,get:e=>e.selectRoute},metadata:t},null,a),i(this,null,ue,{kind:"method",name:"setStartPoint",static:!1,private:!1,access:{has:e=>"setStartPoint"in e,get:e=>e.setStartPoint},metadata:t},null,a),i(this,null,de,{kind:"getter",name:"pathLayers",static:!1,private:!1,access:{has:e=>"pathLayers"in e,get:e=>e.pathLayers},metadata:t},null,a),i(this,null,fe,{kind:"getter",name:"nearestBooth",static:!1,private:!1,access:{has:e=>"nearestBooth"in e,get:e=>e.nearestBooth},metadata:t},null,a),i(this,null,he,{kind:"method",name:"setMarkers",static:!1,private:!1,access:{has:e=>"setMarkers"in e,get:e=>e.setMarkers},metadata:t},null,a),i(this,null,me,{kind:"method",name:"selectMarker",static:!1,private:!1,access:{has:e=>"selectMarker"in e,get:e=>e.selectMarker},metadata:t},null,a),i(this,null,pe,{kind:"getter",name:"selectedMarkers",static:!1,private:!1,access:{has:e=>"selectedMarkers"in e,get:e=>e.selectedMarkers},metadata:t},null,a),i(this,null,_e,{kind:"getter",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers},metadata:t},null,a),i(this,null,ge,{kind:"method",name:"clickRoute",static:!1,private:!1,access:{has:e=>"clickRoute"in e,get:e=>e.clickRoute},metadata:t},null,a),i(this,null,ye,{kind:"method",name:"selectCurrentPosition",static:!1,private:!1,access:{has:e=>"selectCurrentPosition"in e,get:e=>e.selectCurrentPosition},metadata:t},null,a),i(this,null,ke,{kind:"method",name:"findLocation",static:!1,private:!1,access:{has:e=>"findLocation"in e,get:e=>e.findLocation},metadata:t},null,a),i(this,null,xe,{kind:"getter",name:"routeInfo",static:!1,private:!1,access:{has:e=>"routeInfo"in e,get:e=>e.routeInfo},metadata:t},null,a),i(this,null,Se,{kind:"method",name:"updateRoute",static:!1,private:!1,access:{has:e=>"updateRoute"in e,get:e=>e.updateRoute},metadata:t},null,a),i(this,null,Te,{kind:"method",name:"updateRouteDistance",static:!1,private:!1,access:{has:e=>"updateRouteDistance"in e,get:e=>e.updateRouteDistance},metadata:t},null,a),i(this,null,Le,{kind:"method",name:"updateRoutePoints",static:!1,private:!1,access:{has:e=>"updateRoutePoints"in e,get:e=>e.updateRoutePoints},metadata:t},null,a),i(this,null,Ee,{kind:"method",name:"checkRoutes",static:!1,private:!1,access:{has:e=>"checkRoutes"in e,get:e=>e.checkRoutes},metadata:t},null,a),i(this,null,Ie,{kind:"method",name:"setGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"setGpsTrackingEnabled"in e,get:e=>e.setGpsTrackingEnabled},metadata:t},null,a),i(this,null,we,{kind:"getter",name:"gpsEnabled",static:!1,private:!1,access:{has:e=>"gpsEnabled"in e,get:e=>e.gpsEnabled},metadata:t},null,a),i(null,null,n,{kind:"field",name:"routeLines",static:!1,private:!1,access:{has:e=>"routeLines"in e,get:e=>e.routeLines,set:(e,s)=>{e.routeLines=s}},metadata:t},l,f),i(null,null,h,{kind:"field",name:"routeDistance",static:!1,private:!1,access:{has:e=>"routeDistance"in e,get:e=>e.routeDistance,set:(e,s)=>{e.routeDistance=s}},metadata:t},v,R),i(null,null,L,{kind:"field",name:"currentPosition",static:!1,private:!1,access:{has:e=>"currentPosition"in e,get:e=>e.currentPosition,set:(e,s)=>{e.currentPosition=s}},metadata:t},E,z),i(null,null,P,{kind:"field",name:"requestCompass",static:!1,private:!1,access:{has:e=>"requestCompass"in e,get:e=>e.requestCompass,set:(e,s)=>{e.requestCompass=s}},metadata:t},D,I),i(null,null,w,{kind:"field",name:"iconType",static:!1,private:!1,access:{has:e=>"iconType"in e,get:e=>e.iconType,set:(e,s)=>{e.iconType=s}},metadata:t},A,M),i(null,null,B,{kind:"field",name:"tempToBooth",static:!1,private:!1,access:{has:e=>"tempToBooth"in e,get:e=>e.tempToBooth,set:(e,s)=>{e.tempToBooth=s}},metadata:t},C,F),i(null,null,G,{kind:"field",name:"defaultFrom",static:!1,private:!1,access:{has:e=>"defaultFrom"in e,get:e=>e.defaultFrom,set:(e,s)=>{e.defaultFrom=s}},metadata:t},U,O),i(null,null,N,{kind:"field",name:"focusEnabled",static:!1,private:!1,access:{has:e=>"focusEnabled"in e,get:e=>e.focusEnabled,set:(e,s)=>{e.focusEnabled=s}},metadata:t},Z,q),i(null,null,$,{kind:"field",name:"prevZ",static:!1,private:!1,access:{has:e=>"prevZ"in e,get:e=>e.prevZ,set:(e,s)=>{e.prevZ=s}},metadata:t},V,j),i(null,null,W,{kind:"field",name:"markersData",static:!1,private:!1,access:{has:e=>"markersData"in e,get:e=>e.markersData,set:(e,s)=>{e.markersData=s}},metadata:t},K,X),i(null,null,Y,{kind:"field",name:"prevMarkers",static:!1,private:!1,access:{has:e=>"prevMarkers"in e,get:e=>e.prevMarkers,set:(e,s)=>{e.prevMarkers=s}},metadata:t},H,J),i(null,null,Q,{kind:"field",name:"showAccessible",static:!1,private:!1,access:{has:e=>"showAccessible"in e,get:e=>e.showAccessible,set:(e,s)=>{e.showAccessible=s}},metadata:t},ee,te),i(null,null,se,{kind:"field",name:"onlyAccessible",static:!1,private:!1,access:{has:e=>"onlyAccessible"in e,get:e=>e.onlyAccessible,set:(e,s)=>{e.onlyAccessible=s}},metadata:t},ae,ie),i(null,null,re,{kind:"field",name:"currentRouteLayer",static:!1,private:!1,access:{has:e=>"currentRouteLayer"in e,get:e=>e.currentRouteLayer,set:(e,s)=>{e.currentRouteLayer=s}},metadata:t},ne,oe),i(null,null,be,{kind:"field",name:"routeUnits",static:!1,private:!1,access:{has:e=>"routeUnits"in e,get:e=>e.routeUnits,set:(e,s)=>{e.routeUnits=s}},metadata:t},ve,Re),i(null,null,ze,{kind:"field",name:"isGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"isGpsTrackingEnabled"in e,get:e=>e.isGpsTrackingEnabled,set:(e,s)=>{e.isGpsTrackingEnabled=s}},metadata:t},Pe,De),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=r(this,a);cpTimeout;routeLines=r(this,l,[]);routeDistance=(r(this,f),r(this,v,null));currentPosition=(r(this,R),r(this,E,null));requestCompass=(r(this,z),r(this,D,!1));iconType=(r(this,I),r(this,A,0));tempToBooth=(r(this,M),r(this,C,null));defaultFrom=(r(this,F),r(this,U,null));focusEnabled=(r(this,O),r(this,Z,!0));prevZ=(r(this,q),r(this,V,null));markersData=(r(this,j),r(this,K,{icons:[],markers:[]}));prevMarkers=(r(this,X),r(this,H,[]));showAccessible=(r(this,J),r(this,ee,!!Ge.getLines().find(t=>t.unaccessible)));onlyAccessible=(r(this,te),r(this,ae,!1));currentRouteLayer=(r(this,ie),r(this,ne,null));constructor(t){r(this,De),this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!this.defaultFrom||!!this.currentPosition}selectRoute(t,e=!0){e&&(p.list={type:"search",text:"",focused:!1}),!t?.from&&t?.to&&this.currentPosition&&(t.from=this.nearestBooth),t?.from&&t?.to&&t.from===t.to&&(t=null);let s=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from?.visible&&s.push(t.from),t?.to?.visible&&(this.tempToBooth=null,s.push(t.to)),!t&&o.fp.onDirection&&o.fp.onDirection(null),setTimeout(()=>{this.rootStore.moveToList(s),p.details=t,t&&(!t.from||!t.to)&&o.showOverlay(),t?.to&&t?.from?.layer&&this.rootStore.layerStore.updateVisibility(t.from.layer,!0),!this.currentRouteLayer&&t?.from?.layer&&(this.currentRouteLayer=t?.from?.layer),e&&t?.from&&t?.to&&Xe(Ke.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)},200)}setStartPoint(t){const e=p.selectedRoute;if(e?.to&&!e?.from&&t){const s=new Route(t,e.to,e.waypoints);this.selectRoute(s)}}get pathLayers(){return o.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,s)=>s.indexOf(t)===e).reverse().map((t,e)=>({id:e+1,layer:o.layerStore.findLayer(t)}))}get nearestBooth(){return this.getNearestBooth(this.currentPosition)}getNearestBooth(t){if(!t)return null;let e=this.rootStore.layerStore.findLayer(t.z);const s=t.lat&&t.lng?Be(t,T.properties.config):t;return this.rootStore.boothStore.booths.filter(c=>x.mode===et.Default||!e?c.visible&&c.rect:c.rect&&(typeof t.z!="number"&&!t.z&&c.visible||e.name===c.layer?.name)).sort((c,u)=>Me(s,{x:c.rect.cx,y:c.rect.cy})-Me(s,{x:u.rect.cx,y:u.rect.cy}))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(ot),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const s=this.markersData.markers.find(u=>u.id===t);this.markersData.markers.forEach(u=>u.active=!1),s&&(s.active=!0);let c=o.layerStore.findLayer(s?.z);if(e&&s){const u=o.rendererService.renderer;return c&&!c?.visible&&x.updateVisibility(c,!0),u?u.controls.panTo(s.x,s.y):(qe.warn("Renderer is not initialized. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(t=>t.active)}get layers(){var t=[];return o.routeStore.routeLines?.map(e=>e.p0.layer).reverse().forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>o.layerStore.layers.find(s=>s.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,p.list.type==="route-planner"&&(p.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(this.defaultFrom||t,e))}selectCurrentPosition(t,e=!0,s){clearTimeout(this.cpTimeout),t&&(t.x=g(t.x),t.y=g(t.y),t.lat=g(t.lat),t.lng=g(t.lng),st()||(t.z=null)),e=!(e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route))&&(this.focusEnabled||this.prevZ!=t?.z),this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=s?1:0;const u=t?lt(t):null;if(!u){this.currentPosition=null;return}const _=o.layerStore.findLayer(t.z),b=new CurrentPosition(u.x,u.y,_?.name||this.currentRouteLayer?.name,Ye(u),t.lat,t.lng),S=p.selectedRoute;let Ae=!this.routeLines?.length;if(_&&this.routeLines?.length&&(Ae=!!this.routeLines.find(y=>y.p0.layer===_.name||y.p1.layer===_.name)),e&&Ae){const y=o.rendererService.renderer;if(_&&!_?.visible&&x.updateVisibility(_,!0),!y){qe.warn("Renderer is not initialized. Cannot pan to current position.");return}y.controls.panTo(b.x,b.y)}const $e=!(rt.EXPO==="cloudnext26")&&ct(b,this.routeLines)&&!!it(b,je.booths,[S?.to]);if(S&&$e){const y=o.routeStore.getNearestBooth(b);o.routeStore.selectRoute(new Route(y,S?.to),!1)}this.currentPosition=b,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(this.canFindLocation){if(o.mapboxStore.showMapbox){p.moveToLocation=!0;return}if(o.routeStore.currentPosition){const t=o.routeStore.currentPosition,e=We.fromCxcywh(t.x,t.y,100,100);if(!e.intersects(Je))return;localStorage.getItem(tt)==="false"&&(o.routeStore.requestCompass=!0),p.moveToRect=e;const c=o.layerStore.findLayer(o.routeStore.currentPosition?.z);c&&x.updateVisibility(c,!0)}else o.selectBooth(o.routeStore.defaultFrom)}}routeUnits=(r(this,oe),r(this,ve,Ne));get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:Oe(t,Ue(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=He(),s=(e.getAttribute("units")||Ne).toLowerCase?.().trim(),c=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(c?1:10)),this.routeUnits=s,this.updateRoutePoints()}updateRoutePoints(){const t=p.selectedRoute,e=this.routeDistance,s=this.routeUnits;o.fp.onDirection&&setTimeout(()=>{o.fp.onDirection({from:t?.from?{id:t.from.id,name:t.from.name,externalId:t.from.externalId,layer:{name:t.from?.layer?.name,description:t.from?.layer?.description}}:null,to:t?.to?{id:t.to.id,name:t.to.name,externalId:t.to.externalId,layer:{name:t.to.layer?.name,description:t.to.layer?.description}}:null,lines:this.routeLines,distance:`${e}${s}`,units:s,time:Oe(e,Ue(s))})},200)}checkRoutes(){let t=o.boothStore.booths;console.info(`Route check started ${t.length}.... `);for(let e=0;e<t.length;e++){const s=t[e];for(let c=e+1;c<t.length;c++){const u=t[c];Qe(Ge,Fe(s),Fe(u)).length||console.warn(`No route found from ${s.name} to ${u.name}`)}}console.info("Route check done....")}isGpsTrackingEnabled=(r(this,Re),r(this,Pe,!0));setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return Ze.autoTrackingGps&&this.isGpsTrackingEnabled&&!Ze.enableIPS}}})();export default nt;function ot(a){return{...a,x:g(a.x),y:g(a.y),lat:g(a.lat),lng:g(a.lng)}}function lt(a){let n=null,l=null;return T&&(n=T.properties.config),n&&a.x>=n.p0.x&&a.x<=n.p2.x&&a.y>=n.p0.y&&a.y<=n.p2.y?l={...a}:n&&Ce(a.lat)&&Ce(a.lng)?l=Be(a,n):n||(l=a),l||null}export function findBooth(a){return o.boothStore.findBooth(a)||o.exhibitorStore.findExhibitor(a)?.booths[0]}export function findEntityByExternalId(a){const n=o.boothStore.boothByExternalId.get(a);if(n)return{type:"booth",entity:n};const l=o.exhibitorStore.exhibitorByExternalId.get(a);if(l)return{type:"exhibitor",entity:l}}export function separateExternalIds(a){const n=[],l=[];for(const f of a){const h=findEntityByExternalId(f);h&&(h.type==="booth"?n.push(f):l.push(f))}return{boothExternalIds:n,exhibitorExternalIds:l}}export function extractRoute(a,n,l){return new Route(findBooth(a)??o.routeStore.defaultFrom??null,findBooth(n),l?.map(f=>findBooth(f)))}export class Route{from;to;waypoints;constructor(n,l,f){this.from=n,this.to=l,this.waypoints=f,this.waypoints=f?.filter(h=>h&&h.id!==n?.id&&h.id!==l?.id)}}export class CurrentPosition extends Ve{x;y;z;angle;lat;lng;constructor(n,l,f,h,v,R){super(n,l),this.x=n,this.y=l,this.z=f,this.angle=h,this.lat=v,this.lng=R}}function ct(a,n,l=10){if(!a||!n?.length)return!1;const f={layer:a.z?String(a.z):void 0,x:a.x,y:a.y},h=at(f,n);return isFinite(h)&&h>l}
|
|
1
|
+
import{__esDecorate as i,__runInitializers as r}from"tslib";import{action as m,computed as k,observable as d}from"mobx";import{Point as Ve,lineLength as Me}from"simple-geometry";import o,{boothStore as je,layersStore as x}from".";import{fpGeo as T}from"../data/fpGeo";import We from"../core/Rect";import{GaEventActions as Ke,sendEventToGa as Xe}from"../tools/gtag";import{convertGpsToLocal as Be,isValidPointCoords as Ce,calculateRelativeBearing as Ye}from"../utils/gps";import{getLayerSvg as He,svgArea as Je}from"../data/svg";import{getGraphLines as Qe,boothToWaypoint as Fe,graphDataSource as Ge}from"../wayfinding";import{LayersMode as et}from"./LayerStore";import{uiState as p}from"./index";import{calcSpeed as Ue}from"../utils/calcSpeed";import{calcTravelTime as Oe}from"../utils/calcTravelTime";import{DEFAULT_UNITS as Ne,ORIENTATION_GRANTED_KEY as tt}from"../constants";import{areLayersEnabled as st}from"../utils/areLayersEnabled";import{distancePointToRouteOnLayer as at,findBoothInRadius as it}from"../components/Map/drawing/config/route-snapping";import Ze from"../data";import qe from"../tools/logger";import rt from"../tools/settings";const g=a=>typeof a=="string"?Number(a.replace(",",".")):a;let nt=(()=>{let a=[],n,l=[],f=[],h,v=[],R=[],L,E=[],z=[],P,D=[],I=[],w,A=[],M=[],B,C=[],F=[],G,U=[],O=[],N,Z=[],q=[],$,V=[],j=[],W,K=[],X=[],Y,H=[],J=[],Q,ee=[],te=[],se,ae=[],ie=[],re,ne=[],oe=[],le,ce,ue,de,fe,he,me,pe,_e,ge,ye,ke,be,ve=[],Re=[],xe,Se,Te,Le,Ee,ze,Pe=[],De=[],Ie,we;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[d],h=[d],L=[d],P=[d],w=[d],B=[d],G=[d],N=[d],$=[d],W=[d],Y=[d],Q=[d],se=[d],re=[d],le=[k],ce=[m],ue=[m],de=[k({keepAlive:!0})],fe=[k({keepAlive:!0})],he=[m],me=[m],pe=[k({keepAlive:!0})],_e=[k({keepAlive:!0})],ge=[m],ye=[m],ke=[m],be=[d],xe=[k],Se=[m],Te=[m],Le=[m],Ee=[m],ze=[d],Ie=[m],we=[k({keepAlive:!0})],i(this,null,le,{kind:"getter",name:"canFindLocation",static:!1,private:!1,access:{has:e=>"canFindLocation"in e,get:e=>e.canFindLocation},metadata:t},null,a),i(this,null,ce,{kind:"method",name:"selectRoute",static:!1,private:!1,access:{has:e=>"selectRoute"in e,get:e=>e.selectRoute},metadata:t},null,a),i(this,null,ue,{kind:"method",name:"setStartPoint",static:!1,private:!1,access:{has:e=>"setStartPoint"in e,get:e=>e.setStartPoint},metadata:t},null,a),i(this,null,de,{kind:"getter",name:"pathLayers",static:!1,private:!1,access:{has:e=>"pathLayers"in e,get:e=>e.pathLayers},metadata:t},null,a),i(this,null,fe,{kind:"getter",name:"nearestBooth",static:!1,private:!1,access:{has:e=>"nearestBooth"in e,get:e=>e.nearestBooth},metadata:t},null,a),i(this,null,he,{kind:"method",name:"setMarkers",static:!1,private:!1,access:{has:e=>"setMarkers"in e,get:e=>e.setMarkers},metadata:t},null,a),i(this,null,me,{kind:"method",name:"selectMarker",static:!1,private:!1,access:{has:e=>"selectMarker"in e,get:e=>e.selectMarker},metadata:t},null,a),i(this,null,pe,{kind:"getter",name:"selectedMarkers",static:!1,private:!1,access:{has:e=>"selectedMarkers"in e,get:e=>e.selectedMarkers},metadata:t},null,a),i(this,null,_e,{kind:"getter",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers},metadata:t},null,a),i(this,null,ge,{kind:"method",name:"clickRoute",static:!1,private:!1,access:{has:e=>"clickRoute"in e,get:e=>e.clickRoute},metadata:t},null,a),i(this,null,ye,{kind:"method",name:"selectCurrentPosition",static:!1,private:!1,access:{has:e=>"selectCurrentPosition"in e,get:e=>e.selectCurrentPosition},metadata:t},null,a),i(this,null,ke,{kind:"method",name:"findLocation",static:!1,private:!1,access:{has:e=>"findLocation"in e,get:e=>e.findLocation},metadata:t},null,a),i(this,null,xe,{kind:"getter",name:"routeInfo",static:!1,private:!1,access:{has:e=>"routeInfo"in e,get:e=>e.routeInfo},metadata:t},null,a),i(this,null,Se,{kind:"method",name:"updateRoute",static:!1,private:!1,access:{has:e=>"updateRoute"in e,get:e=>e.updateRoute},metadata:t},null,a),i(this,null,Te,{kind:"method",name:"updateRouteDistance",static:!1,private:!1,access:{has:e=>"updateRouteDistance"in e,get:e=>e.updateRouteDistance},metadata:t},null,a),i(this,null,Le,{kind:"method",name:"updateRoutePoints",static:!1,private:!1,access:{has:e=>"updateRoutePoints"in e,get:e=>e.updateRoutePoints},metadata:t},null,a),i(this,null,Ee,{kind:"method",name:"checkRoutes",static:!1,private:!1,access:{has:e=>"checkRoutes"in e,get:e=>e.checkRoutes},metadata:t},null,a),i(this,null,Ie,{kind:"method",name:"setGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"setGpsTrackingEnabled"in e,get:e=>e.setGpsTrackingEnabled},metadata:t},null,a),i(this,null,we,{kind:"getter",name:"gpsEnabled",static:!1,private:!1,access:{has:e=>"gpsEnabled"in e,get:e=>e.gpsEnabled},metadata:t},null,a),i(null,null,n,{kind:"field",name:"routeLines",static:!1,private:!1,access:{has:e=>"routeLines"in e,get:e=>e.routeLines,set:(e,s)=>{e.routeLines=s}},metadata:t},l,f),i(null,null,h,{kind:"field",name:"routeDistance",static:!1,private:!1,access:{has:e=>"routeDistance"in e,get:e=>e.routeDistance,set:(e,s)=>{e.routeDistance=s}},metadata:t},v,R),i(null,null,L,{kind:"field",name:"currentPosition",static:!1,private:!1,access:{has:e=>"currentPosition"in e,get:e=>e.currentPosition,set:(e,s)=>{e.currentPosition=s}},metadata:t},E,z),i(null,null,P,{kind:"field",name:"requestCompass",static:!1,private:!1,access:{has:e=>"requestCompass"in e,get:e=>e.requestCompass,set:(e,s)=>{e.requestCompass=s}},metadata:t},D,I),i(null,null,w,{kind:"field",name:"iconType",static:!1,private:!1,access:{has:e=>"iconType"in e,get:e=>e.iconType,set:(e,s)=>{e.iconType=s}},metadata:t},A,M),i(null,null,B,{kind:"field",name:"tempToBooth",static:!1,private:!1,access:{has:e=>"tempToBooth"in e,get:e=>e.tempToBooth,set:(e,s)=>{e.tempToBooth=s}},metadata:t},C,F),i(null,null,G,{kind:"field",name:"defaultFrom",static:!1,private:!1,access:{has:e=>"defaultFrom"in e,get:e=>e.defaultFrom,set:(e,s)=>{e.defaultFrom=s}},metadata:t},U,O),i(null,null,N,{kind:"field",name:"focusEnabled",static:!1,private:!1,access:{has:e=>"focusEnabled"in e,get:e=>e.focusEnabled,set:(e,s)=>{e.focusEnabled=s}},metadata:t},Z,q),i(null,null,$,{kind:"field",name:"prevZ",static:!1,private:!1,access:{has:e=>"prevZ"in e,get:e=>e.prevZ,set:(e,s)=>{e.prevZ=s}},metadata:t},V,j),i(null,null,W,{kind:"field",name:"markersData",static:!1,private:!1,access:{has:e=>"markersData"in e,get:e=>e.markersData,set:(e,s)=>{e.markersData=s}},metadata:t},K,X),i(null,null,Y,{kind:"field",name:"prevMarkers",static:!1,private:!1,access:{has:e=>"prevMarkers"in e,get:e=>e.prevMarkers,set:(e,s)=>{e.prevMarkers=s}},metadata:t},H,J),i(null,null,Q,{kind:"field",name:"showAccessible",static:!1,private:!1,access:{has:e=>"showAccessible"in e,get:e=>e.showAccessible,set:(e,s)=>{e.showAccessible=s}},metadata:t},ee,te),i(null,null,se,{kind:"field",name:"onlyAccessible",static:!1,private:!1,access:{has:e=>"onlyAccessible"in e,get:e=>e.onlyAccessible,set:(e,s)=>{e.onlyAccessible=s}},metadata:t},ae,ie),i(null,null,re,{kind:"field",name:"currentRouteLayer",static:!1,private:!1,access:{has:e=>"currentRouteLayer"in e,get:e=>e.currentRouteLayer,set:(e,s)=>{e.currentRouteLayer=s}},metadata:t},ne,oe),i(null,null,be,{kind:"field",name:"routeUnits",static:!1,private:!1,access:{has:e=>"routeUnits"in e,get:e=>e.routeUnits,set:(e,s)=>{e.routeUnits=s}},metadata:t},ve,Re),i(null,null,ze,{kind:"field",name:"isGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"isGpsTrackingEnabled"in e,get:e=>e.isGpsTrackingEnabled,set:(e,s)=>{e.isGpsTrackingEnabled=s}},metadata:t},Pe,De),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=r(this,a);cpTimeout;routeLines=r(this,l,[]);routeDistance=(r(this,f),r(this,v,null));currentPosition=(r(this,R),r(this,E,null));requestCompass=(r(this,z),r(this,D,!1));iconType=(r(this,I),r(this,A,0));tempToBooth=(r(this,M),r(this,C,null));defaultFrom=(r(this,F),r(this,U,null));focusEnabled=(r(this,O),r(this,Z,!0));prevZ=(r(this,q),r(this,V,null));markersData=(r(this,j),r(this,K,{icons:[],markers:[]}));prevMarkers=(r(this,X),r(this,H,[]));showAccessible=(r(this,J),r(this,ee,!!Ge.getLines().find(t=>t.unaccessible)));onlyAccessible=(r(this,te),r(this,ae,!1));currentRouteLayer=(r(this,ie),r(this,ne,null));constructor(t){r(this,De),this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!this.defaultFrom||!!this.currentPosition}selectRoute(t,e=!0){e&&(p.list={type:"search",text:"",focused:!1}),!t?.from&&t?.to&&this.currentPosition&&(t.from=this.nearestBooth),t?.from&&t?.to&&t.from===t.to&&(t=null);let s=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from?.visible&&s.push(t.from),t?.to?.visible&&(this.tempToBooth=null,s.push(t.to)),!t&&o.fp.onDirection&&o.fp.onDirection(null),setTimeout(()=>{this.rootStore.moveToList(s),p.details=t,t&&(!t.from||!t.to)&&o.showOverlay(),t?.to&&t?.from?.layer&&this.rootStore.layerStore.updateVisibility(t.from.layer,!0),!this.currentRouteLayer&&t?.from?.layer&&(this.currentRouteLayer=t?.from?.layer),e&&t?.from&&t?.to&&Xe(Ke.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)},200)}setStartPoint(t){const e=p.selectedRoute;if(e?.to&&!e?.from&&t){const s=new Route(t,e.to,e.waypoints);this.selectRoute(s)}}get pathLayers(){return o.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,s)=>s.indexOf(t)===e).reverse().map((t,e)=>({id:e+1,layer:o.layerStore.findLayer(t)}))}get nearestBooth(){return this.getNearestBooth(this.currentPosition)}getNearestBooth(t){if(!t)return null;let e=this.rootStore.layerStore.findLayer(t.z);const s=t.lat&&t.lng?Be(t,T.properties.config):t;return this.rootStore.boothStore.booths.filter(c=>x.mode===et.Default||!e?c.visible&&c.rect:c.rect&&(typeof t.z!="number"&&!t.z&&c.visible||e.name===c.layer?.name)).sort((c,u)=>Me(s,{x:c.rect.cx,y:c.rect.cy})-Me(s,{x:u.rect.cx,y:u.rect.cy}))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(ot),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const s=this.markersData.markers.find(u=>u.id===t);this.markersData.markers.forEach(u=>u.active=!1),s&&(s.active=!0);let c=o.layerStore.findLayer(s?.z);if(e&&s){const u=o.rendererService.renderer;return c&&!c?.visible&&x.updateVisibility(c,!0),u?u.controls.panTo(s.x,s.y):(qe.warn("Renderer is not initialized. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(t=>t.active)}get layers(){var t=[];return o.routeStore.routeLines?.map(e=>e.p0.layer).reverse().forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>o.layerStore.layers.find(s=>s.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,p.list.type==="route-planner"&&(p.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(this.defaultFrom||t,e))}selectCurrentPosition(t,e=!0,s){clearTimeout(this.cpTimeout),t&&(t.x=g(t.x),t.y=g(t.y),t.lat=g(t.lat),t.lng=g(t.lng),st()||(t.z=null)),e=!(e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route))&&(this.focusEnabled||this.prevZ!=t?.z),this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=s?1:0;const u=t?lt(t):null;if(!u){this.currentPosition=null;return}const _=o.layerStore.findLayer(t.z),b=new CurrentPosition(u.x,u.y,_?.name||this.currentRouteLayer?.name,Ye(u),t.lat,t.lng),S=p.selectedRoute;let Ae=!this.routeLines?.length;if(_&&this.routeLines?.length&&(Ae=!!this.routeLines.find(y=>y.p0.layer===_.name||y.p1.layer===_.name)),e&&Ae){const y=o.rendererService.renderer;if(_&&!_?.visible&&x.updateVisibility(_,!0),!y){qe.warn("Renderer is not initialized. Cannot pan to current position.");return}y.controls.panTo(b.x,b.y)}const $e=!(rt.EXPO==="cloudnext26")&&ct(b,this.routeLines)&&!!it(b,je.booths,[S?.to]);if(S&&$e){const y=o.routeStore.getNearestBooth(b);o.routeStore.selectRoute(new Route(y,S?.to),!1)}this.currentPosition=b,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(this.canFindLocation){if(o.mapboxStore.showMapbox){p.moveToLocation=!0;return}if(o.routeStore.currentPosition){const t=o.routeStore.currentPosition,e=We.fromCxcywh(t.x,t.y,100,100);if(!e.intersects(Je))return;localStorage.getItem(tt)==="false"&&(o.routeStore.requestCompass=!0),p.moveToRect=e;const c=o.layerStore.findLayer(o.routeStore.currentPosition?.z);c&&x.updateVisibility(c,!0)}else o.selectBooth(o.routeStore.defaultFrom)}}routeUnits=(r(this,oe),r(this,ve,Ne));get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:Oe(t,Ue(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=He(),s=(e.getAttribute("units")||Ne).toLowerCase?.().trim(),c=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(c?1:10)),this.routeUnits=s,this.updateRoutePoints()}updateRoutePoints(){const t=p.selectedRoute,e=this.routeDistance,s=this.routeUnits;o.fp.onDirection&&setTimeout(()=>{o.fp.onDirection({from:t?.from?{id:t.from.id,name:t.from.name,externalId:t.from.externalId,layer:{name:t.from?.layer?.name,description:t.from?.layer?.description}}:null,to:t?.to?{id:t.to.id,name:t.to.name,externalId:t.to.externalId,layer:{name:t.to.layer?.name,description:t.to.layer?.description}}:null,lines:this.routeLines,distance:`${e}${s}`,units:s,time:Oe(e,Ue(s))})},200)}checkRoutes(){let t=o.boothStore.booths;console.info(`Route check started ${t.length}.... `);for(let e=0;e<t.length;e++){const s=t[e];for(let c=e+1;c<t.length;c++){const u=t[c];Qe(Ge,Fe(s),Fe(u)).length||console.warn(`No route found from ${s.name} to ${u.name}`)}}console.info("Route check done....")}isGpsTrackingEnabled=(r(this,Re),r(this,Pe,!0));setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return Ze.autoTrackingGps&&this.isGpsTrackingEnabled&&!Ze.enableIPS}}})();export default nt;function ot(a){return{...a,x:g(a.x),y:g(a.y),lat:g(a.lat),lng:g(a.lng)}}function lt(a){let n=null,l=null;return T&&(n=T.properties.config),n&&a.x>=n.p0.x&&a.x<=n.p2.x&&a.y>=n.p0.y&&a.y<=n.p2.y?l={...a}:n&&Ce(a.lat)&&Ce(a.lng)?l=Be(a,n):n||(l=a),l||null}export function findBooth(a){return o.boothStore.findBooth(a)||o.exhibitorStore.findExhibitor(a)?.booths[0]}export function findEntityByExternalId(a){const n=o.boothStore.boothByExternalId.get(a);if(n)return{type:"booth",entity:n};const l=o.exhibitorStore.exhibitorByExternalId.get(a);if(l)return{type:"exhibitor",entity:l}}export function separateExternalIds(a){const n=[],l=[];for(const f of a){const h=findEntityByExternalId(f);h&&(h.type==="booth"?n.push(f):l.push(f))}return{boothExternalIds:n,exhibitorExternalIds:l}}export function extractRoute(a,n,l){return new Route(findBooth(a)??o.routeStore.defaultFrom??null,findBooth(n),l?.map(f=>findBooth(f)))}export class Route{from;to;waypoints;constructor(n,l,f){this.from=n,this.to=l,this.waypoints=f,this.waypoints=f?.filter(h=>h&&h.id!==n?.id&&h.id!==l?.id)}}export class CurrentPosition extends Ve{x;y;z;angle;lat;lng;constructor(n,l,f,h,v,R){super(n,l),this.x=n,this.y=l,this.z=f,this.angle=h,this.lat=v,this.lng=R}}function ct(a,n,l=10){if(!a||!n?.length)return!1;const f={layer:a.z?String(a.z):void 0,x:a.x,y:a.y},h=at(f,n);return isFinite(h)&&h>l}
|
package/dist/esm/utils/gps.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getAngle as I,lineAngle as y,lineCenter as D,lineLength as h,rotatePoint as G,shiftPoint as L}from"simple-geometry";import x from"../tools/logger";import{fpGeo as R}from"../
|
|
1
|
+
import{getAngle as I,lineAngle as y,lineCenter as D,lineLength as h,rotatePoint as G,shiftPoint as L}from"simple-geometry";import x from"../tools/logger";import{fpGeo as R}from"../data/fpGeo";const B=6371e3,g=-180,S=180;let v=n=>n*Math.PI/180,d=n=>n*180/Math.PI;export function distance(n,l,t,s){const r=n*Math.PI/180,e=t*Math.PI/180,p=(t-n)*Math.PI/180,c=(s-l)*Math.PI/180,i=Math.sin(p/2)*Math.sin(p/2)+Math.cos(r)*Math.cos(e)*Math.sin(c/2)*Math.sin(c/2);return 6371e3*(2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i)))}export function bearing(n,l,t,s){const a=n*Math.PI/180,r=t*Math.PI/180,e=(s-l)*Math.PI/180,p=Math.sin(e)*Math.cos(r),c=Math.cos(a)*Math.sin(r)-Math.sin(a)*Math.cos(r)*Math.cos(e);return(Math.atan2(p,c)*180/Math.PI+360)%360}export function isValidPointCoords(n){return typeof n=="number"&&Number.isFinite(n)}export function convertGpsToLocal({lat:n,lng:l,angle:t},s){if(!(isValidPointCoords(n)&&isValidPointCoords(l)))return null;let{p0:a,p2:r}=s;const e=distance(a.lat,a.lng,r.lat,r.lng),p=bearing(a.lat,a.lng,r.lat,r.lng),c=h(a,r),i=y(a,r);let o=distance(a.lat,a.lng,n,l),u=bearing(a.lat,a.lng,n,l)-p;if(!isValidPointCoords(e)||e<=0)return x.warn("Invalid GPS config: zero or negative distance",{fullGpsDistance:e,p0:a,p2:r}),null;let m=o/e,P=G(u,L(a,c*m,i),a.x,a.y),b=h(P,D(s.p0,s.p2)),A=h(s.p0,s.p2);return b>5*A?(x.warn("Current position too far"),null):{...P,angle:t}}export function convertLocalToGps(n,l,t){var s=-I(t.p0,t.p2,{x:t.p0.x+1e4,y:t.p0.y}),a=-I(t.p0,{x:n,y:l},{x:t.p0.x+1e4,y:t.p0.y}),r=a-s,e=h(t.p2,t.p0),p=h(t.p0,{x:n,y:l}),c=p/e,i=distance(t.p0.lat,t.p0.lng,t.p2.lat,t.p2.lng),o=c*i,M=bearing(t.p0.lat,t.p0.lng,t.p2.lat,t.p2.lng),u=T(t.p0.lat,t.p0.lng,o,M+r);return u}function T(n,l,t,s){var a=t/B,r=v(s),e=v(n),p=v(l),c=Math.asin(Math.sin(e)*Math.cos(a)+Math.cos(e)*Math.sin(a)*Math.cos(r)),i=p+Math.atan2(Math.sin(r)*Math.sin(a)*Math.cos(e),Math.cos(a)-Math.sin(e)*Math.sin(c)),o=d(i);return(o<g||o>S)&&(i=(i+3*Math.PI)%(2*Math.PI)-Math.PI,o=d(i)),[o,d(c)]}export function calculateRelativeBearing(n){const l=R?.properties?.config?.bearing??0;return n?.angle===null?0:(((n.angle-l)%360+360)%360-90+360)%360}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expofp/floorplan",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/expofp/efp-app.git",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"!dist/stats.json"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@expofp/renderer": "3.1.
|
|
38
|
+
"@expofp/renderer": "3.1.4",
|
|
39
39
|
"@sentry/core": "^10.51.0",
|
|
40
40
|
"@sentry/react": "^10.51.0",
|
|
41
41
|
"bowser": "^2.7.0",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"twgl.js": "^4.14.0",
|
|
77
77
|
"uuid": "^9.0.1",
|
|
78
78
|
"zod": "4.3.5",
|
|
79
|
-
"@expofp/resolve": "3.1.
|
|
80
|
-
"@expofp/debug": "3.1.
|
|
79
|
+
"@expofp/resolve": "3.1.6",
|
|
80
|
+
"@expofp/debug": "3.1.6"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@babel/plugin-proposal-decorators": "^7.29.0",
|
|
File without changes
|
|
File without changes
|