@mapxus/mapxus-visual-jp 1.8.1 → 1.9.0
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/bitbucket-pipelines.yml +50 -0
- package/config/rollup.js +33 -0
- package/config/rollup.serve.config.js +3 -0
- package/debug/circlemarker.html +444 -0
- package/debug/create_tags.html +474 -0
- package/debug/distance.html +220 -0
- package/debug/index.html +92 -0
- package/debug/integration.html +1084 -0
- package/debug/leaflet.html +54 -0
- package/debug/markers.html +115 -0
- package/debug/multi_monitor_sync.html +377 -0
- package/debug/outdoor.html +1026 -0
- package/debug/rect_tags.html +147 -0
- package/debug/rotate.html +236 -0
- package/debug/sample.html +324 -0
- package/debug/sequence.html +75 -0
- package/debug/tags.html +218 -0
- package/package.json +34 -10
- package/rollup.config.js +39 -0
- package/server.js +35 -0
- package/spec/api/APIv3.spec.ts +86 -0
- package/spec/component/Component.spec.ts +68 -0
- package/spec/component/StatsComponent.spec.ts +33 -0
- package/spec/component/direction/DirectionComponent.spec.ts +163 -0
- package/spec/component/direction/DirectionDOMRenderer.spec.ts +233 -0
- package/spec/component/keyboard/KeyZoomHandler.spec.ts +236 -0
- package/spec/component/marker/Marker.spec.ts +104 -0
- package/spec/component/marker/MarkerComponent.spec.ts +88 -0
- package/spec/component/marker/MarkerScene.spec.ts +223 -0
- package/spec/component/marker/MarkerSet.spec.ts +453 -0
- package/spec/component/mouse/DoubleClickZoomHandler.spec.ts +211 -0
- package/spec/component/popup/Popup.spec.ts +479 -0
- package/spec/component/popup/PopupComponent.spec.ts +414 -0
- package/spec/component/tag/CreateHandlerBase.spec.ts +83 -0
- package/spec/component/tag/CreatePointHandler.spec.ts +190 -0
- package/spec/component/tag/OutlineRenderTag.spec.ts +91 -0
- package/spec/component/tag/PointGeometry.spec.ts +131 -0
- package/spec/component/tag/PolygonGeometry.spec.ts +497 -0
- package/spec/component/tag/RectGeometry.spec.ts +1157 -0
- package/spec/component/tag/TagComponent.spec.ts +513 -0
- package/spec/component/tag/TagScene.spec.ts +346 -0
- package/spec/component/tag/TagSet.spec.ts +241 -0
- package/spec/component/utils/HandlerBase.spec.ts +203 -0
- package/spec/geo/Camera.spec.ts +250 -0
- package/spec/geo/GeoCoords.spec.ts +364 -0
- package/spec/geo/Spatial.spec.ts +711 -0
- package/spec/geo/Transform.spec.ts +850 -0
- package/spec/geo/ViewportCoords.spec.ts +534 -0
- package/spec/graph/FilterCreator.spec.ts +892 -0
- package/spec/graph/Graph.spec.ts +2078 -0
- package/spec/graph/GraphCalculator.spec.ts +263 -0
- package/spec/graph/GraphService.spec.ts +663 -0
- package/spec/graph/Node.spec.ts +373 -0
- package/spec/graph/NodeCache.spec.ts +206 -0
- package/spec/graph/Sequence.spec.ts +37 -0
- package/spec/graph/edge/EdgeCalculator.Pano.spec.ts +963 -0
- package/spec/graph/edge/EdgeCalculator.Sequence.spec.ts +108 -0
- package/spec/graph/edge/EdgeCalculator.Similar.spec.ts +272 -0
- package/spec/graph/edge/EdgeCalculator.Step.spec.ts +383 -0
- package/spec/graph/edge/EdgeCalculator.Turn.spec.ts +278 -0
- package/spec/graph/edge/EdgeCalculator.spec.ts +747 -0
- package/spec/helper/ContainerMockCreator.spec.ts +33 -0
- package/spec/helper/DOMRendererMockCreator.spec.ts +22 -0
- package/spec/helper/EdgeCalculatorHelper.spec.ts +96 -0
- package/spec/helper/EventHelper.spec.ts +92 -0
- package/spec/helper/GLRendererMockCreator.spec.ts +23 -0
- package/spec/helper/GeoHelper.spec.ts +16 -0
- package/spec/helper/ImageLoadingServiceMockCreator.spec.ts +24 -0
- package/spec/helper/KeyboardServiceMockCreator.spec.ts +21 -0
- package/spec/helper/LoadingServiceMockCreator.spec.ts +21 -0
- package/spec/helper/MockCreator.spec.ts +18 -0
- package/spec/helper/MockCreatorBase.spec.ts +17 -0
- package/spec/helper/MouseServiceMockCreator.spec.ts +38 -0
- package/spec/helper/NavigatorMockCreator.spec.ts +28 -0
- package/spec/helper/NodeHelper.spec.ts +77 -0
- package/spec/helper/NodeMockCreator.spec.ts +19 -0
- package/spec/helper/RenderServiceMockCreator.spec.ts +25 -0
- package/spec/helper/SpriteServiceMockCreator.spec.ts +22 -0
- package/spec/helper/StateServiceMockCreator.spec.ts +33 -0
- package/spec/helper/TouchServiceMockCreator.spec.ts +29 -0
- package/spec/helper/TransformHelper.spec.ts +17 -0
- package/spec/render/DOMRenderer.spec.ts +112 -0
- package/spec/render/GLRenderer.spec.ts +453 -0
- package/spec/render/RenderCamera.spec.ts +535 -0
- package/spec/render/RenderService.spec.ts +531 -0
- package/spec/state/StateBase.spec.ts +369 -0
- package/spec/state/StateService.spec.ts +9 -0
- package/spec/state/TraversingState.spec.ts +262 -0
- package/spec/state/WaitingState.spec.ts +319 -0
- package/spec/tiles/TextureProvider.spec.ts +653 -0
- package/spec/utils/EventEmitter.spec.ts +71 -0
- package/spec/utils/Support.spec.ts +54 -0
- package/spec/viewer/CacheService.spec.ts +160 -0
- package/spec/viewer/ComponentController.spec.ts +310 -0
- package/spec/viewer/LoadingService.spec.ts +19 -0
- package/spec/viewer/MouseService.spec.ts +1344 -0
- package/spec/viewer/Navigator.spec.ts +970 -0
- package/spec/viewer/Observer.spec.ts +96 -0
- package/spec/viewer/SpriteService.spec.ts +224 -0
- package/src/API.ts +3 -0
- package/src/Component.ts +77 -0
- package/src/Edge.ts +6 -0
- package/src/Error.ts +3 -0
- package/src/FilterRender.ts +27 -0
- package/src/Geo.ts +7 -0
- package/src/Graph.ts +19 -0
- package/src/MapxusVisual.ts +66 -0
- package/src/Render.ts +7 -0
- package/src/State.ts +8 -0
- package/src/Support.ts +35 -0
- package/src/Tiles.ts +5 -0
- package/src/Utils.ts +6 -0
- package/src/Viewer.ts +16 -0
- package/src/api/API.ts +396 -0
- package/src/api/Auth.ts +76 -0
- package/src/api/AuthStore.ts +11 -0
- package/src/api/GraphQLCreator.ts +100 -0
- package/src/api/interfaces/IAuth.ts +7 -0
- package/src/api/interfaces/IBuildingBase.ts +7 -0
- package/src/api/interfaces/IBuildingInfo.ts +19 -0
- package/src/api/interfaces/ICoreNode.ts +28 -0
- package/src/api/interfaces/IFillNode.ts +96 -0
- package/src/api/interfaces/IFloorInfo.ts +10 -0
- package/src/api/interfaces/IFullNode.ts +10 -0
- package/src/api/interfaces/IGPano.ts +38 -0
- package/src/api/interfaces/IImageTagInfo.ts +14 -0
- package/src/api/interfaces/IKey.ts +13 -0
- package/src/api/interfaces/ILatLon.ts +19 -0
- package/src/api/interfaces/IOutdoor.ts +14 -0
- package/src/api/interfaces/IPathNode.ts +37 -0
- package/src/api/interfaces/IProject.ts +8 -0
- package/src/api/interfaces/IQueryBuilding.ts +37 -0
- package/src/api/interfaces/IResponse.ts +7 -0
- package/src/api/interfaces/ISequence.ts +16 -0
- package/src/api/interfaces/IUser.ts +13 -0
- package/src/api/interfaces/interfaces.ts +17 -0
- package/src/component/AttributionComponent.ts +48 -0
- package/src/component/BackgroundComponent.ts +39 -0
- package/src/component/BearingComponent.ts +282 -0
- package/src/component/CacheComponent.ts +295 -0
- package/src/component/Component.ts +130 -0
- package/src/component/ComponentService.ts +150 -0
- package/src/component/CoverComponent.ts +132 -0
- package/src/component/DebugComponent.ts +157 -0
- package/src/component/ImageComponent.ts +96 -0
- package/src/component/LoadingComponent.ts +85 -0
- package/src/component/NavigationComponent.ts +233 -0
- package/src/component/RouteComponent.ts +354 -0
- package/src/component/StatsComponent.ts +100 -0
- package/src/component/direction/DirectionComponent.ts +254 -0
- package/src/component/direction/DirectionDOMCalculator.ts +243 -0
- package/src/component/direction/DirectionDOMRenderer.ts +631 -0
- package/src/component/imageplane/ImagePlaneComponent.ts +497 -0
- package/src/component/imageplane/ImagePlaneFactory.ts +314 -0
- package/src/component/imageplane/ImagePlaneGLRenderer.ts +247 -0
- package/src/component/imageplane/ImagePlaneScene.ts +87 -0
- package/src/component/imageplane/ImagePlaneShaders.ts +16 -0
- package/src/component/imageplane/SliderComponent.ts +697 -0
- package/src/component/imageplane/interfaces/IBBoxShaderMaterial.ts +10 -0
- package/src/component/imageplane/interfaces/IShaderMaterial.ts +9 -0
- package/src/component/imageplane/interfaces/interfaces.ts +2 -0
- package/src/component/imageplane/shaders/equirectangular.fragment.glsl.ts +26 -0
- package/src/component/imageplane/shaders/equirectangular.vertex.glsl.ts +15 -0
- package/src/component/imageplane/shaders/perspective.fragment.glsl.ts +27 -0
- package/src/component/imageplane/shaders/perspective.vertex.glsl.ts +15 -0
- package/src/component/interfaces/ICacheConfiguration.ts +72 -0
- package/src/component/interfaces/IComponentConfiguration.ts +5 -0
- package/src/component/interfaces/ICoverConfiguration.ts +15 -0
- package/src/component/interfaces/IDirectionConfiguration.ts +63 -0
- package/src/component/interfaces/IImagePlaneConfiguration.ts +17 -0
- package/src/component/interfaces/IKeyboardConfiguration.ts +44 -0
- package/src/component/interfaces/IMarkerConfiguration.ts +31 -0
- package/src/component/interfaces/IMouseConfiguration.ts +52 -0
- package/src/component/interfaces/INavigationConfiguration.ts +35 -0
- package/src/component/interfaces/IRouteConfiguration.ts +20 -0
- package/src/component/interfaces/ISequenceConfiguration.ts +72 -0
- package/src/component/interfaces/IShader.ts +6 -0
- package/src/component/interfaces/ISliderConfiguration.ts +61 -0
- package/src/component/interfaces/ITagConfiguration.ts +40 -0
- package/src/component/interfaces/interfaces.ts +17 -0
- package/src/component/keyboard/KeySequenceNavigationHandler.ts +86 -0
- package/src/component/keyboard/KeySpatialNavigationHandler.ts +216 -0
- package/src/component/keyboard/KeyZoomHandler.ts +106 -0
- package/src/component/keyboard/KeyboardComponent.ts +125 -0
- package/src/component/marker/Marker.ts +5 -0
- package/src/component/marker/MarkerComponent.ts +856 -0
- package/src/component/marker/MarkerScene.ts +145 -0
- package/src/component/marker/MarkerSet.ts +142 -0
- package/src/component/marker/interfaces/IArrowMarkerOptions.ts +41 -0
- package/src/component/marker/interfaces/ICircleMarkerOptions.ts +30 -0
- package/src/component/marker/interfaces/IDotMarkerOptions.ts +18 -0
- package/src/component/marker/interfaces/IMarkerEvent.ts +28 -0
- package/src/component/marker/interfaces/ISimpleMarkerOptions.ts +54 -0
- package/src/component/marker/interfaces/interfaces.ts +5 -0
- package/src/component/marker/marker/ArrowMarker.ts +84 -0
- package/src/component/marker/marker/CircleMarker.ts +82 -0
- package/src/component/marker/marker/DotMarker.ts +68 -0
- package/src/component/marker/marker/ImageMarker.ts +45 -0
- package/src/component/marker/marker/Marker.ts +99 -0
- package/src/component/marker/marker/SimpleMarker.ts +187 -0
- package/src/component/mouse/BounceHandler.ts +148 -0
- package/src/component/mouse/DoubleClickZoomHandler.ts +106 -0
- package/src/component/mouse/DragPanHandler.ts +489 -0
- package/src/component/mouse/HandlerTypes.ts +13 -0
- package/src/component/mouse/MouseComponent.ts +170 -0
- package/src/component/mouse/ScrollZoomHandler.ts +137 -0
- package/src/component/mouse/TouchZoomHandler.ts +136 -0
- package/src/component/path/PathComponent.ts +75 -0
- package/src/component/path/PathEvent.ts +245 -0
- package/src/component/path/PathMarker.ts +42 -0
- package/src/component/path/PathRender.ts +163 -0
- package/src/component/popup/Popup.ts +2 -0
- package/src/component/popup/PopupComponent.ts +244 -0
- package/src/component/popup/interfaces/IPopupOffset.ts +37 -0
- package/src/component/popup/interfaces/IPopupOptions.ts +81 -0
- package/src/component/popup/popup/Popup.ts +594 -0
- package/src/component/popup/popup/PopupAlignment.ts +3 -0
- package/src/component/sequence/SequenceComponent.ts +500 -0
- package/src/component/sequence/SequenceDOMInteraction.ts +23 -0
- package/src/component/sequence/SequenceDOMRenderer.ts +179 -0
- package/src/component/tag/Tag.ts +9 -0
- package/src/component/tag/TagComponent.ts +787 -0
- package/src/component/tag/TagCreator.ts +138 -0
- package/src/component/tag/TagDOMRenderer.ts +35 -0
- package/src/component/tag/TagMode.ts +37 -0
- package/src/component/tag/TagOperation.ts +7 -0
- package/src/component/tag/TagScene.ts +216 -0
- package/src/component/tag/TagSet.ts +186 -0
- package/src/component/tag/error/GeometryTagError.ts +11 -0
- package/src/component/tag/geometry/Geometry.ts +62 -0
- package/src/component/tag/geometry/PointGeometry.ts +89 -0
- package/src/component/tag/geometry/PolygonGeometry.ts +349 -0
- package/src/component/tag/geometry/RectGeometry.ts +759 -0
- package/src/component/tag/geometry/VertexGeometry.ts +185 -0
- package/src/component/tag/handlers/CreateHandlerBase.ts +81 -0
- package/src/component/tag/handlers/CreatePointHandler.ts +35 -0
- package/src/component/tag/handlers/CreatePolygonHandler.ts +33 -0
- package/src/component/tag/handlers/CreateRectDragHandler.ts +199 -0
- package/src/component/tag/handlers/CreateRectHandler.ts +57 -0
- package/src/component/tag/handlers/CreateVertexHandler.ts +165 -0
- package/src/component/tag/handlers/EditVertexHandler.ts +275 -0
- package/src/component/tag/handlers/TagHandlerBase.ts +57 -0
- package/src/component/tag/interfaces/IInteraction.ts +14 -0
- package/src/component/tag/interfaces/IOutlineCreateTagOptions.ts +15 -0
- package/src/component/tag/interfaces/IOutlineTagOptions.ts +89 -0
- package/src/component/tag/interfaces/ISpotTagOptions.ts +37 -0
- package/src/component/tag/interfaces/interfaces.ts +4 -0
- package/src/component/tag/tag/OutlineCreateTag.ts +330 -0
- package/src/component/tag/tag/OutlineRenderTag.ts +569 -0
- package/src/component/tag/tag/OutlineTag.ts +380 -0
- package/src/component/tag/tag/RenderTag.ts +50 -0
- package/src/component/tag/tag/SpotRenderTag.ts +160 -0
- package/src/component/tag/tag/SpotTag.ts +170 -0
- package/src/component/tag/tag/Tag.ts +103 -0
- package/src/component/utils/HandlerBase.ts +71 -0
- package/src/error/ArgumentBeeviewError.ts +11 -0
- package/src/error/BeeviewError.ts +9 -0
- package/src/error/GraphBeeviewError.ts +11 -0
- package/src/geo/Camera.ts +149 -0
- package/src/geo/GeoCoords.ts +280 -0
- package/src/geo/GeoRBush.ts +25 -0
- package/src/geo/Spatial.ts +259 -0
- package/src/geo/Transform.ts +543 -0
- package/src/geo/ViewportCoords.ts +518 -0
- package/src/geo/interfaces/ILatLonAlt.ts +7 -0
- package/src/geo/interfaces/interfaces.ts +1 -0
- package/src/graph/FilterCreator.ts +106 -0
- package/src/graph/FilterExpression.ts +16 -0
- package/src/graph/Graph.ts +1516 -0
- package/src/graph/GraphCalculator.ts +197 -0
- package/src/graph/GraphService.ts +516 -0
- package/src/graph/ImageLoadingService.ts +44 -0
- package/src/graph/MeshReader.ts +19 -0
- package/src/graph/Node.ts +622 -0
- package/src/graph/NodeCache.ts +548 -0
- package/src/graph/Sequence.ts +117 -0
- package/src/graph/edge/EdgeCalculator.ts +919 -0
- package/src/graph/edge/EdgeCalculatorCoefficients.ts +43 -0
- package/src/graph/edge/EdgeCalculatorDirections.ts +80 -0
- package/src/graph/edge/EdgeCalculatorSettings.ts +61 -0
- package/src/graph/edge/EdgeDirection.ts +63 -0
- package/src/graph/edge/interfaces/IEdge.ts +26 -0
- package/src/graph/edge/interfaces/IEdgeData.ts +22 -0
- package/src/graph/edge/interfaces/IPano.ts +8 -0
- package/src/graph/edge/interfaces/IPotentialEdge.ts +106 -0
- package/src/graph/edge/interfaces/IStep.ts +7 -0
- package/src/graph/edge/interfaces/ITurn.ts +7 -0
- package/src/graph/edge/interfaces/interfaces.ts +6 -0
- package/src/graph/interfaces/IEdgeStatus.ts +25 -0
- package/src/graph/interfaces/IGraphConfiguration.ts +26 -0
- package/src/graph/interfaces/ILoadStatus.ts +18 -0
- package/src/graph/interfaces/ILoadStatusObject.ts +8 -0
- package/src/graph/interfaces/IMesh.ts +20 -0
- package/src/graph/interfaces/interfaces.ts +5 -0
- package/src/render/DOMRenderer.ts +288 -0
- package/src/render/GLRenderStage.ts +6 -0
- package/src/render/GLRenderer.ts +436 -0
- package/src/render/RenderCamera.ts +212 -0
- package/src/render/RenderMode.ts +34 -0
- package/src/render/RenderService.ts +264 -0
- package/src/render/interfaces/IGLRender.ts +10 -0
- package/src/render/interfaces/IGLRenderFunction.ts +10 -0
- package/src/render/interfaces/IGLRenderHash.ts +8 -0
- package/src/render/interfaces/ISize.ts +6 -0
- package/src/render/interfaces/IVNodeHash.ts +8 -0
- package/src/render/interfaces/interfaces.ts +5 -0
- package/src/state/FrameGenerator.ts +36 -0
- package/src/state/State.ts +6 -0
- package/src/state/StateContext.ts +180 -0
- package/src/state/StateService.ts +600 -0
- package/src/state/StateTransitionMatrix.ts +58 -0
- package/src/state/interfaces/ICurrentState.ts +21 -0
- package/src/state/interfaces/IFrame.ts +9 -0
- package/src/state/interfaces/IRotation.ts +6 -0
- package/src/state/interfaces/IState.ts +11 -0
- package/src/state/interfaces/IStateContext.ts +31 -0
- package/src/state/interfaces/interfaces.ts +5 -0
- package/src/state/states/StateBase.ts +425 -0
- package/src/state/states/TraversingState.ts +861 -0
- package/src/state/states/WaitingState.ts +109 -0
- package/src/tiles/ImageTileLoader.ts +121 -0
- package/src/tiles/ImageTileStore.ts +70 -0
- package/src/tiles/RegionOfInterestCalculator.ts +158 -0
- package/src/tiles/TextureProvider.ts +609 -0
- package/src/tiles/interfaces/IBoundingBox.ts +28 -0
- package/src/tiles/interfaces/IRegionOfInterest.ts +25 -0
- package/src/tiles/interfaces/interfaces.ts +2 -0
- package/src/utils/DOM.ts +28 -0
- package/src/utils/EventEmitter.ts +61 -0
- package/src/utils/Func.ts +3 -0
- package/src/utils/Settings.ts +39 -0
- package/src/utils/Support.ts +70 -0
- package/src/utils/Urls.ts +43 -0
- package/src/viewer/Alignment.ts +53 -0
- package/src/viewer/CacheService.ts +75 -0
- package/src/viewer/ComponentController.ts +237 -0
- package/src/viewer/Container.ts +100 -0
- package/src/viewer/EventNames.ts +192 -0
- package/src/viewer/ImageSize.ts +28 -0
- package/src/viewer/KeyboardService.ts +15 -0
- package/src/viewer/LoadingService.ts +66 -0
- package/src/viewer/MouseService.ts +541 -0
- package/src/viewer/Navigator.ts +362 -0
- package/src/viewer/Observer.ts +441 -0
- package/src/viewer/Projection.ts +162 -0
- package/src/viewer/SpriteService.ts +281 -0
- package/src/viewer/TouchService.ts +336 -0
- package/src/viewer/Viewer.ts +1132 -0
- package/src/viewer/interfaces/IComponentOptions.ts +176 -0
- package/src/viewer/interfaces/IMouseClaim.ts +6 -0
- package/src/viewer/interfaces/IMouseDeferPixels.ts +6 -0
- package/src/viewer/interfaces/IPinch.ts +81 -0
- package/src/viewer/interfaces/ISpriteAtlas.ts +12 -0
- package/src/viewer/interfaces/IUnprojection.ts +9 -0
- package/src/viewer/interfaces/IViewerMouseEvent.ts +56 -0
- package/src/viewer/interfaces/IViewerOptions.ts +88 -0
- package/src/viewer/interfaces/PointOfView.ts +19 -0
- package/src/viewer/interfaces/interfaces.ts +9 -0
- package/styles/AttributionComponent.css +26 -0
- package/styles/BackgroundComponent.css +21 -0
- package/styles/BearingComponent.css +48 -0
- package/styles/CoverComponent.css +169 -0
- package/styles/DebugComponent.css +28 -0
- package/styles/DirectionComponent.css +154 -0
- package/styles/LoadingComponent.css +14 -0
- package/styles/NavigationComponent.css +64 -0
- package/styles/NorthBg.png +0 -0
- package/styles/PopupComponent.css +188 -0
- package/styles/RouteComponent.css +21 -0
- package/styles/SequenceComponent.css +120 -0
- package/styles/SliderComponent.css +82 -0
- package/styles/TagComponent.css +105 -0
- package/styles/cover-logo.png +0 -0
- package/styles/mapillary-js.css +29 -0
- package/styles/pano-indicator.svg +3 -0
- package/styles/pano.svg +20 -0
- package/styles/pointer-wheat.svg +3 -0
- package/styles/pointer-white.svg +3 -0
- package/styles/spinner.svg +1 -0
- package/styles/stepper-left.svg +1 -0
- package/styles/stepper-play.svg +1 -0
- package/styles/stepper-right.svg +1 -0
- package/styles/stepper-stop.svg +1 -0
- package/styles/turn-around.svg +3 -0
- package/styles/turn.svg +3 -0
- package/tsconfig.json +28 -0
- package/tslint.json +81 -0
- package/types/graphql/index.d.ts +28 -0
- package/types/graphql/language/ast/index.d.ts +7 -0
- package/types/images/index.d.ts +7 -0
- package/types/pbf/index.d.ts +16 -0
- package/types/rbush/index.d.ts +28 -0
- package/version/beeview-0.1.0.css +2 -0
- package/version/beeview-0.1.0.js +1 -0
- package/version/beeview-0.1.1.css +2 -0
- package/version/beeview-0.1.1.js +1 -0
- package/version/beeview-0.1.2.css +2 -0
- package/version/beeview-0.1.2.js +1 -0
- package/version/beeview-0.2.0.css +2 -0
- package/version/beeview-0.2.0.js +1 -0
- package/version/beeview-0.2.1.css +2 -0
- package/version/beeview-0.2.1.js +1 -0
- package/version/beeview-0.3.0.css +2 -0
- package/version/beeview-0.3.0.js +1 -0
- package/version/beeview-0.4.0.css +2 -0
- package/version/beeview-0.4.0.js +1 -0
- package/version/beeview-0.4.1.css +2 -0
- package/version/beeview-0.4.1.js +1 -0
- package/version/mapxus-visual-1.0.0.css +2 -0
- package/version/mapxus-visual-1.0.0.js +1 -0
- package/version/mapxus-visual-1.1.0.css +2 -0
- package/version/mapxus-visual-1.1.0.js +1 -0
- package/version/mapxus-visual-1.1.1.css +2 -0
- package/version/mapxus-visual-1.1.1.js +1 -0
- package/version/mapxus-visual-1.1.2.css +2 -0
- package/version/mapxus-visual-1.1.2.js +1 -0
- package/version/mapxus-visual-1.2.0.css +2 -0
- package/version/mapxus-visual-1.2.0.js +1 -0
- package/version/mapxus-visual-1.3.0.css +2 -0
- package/version/mapxus-visual-1.3.0.js +1 -0
- package/LICENSE +0 -11
- package/README.md +0 -28
- package/index.css +0 -2
- package/index.d.ts +0 -163
- package/index.js +0 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Subject, Observable, ReplaySubject } from "rxjs";
|
|
2
|
+
import { ILoadStatus, Node } from "../Graph";
|
|
3
|
+
import { IPathNode } from "../api/interfaces/IPathNode";
|
|
4
|
+
import { multicast, refCount, scan } from "rxjs/operators";
|
|
5
|
+
|
|
6
|
+
export class ImageLoadingService {
|
|
7
|
+
private _loadnode$: Subject<Node> = new Subject<Node>();
|
|
8
|
+
private _loadpath$: Subject<IPathNode[]> = new Subject<IPathNode[]>();
|
|
9
|
+
private _loadpathOutdoor$: Subject<IPathNode[]> = new Subject<IPathNode[]>();
|
|
10
|
+
private _loadstatus$: Observable<{[key: string]: ILoadStatus}>;
|
|
11
|
+
|
|
12
|
+
constructor () {
|
|
13
|
+
this._loadstatus$ = this._loadnode$.pipe(
|
|
14
|
+
scan(
|
|
15
|
+
(nodes: {[key: string]: ILoadStatus}, node: Node): {[key: string]: ILoadStatus} => {
|
|
16
|
+
nodes[node.key] = node.loadStatus;
|
|
17
|
+
return nodes;
|
|
18
|
+
},
|
|
19
|
+
{}),
|
|
20
|
+
multicast(new ReplaySubject(1)),
|
|
21
|
+
refCount(),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
this._loadpath$.subscribe(() => { /*noop*/ });
|
|
25
|
+
this._loadpathOutdoor$.subscribe(() => { /*noop*/ });
|
|
26
|
+
this._loadstatus$.subscribe(() => { /*noop*/ });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public get loadpath$(): Subject<IPathNode[]> {
|
|
30
|
+
return this._loadpath$;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public get loadpathOutdoor$(): Subject<IPathNode[]> {
|
|
34
|
+
return this._loadpathOutdoor$;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public get loadnode$(): Subject<Node> {
|
|
38
|
+
return this._loadnode$;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public get loadstatus$(): Observable<{[key: string]: ILoadStatus}> {
|
|
42
|
+
return this._loadstatus$;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as Pbf from "pbf";
|
|
2
|
+
|
|
3
|
+
import {IMesh} from "../Graph";
|
|
4
|
+
|
|
5
|
+
export class MeshReader {
|
|
6
|
+
public static read(buffer: Buffer): IMesh {
|
|
7
|
+
let pbf: Pbf<IMesh> = new Pbf<IMesh>(buffer);
|
|
8
|
+
|
|
9
|
+
return pbf.readFields(MeshReader._readMeshField, { faces: [], vertices: [] });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
private static _readMeshField(tag: number, mesh: IMesh, pbf: Pbf<IMesh>): void {
|
|
13
|
+
if (tag === 1) {
|
|
14
|
+
mesh.vertices.push(pbf.readFloat());
|
|
15
|
+
} else if (tag === 2) {
|
|
16
|
+
mesh.faces.push(pbf.readVarint());
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { map } from "rxjs/operators";
|
|
3
|
+
import {
|
|
4
|
+
ICoreNode,
|
|
5
|
+
IFillNode,
|
|
6
|
+
IGPano,
|
|
7
|
+
ILatLon,
|
|
8
|
+
} from "../API";
|
|
9
|
+
import { IEdge } from "../Edge";
|
|
10
|
+
import {
|
|
11
|
+
IEdgeStatus,
|
|
12
|
+
IMesh,
|
|
13
|
+
ILoadStatus,
|
|
14
|
+
NodeCache,
|
|
15
|
+
} from "../Graph";
|
|
16
|
+
import { ImageSize } from "../Viewer";
|
|
17
|
+
import IImageTagInfo from "../api/interfaces/IImageTagInfo";
|
|
18
|
+
import { IFloorInfo } from "../api/interfaces/IFloorInfo";
|
|
19
|
+
import { IBuildingBase } from "../api/interfaces/IBuildingBase";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @class Node
|
|
23
|
+
*
|
|
24
|
+
* @classdesc Represents a node in the navigation graph.
|
|
25
|
+
*
|
|
26
|
+
* Explanation of position and bearing properties:
|
|
27
|
+
*
|
|
28
|
+
* When images are uploaded they will have GPS information in the EXIF, this is what
|
|
29
|
+
* is called `originalLatLon`(@link Node#originalLatLon).
|
|
30
|
+
*
|
|
31
|
+
* When Structure from Motions has been run for a node a `computedLatLon` that
|
|
32
|
+
* differs from the `originalLatLon` will be created. It is different because
|
|
33
|
+
* GPS positions are not very exact and SfM aligns the camera positions according
|
|
34
|
+
* to the 3D reconstruction (@link Node#computedLatLon).
|
|
35
|
+
*
|
|
36
|
+
* At last there exist a `latLon` property which evaluates to
|
|
37
|
+
* the `computedLatLon` from SfM if it exists but falls back
|
|
38
|
+
* to the `originalLatLon` from the EXIF GPS otherwise (@link Node#latlon).
|
|
39
|
+
*
|
|
40
|
+
* Everything that is done in in the Viewer is based on the SfM positions,
|
|
41
|
+
* i.e. `computedLatLon`. That is why the smooth transitions go in the right
|
|
42
|
+
* direction (nd not in strange directions because of bad GPS).
|
|
43
|
+
*
|
|
44
|
+
* E.g. when placing a marker in the Viewer it is relative to the SfM
|
|
45
|
+
* position i.e. the `computedLatLon`.
|
|
46
|
+
*
|
|
47
|
+
* The same concept as above also applies to the compass angle (or bearing) properties
|
|
48
|
+
* `originalCa`, `computedCa` and `ca`.
|
|
49
|
+
*/
|
|
50
|
+
export class Node {
|
|
51
|
+
private _cache: NodeCache;
|
|
52
|
+
private _core: ICoreNode;
|
|
53
|
+
private _fill: IFillNode;
|
|
54
|
+
/**
|
|
55
|
+
* Create a new node instance.
|
|
56
|
+
*
|
|
57
|
+
* @description Nodes are always created internally by the library.
|
|
58
|
+
* Nodes can not be added to the library through any API method.
|
|
59
|
+
*
|
|
60
|
+
* @param {ICoreNode} coreNode - Raw core node data.
|
|
61
|
+
*/
|
|
62
|
+
constructor(core: ICoreNode) {
|
|
63
|
+
this._cache = null;
|
|
64
|
+
this._core = core;
|
|
65
|
+
this._fill = null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Get assets cached.
|
|
70
|
+
*
|
|
71
|
+
* @description The assets that need to be cached for this property
|
|
72
|
+
* to report true are the following: fill properties, image and mesh.
|
|
73
|
+
* The library ensures that the current node will always have the
|
|
74
|
+
* assets cached.
|
|
75
|
+
*
|
|
76
|
+
* @returns {boolean} Value indicating whether all assets have been
|
|
77
|
+
* cached.
|
|
78
|
+
*/
|
|
79
|
+
public get assetsCached(): boolean {
|
|
80
|
+
return this._core != null &&
|
|
81
|
+
this._fill != null &&
|
|
82
|
+
this._cache != null &&
|
|
83
|
+
this._cache.image != null &&
|
|
84
|
+
this._cache.mesh != null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
get cache(): NodeCache {
|
|
88
|
+
return this._cache;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Get alt.
|
|
93
|
+
*
|
|
94
|
+
* @description If SfM has not been run the computed altitude is
|
|
95
|
+
* set to a default value of two meters.
|
|
96
|
+
*
|
|
97
|
+
* @returns {number} Altitude, in meters.
|
|
98
|
+
*/
|
|
99
|
+
public get alt(): number {
|
|
100
|
+
return this._fill.calt;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Get ca.
|
|
105
|
+
*
|
|
106
|
+
* @description If the SfM computed compass angle exists it will
|
|
107
|
+
* be returned, otherwise the original EXIF compass angle.
|
|
108
|
+
*
|
|
109
|
+
* @returns {number} Compass angle, measured in degrees.
|
|
110
|
+
*/
|
|
111
|
+
public get ca(): number {
|
|
112
|
+
return this._fill.cca != null ? this._fill.cca : this._fill.ca;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Get capturedAt.
|
|
117
|
+
*
|
|
118
|
+
* @returns {number} Timestamp when the image was captured.
|
|
119
|
+
*/
|
|
120
|
+
public get capturedAt(): number {
|
|
121
|
+
return this._fill.captured_at;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Get computedCA.
|
|
126
|
+
*
|
|
127
|
+
* @description Will not be set if SfM has not been run.
|
|
128
|
+
*
|
|
129
|
+
* @returns {number} SfM computed compass angle, measured in degrees.
|
|
130
|
+
*/
|
|
131
|
+
public get computedCA(): number {
|
|
132
|
+
return this._fill.cca;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Get computedLatLon.
|
|
137
|
+
*
|
|
138
|
+
* @description Will not be set if SfM has not been run.
|
|
139
|
+
*
|
|
140
|
+
* @returns {ILatLon} SfM computed latitude longitude in WGS84 datum,
|
|
141
|
+
* measured in degrees.
|
|
142
|
+
*/
|
|
143
|
+
public get computedLatLon(): ILatLon {
|
|
144
|
+
return this._core.cl;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Get focal.
|
|
149
|
+
*
|
|
150
|
+
* @description Will not be set if SfM has not been run.
|
|
151
|
+
*
|
|
152
|
+
* @returns {number} SfM computed focal length.
|
|
153
|
+
*/
|
|
154
|
+
public get focal(): number {
|
|
155
|
+
return this._fill.cfocal;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Get full.
|
|
160
|
+
*
|
|
161
|
+
* @description The library ensures that the current node will
|
|
162
|
+
* always be full.
|
|
163
|
+
*
|
|
164
|
+
* @returns {boolean} Value indicating whether the node has all
|
|
165
|
+
* properties filled.
|
|
166
|
+
*/
|
|
167
|
+
public get full(): boolean {
|
|
168
|
+
return this._fill != null;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Get fullPano.
|
|
173
|
+
*
|
|
174
|
+
* @returns {boolean} Value indicating whether the node is a complete
|
|
175
|
+
* 360 panorama.
|
|
176
|
+
*/
|
|
177
|
+
public get fullPano(): boolean {
|
|
178
|
+
return this._fill.gpano != null &&
|
|
179
|
+
this._fill.gpano.CroppedAreaLeftPixels === 0 &&
|
|
180
|
+
this._fill.gpano.CroppedAreaTopPixels === 0 &&
|
|
181
|
+
this._fill.gpano.CroppedAreaImageWidthPixels === this._fill.gpano.FullPanoWidthPixels &&
|
|
182
|
+
this._fill.gpano.CroppedAreaImageHeightPixels === this._fill.gpano.FullPanoHeightPixels;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Get gpano.
|
|
187
|
+
*
|
|
188
|
+
* @description Will not be set for non panoramic images.
|
|
189
|
+
*
|
|
190
|
+
* @returns {IGPano} Panorama information for panorama images.
|
|
191
|
+
*/
|
|
192
|
+
public get gpano(): IGPano {
|
|
193
|
+
return this._fill.gpano;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Get height.
|
|
198
|
+
*
|
|
199
|
+
* @returns {number} Height of original image, not adjusted
|
|
200
|
+
* for orientation.
|
|
201
|
+
*/
|
|
202
|
+
public get height(): number {
|
|
203
|
+
return this._fill.height;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Get image.
|
|
208
|
+
*
|
|
209
|
+
* @description The image will always be set on the current node.
|
|
210
|
+
*
|
|
211
|
+
* @returns {HTMLImageElement} Cached image element of the node.
|
|
212
|
+
*/
|
|
213
|
+
public get image(): HTMLImageElement {
|
|
214
|
+
return this._cache.image;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Get key.
|
|
219
|
+
*
|
|
220
|
+
* @returns {string} Unique key of the node.
|
|
221
|
+
*/
|
|
222
|
+
public get key(): string {
|
|
223
|
+
return this._core.key;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Get latLon.
|
|
228
|
+
*
|
|
229
|
+
* @description If the SfM computed latitude longitude exist
|
|
230
|
+
* it will be returned, otherwise the original EXIF latitude
|
|
231
|
+
* longitude.
|
|
232
|
+
*
|
|
233
|
+
* @returns {ILatLon} Latitude longitude in WGS84 datum,
|
|
234
|
+
* measured in degrees.
|
|
235
|
+
*/
|
|
236
|
+
public get latLon(): ILatLon {
|
|
237
|
+
return this._core.l != null ? this._core.l : this._core.cl;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Get loadStatus.
|
|
242
|
+
*
|
|
243
|
+
* @returns {ILoadStatus} Value indicating the load status
|
|
244
|
+
* of the mesh and image.
|
|
245
|
+
*/
|
|
246
|
+
public get loadStatus(): ILoadStatus {
|
|
247
|
+
return this._cache.loadStatus;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Get merged.
|
|
252
|
+
*
|
|
253
|
+
* @returns {boolean} Value indicating whether SfM has been
|
|
254
|
+
* run on the node and the node has been merged into a
|
|
255
|
+
* connected component.
|
|
256
|
+
*/
|
|
257
|
+
public get merged(): boolean {
|
|
258
|
+
return this._fill != null &&
|
|
259
|
+
this._fill.merge_version != null &&
|
|
260
|
+
this._fill.merge_version > 0;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Get mergeCC.
|
|
265
|
+
*
|
|
266
|
+
* @description Will not be set if SfM has not yet been run on
|
|
267
|
+
* node.
|
|
268
|
+
*
|
|
269
|
+
* @returns {number} SfM connected component key to which
|
|
270
|
+
* image belongs.
|
|
271
|
+
*/
|
|
272
|
+
public get mergeCC(): number {
|
|
273
|
+
return this._fill.merge_cc;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Get mergeVersion.
|
|
278
|
+
*
|
|
279
|
+
* @returns {number} Version for which SfM was run and image was merged.
|
|
280
|
+
*/
|
|
281
|
+
public get mergeVersion(): number {
|
|
282
|
+
return this._fill.merge_version;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Get mesh.
|
|
287
|
+
*
|
|
288
|
+
* @description The mesh will always be set on the current node.
|
|
289
|
+
*
|
|
290
|
+
* @returns {IMesh} SfM triangulated mesh of reconstructed
|
|
291
|
+
* atomic 3D points.
|
|
292
|
+
*/
|
|
293
|
+
public get mesh(): IMesh {
|
|
294
|
+
return this._cache.mesh;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Get orientation.
|
|
299
|
+
*
|
|
300
|
+
* @returns {number} EXIF orientation of original image.
|
|
301
|
+
*/
|
|
302
|
+
public get orientation(): number {
|
|
303
|
+
return this._fill.orientation;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Get originalCA.
|
|
308
|
+
*
|
|
309
|
+
* @returns {number} Original EXIF compass angle, measured in
|
|
310
|
+
* degrees.
|
|
311
|
+
*/
|
|
312
|
+
public get originalCA(): number {
|
|
313
|
+
return this._fill.ca;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Get originalLatLon.
|
|
318
|
+
*
|
|
319
|
+
* @returns {ILatLon} Original EXIF latitude longitude in
|
|
320
|
+
* WGS84 datum, measured in degrees.
|
|
321
|
+
*/
|
|
322
|
+
public get originalLatLon(): ILatLon {
|
|
323
|
+
return this._core.l;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Get pano.
|
|
328
|
+
*
|
|
329
|
+
* @returns {boolean} Value indicating whether the node is a panorama.
|
|
330
|
+
* It could be a cropped or full panorama.
|
|
331
|
+
*/
|
|
332
|
+
public get pano(): boolean {
|
|
333
|
+
return this._fill.gpano != null &&
|
|
334
|
+
this._fill.gpano.FullPanoWidthPixels != null;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Get projectKey.
|
|
339
|
+
*
|
|
340
|
+
* @returns {string} Unique key of the project to which
|
|
341
|
+
* the node belongs.
|
|
342
|
+
*/
|
|
343
|
+
public get projectKey(): string {
|
|
344
|
+
return this._fill.project != null ?
|
|
345
|
+
this._fill.project.key :
|
|
346
|
+
null;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Get rotation.
|
|
351
|
+
*
|
|
352
|
+
* @description Will not be set if SfM has not been run.
|
|
353
|
+
*
|
|
354
|
+
* @returns {number[]} Rotation vector in angle axis representation.
|
|
355
|
+
*/
|
|
356
|
+
public get rotation(): number[] {
|
|
357
|
+
return this._fill.c_rotation;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
public get translation(): number[] {
|
|
361
|
+
return this._fill.c_translation;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Get scale.
|
|
366
|
+
*
|
|
367
|
+
* @description Will not be set if SfM has not been run.
|
|
368
|
+
*
|
|
369
|
+
* @returns {number} Scale of atomic reconstruction.
|
|
370
|
+
*/
|
|
371
|
+
public get scale(): number {
|
|
372
|
+
return this._fill.atomic_scale;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Get sequenceKey.
|
|
377
|
+
*
|
|
378
|
+
* @returns {string} Unique key of the sequence to which
|
|
379
|
+
* the node belongs.
|
|
380
|
+
*/
|
|
381
|
+
public get sequenceKey(): string {
|
|
382
|
+
return this._core.sequence.key;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Get sequenceEdges.
|
|
387
|
+
*
|
|
388
|
+
* @returns {IEdgeStatus} Value describing the status of the
|
|
389
|
+
* sequence edges.
|
|
390
|
+
*/
|
|
391
|
+
public get sequenceEdges(): IEdgeStatus {
|
|
392
|
+
return this._cache.sequenceEdges;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Get sequenceEdges$.
|
|
397
|
+
*
|
|
398
|
+
* @returns {Observable<IEdgeStatus>} Observable emitting
|
|
399
|
+
* values describing the status of the sequence edges.
|
|
400
|
+
*/
|
|
401
|
+
public get sequenceEdges$(): Observable<IEdgeStatus> {
|
|
402
|
+
return this._cache.sequenceEdges$;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Get spatialEdges.
|
|
407
|
+
*
|
|
408
|
+
* @returns {IEdgeStatus} Value describing the status of the
|
|
409
|
+
* spatial edges.
|
|
410
|
+
*/
|
|
411
|
+
public get spatialEdges(): IEdgeStatus {
|
|
412
|
+
return this._cache.spatialEdges;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Get spatialEdges$.
|
|
417
|
+
*
|
|
418
|
+
* @returns {Observable<IEdgeStatus>} Observable emitting
|
|
419
|
+
* values describing the status of the spatial edges.
|
|
420
|
+
*/
|
|
421
|
+
public get spatialEdges$(): Observable<IEdgeStatus> {
|
|
422
|
+
return this._cache.spatialEdges$;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Get userKey.
|
|
427
|
+
*
|
|
428
|
+
* @returns {string} Unique key of the user who uploaded
|
|
429
|
+
* the image.
|
|
430
|
+
*/
|
|
431
|
+
public get userKey(): string {
|
|
432
|
+
return this._fill.user.key;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Get username.
|
|
437
|
+
*
|
|
438
|
+
* @returns {string} Username of the user who uploaded
|
|
439
|
+
* the image.
|
|
440
|
+
*/
|
|
441
|
+
public get username(): string {
|
|
442
|
+
return this._fill.user.username;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
public get tags(): IImageTagInfo[] {
|
|
446
|
+
return this._fill.tags;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Get width.
|
|
451
|
+
*
|
|
452
|
+
* @returns {number} Width of original image, not
|
|
453
|
+
* adjusted for orientation.
|
|
454
|
+
*/
|
|
455
|
+
public get width(): number {
|
|
456
|
+
return this._fill.width;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Get date.
|
|
461
|
+
*
|
|
462
|
+
* @returns {number} Date of date generation
|
|
463
|
+
*/
|
|
464
|
+
public get date(): number {
|
|
465
|
+
return this._fill.date;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Get floor.
|
|
470
|
+
*
|
|
471
|
+
* @returns {IFloorInfo} object of floor
|
|
472
|
+
*/
|
|
473
|
+
public get floor(): IFloorInfo {
|
|
474
|
+
return this._fill.floor;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Get floor id.
|
|
479
|
+
*
|
|
480
|
+
* @returns {IFloorInfo} object of floor id
|
|
481
|
+
*/
|
|
482
|
+
public get floorId(): string {
|
|
483
|
+
return this._fill.floor.id;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Get building.
|
|
488
|
+
*
|
|
489
|
+
* @returns {IBuildingBase} object of building
|
|
490
|
+
*/
|
|
491
|
+
public get building(): IBuildingBase {
|
|
492
|
+
return this._fill.building;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Cache the image and mesh assets.
|
|
497
|
+
*
|
|
498
|
+
* @description The assets are always cached internally by the
|
|
499
|
+
* library prior to setting a node as the current node.
|
|
500
|
+
*
|
|
501
|
+
* @returns {Observable<Node>} Observable emitting this node whenever the
|
|
502
|
+
* load status has changed and when the mesh or image has been fully loaded.
|
|
503
|
+
*/
|
|
504
|
+
public cacheAssets$(): Observable<Node> {
|
|
505
|
+
return this._cache.cacheAssets$(this.key, this.pano, this.merged).pipe(
|
|
506
|
+
map(
|
|
507
|
+
(cache: NodeCache): Node => {
|
|
508
|
+
return this;
|
|
509
|
+
}),
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
public cacheImage$(imageSize: ImageSize): Observable<Node> {
|
|
514
|
+
return this._cache.cacheImage$(this.key, imageSize).pipe(
|
|
515
|
+
map(
|
|
516
|
+
(cache: NodeCache): Node => {
|
|
517
|
+
return this;
|
|
518
|
+
}),
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Cache the sequence edges.
|
|
524
|
+
*
|
|
525
|
+
* @description The sequence edges are cached asynchronously
|
|
526
|
+
* internally by the library.
|
|
527
|
+
*
|
|
528
|
+
* @param {IEdge[]} edges - Sequence edges to cache.
|
|
529
|
+
*/
|
|
530
|
+
public cacheSequenceEdges(edges: IEdge[]): void {
|
|
531
|
+
this._cache.cacheSequenceEdges(edges);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Cache the spatial edges.
|
|
536
|
+
*
|
|
537
|
+
* @description The spatial edges are cached asynchronously
|
|
538
|
+
* internally by the library.
|
|
539
|
+
*
|
|
540
|
+
* @param {IEdge[]} edges - Spatial edges to cache.
|
|
541
|
+
*/
|
|
542
|
+
public cacheSpatialEdges(edges: IEdge[]): void {
|
|
543
|
+
this._cache.cacheSpatialEdges(edges);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* Dispose the node.
|
|
548
|
+
*
|
|
549
|
+
* @description Disposes all cached assets.
|
|
550
|
+
*/
|
|
551
|
+
public dispose(): void {
|
|
552
|
+
if (this._cache != null) {
|
|
553
|
+
this._cache.dispose();
|
|
554
|
+
this._cache = null;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
this._core = null;
|
|
558
|
+
this._fill = null;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Initialize the node cache.
|
|
563
|
+
*
|
|
564
|
+
* @description The node cache is initialized internally by
|
|
565
|
+
* the library.
|
|
566
|
+
*
|
|
567
|
+
* @param {NodeCache} cache - The node cache to set as cache.
|
|
568
|
+
*/
|
|
569
|
+
public initializeCache(cache: NodeCache): void {
|
|
570
|
+
if (this._cache != null) {
|
|
571
|
+
throw new Error(`Node cache already initialized (${this.key}).`);
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
this._cache = cache;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Fill the node with all properties.
|
|
579
|
+
*
|
|
580
|
+
* @description The node is filled internally by
|
|
581
|
+
* the library.
|
|
582
|
+
*
|
|
583
|
+
* @param {IFillNode} fill - The fill node struct.
|
|
584
|
+
*/
|
|
585
|
+
public makeFull(fill: IFillNode): void {
|
|
586
|
+
if (fill == null) {
|
|
587
|
+
throw new Error("Fill can not be null.");
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
this._fill = fill;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Reset the sequence edges.
|
|
595
|
+
*/
|
|
596
|
+
public resetSequenceEdges(): void {
|
|
597
|
+
this._cache.resetSequenceEdges();
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* Reset the spatial edges.
|
|
602
|
+
*/
|
|
603
|
+
public resetSpatialEdges(): void {
|
|
604
|
+
this._cache.resetSpatialEdges();
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
/**
|
|
609
|
+
* Clears the image and mesh assets, aborts
|
|
610
|
+
* any outstanding requests and resets edges.
|
|
611
|
+
*/
|
|
612
|
+
public uncache(): void {
|
|
613
|
+
if (this._cache == null) {
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
this._cache.dispose();
|
|
618
|
+
this._cache = null;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
export default Node;
|