@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,513 @@
|
|
|
1
|
+
/// <reference path="../../../typings/index.d.ts" />
|
|
2
|
+
|
|
3
|
+
import {Observable} from "rxjs/Observable";
|
|
4
|
+
import {Subject} from "rxjs/Subject";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
PointGeometry,
|
|
8
|
+
SpotTag,
|
|
9
|
+
Tag,
|
|
10
|
+
TagComponent,
|
|
11
|
+
} from "../../../src/Component";
|
|
12
|
+
import {Transform} from "../../../src/Geo";
|
|
13
|
+
import {
|
|
14
|
+
Container,
|
|
15
|
+
Navigator,
|
|
16
|
+
} from "../../../src/Viewer";
|
|
17
|
+
|
|
18
|
+
import {ContainerMockCreator} from "../../helper/ContainerMockCreator.spec";
|
|
19
|
+
import {NavigatorMockCreator} from "../../helper/NavigatorMockCreator.spec";
|
|
20
|
+
import {TransformHelper} from "../../helper/TransformHelper.spec";
|
|
21
|
+
|
|
22
|
+
describe("TagComponent.ctor", () => {
|
|
23
|
+
it("should be defined", () => {
|
|
24
|
+
const tagComponent: TagComponent =
|
|
25
|
+
new TagComponent(
|
|
26
|
+
TagComponent.componentName,
|
|
27
|
+
new ContainerMockCreator().create(),
|
|
28
|
+
new NavigatorMockCreator().create());
|
|
29
|
+
|
|
30
|
+
expect(tagComponent).toBeDefined();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
describe("TagComponent.deactivate", () => {
|
|
35
|
+
it("should deactivate properly", () => {
|
|
36
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
37
|
+
(<jasmine.Spy>containerMock.mouseService.filtered$).and.returnValue(Observable.empty<MouseEvent>());
|
|
38
|
+
|
|
39
|
+
const tagComponent: TagComponent =
|
|
40
|
+
new TagComponent(
|
|
41
|
+
TagComponent.componentName,
|
|
42
|
+
containerMock,
|
|
43
|
+
new NavigatorMockCreator().create());
|
|
44
|
+
|
|
45
|
+
tagComponent.activate();
|
|
46
|
+
tagComponent.deactivate();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe("TagComponent.add", () => {
|
|
51
|
+
it("should add a single tag when deactivated", () => {
|
|
52
|
+
const tagComponent: TagComponent =
|
|
53
|
+
new TagComponent(
|
|
54
|
+
TagComponent.componentName,
|
|
55
|
+
new ContainerMockCreator().create(),
|
|
56
|
+
new NavigatorMockCreator().create());
|
|
57
|
+
|
|
58
|
+
const geometry: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
59
|
+
const tag: SpotTag = new SpotTag("id", geometry, {});
|
|
60
|
+
|
|
61
|
+
tagComponent.add([tag]);
|
|
62
|
+
|
|
63
|
+
const result: Tag = tagComponent.get(tag.id);
|
|
64
|
+
|
|
65
|
+
expect(result).toBeDefined();
|
|
66
|
+
expect(result.id).toBe(tag.id);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("should add multiple tags when deactivated", () => {
|
|
70
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
71
|
+
(<jasmine.Spy>containerMock.mouseService.filtered$).and.returnValue(Observable.empty<MouseEvent>());
|
|
72
|
+
|
|
73
|
+
const tagComponent: TagComponent =
|
|
74
|
+
new TagComponent(
|
|
75
|
+
TagComponent.componentName,
|
|
76
|
+
new ContainerMockCreator().create(),
|
|
77
|
+
new NavigatorMockCreator().create());
|
|
78
|
+
|
|
79
|
+
const geometry1: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
80
|
+
const tag1: SpotTag = new SpotTag("id1", geometry1, {});
|
|
81
|
+
|
|
82
|
+
const geometry2: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
83
|
+
const tag2: SpotTag = new SpotTag("id2", geometry2, {});
|
|
84
|
+
|
|
85
|
+
tagComponent.add([tag1, tag2]);
|
|
86
|
+
|
|
87
|
+
const result1: Tag = tagComponent.get(tag1.id);
|
|
88
|
+
|
|
89
|
+
expect(result1).toBeDefined();
|
|
90
|
+
expect(result1.id).toBe(tag1.id);
|
|
91
|
+
|
|
92
|
+
const result2: Tag = tagComponent.get(tag2.id);
|
|
93
|
+
|
|
94
|
+
expect(result2).toBeDefined();
|
|
95
|
+
expect(result2.id).toBe(tag2.id);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it("should add a single tag when activated", () => {
|
|
99
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
100
|
+
(<jasmine.Spy>containerMock.mouseService.filtered$).and.returnValue(Observable.empty<MouseEvent>());
|
|
101
|
+
const navigatorMock: Navigator = new NavigatorMockCreator().create();
|
|
102
|
+
|
|
103
|
+
const tagComponent: TagComponent =
|
|
104
|
+
new TagComponent(
|
|
105
|
+
TagComponent.componentName,
|
|
106
|
+
containerMock,
|
|
107
|
+
navigatorMock);
|
|
108
|
+
|
|
109
|
+
tagComponent.activate();
|
|
110
|
+
|
|
111
|
+
const geometry: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
112
|
+
const tag: SpotTag = new SpotTag("id", geometry, {});
|
|
113
|
+
|
|
114
|
+
tagComponent.add([tag]);
|
|
115
|
+
|
|
116
|
+
(<Subject<Transform>>navigatorMock.stateService.currentTransform$)
|
|
117
|
+
.next(new TransformHelper().createTransform());
|
|
118
|
+
|
|
119
|
+
const result: Tag = tagComponent.get(tag.id);
|
|
120
|
+
|
|
121
|
+
expect(result).toBeDefined();
|
|
122
|
+
expect(result.id).toBe(tag.id);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it("should add multiple tags when activated", () => {
|
|
126
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
127
|
+
(<jasmine.Spy>containerMock.mouseService.filtered$).and.returnValue(Observable.empty<MouseEvent>());
|
|
128
|
+
const navigatorMock: Navigator = new NavigatorMockCreator().create();
|
|
129
|
+
|
|
130
|
+
const tagComponent: TagComponent =
|
|
131
|
+
new TagComponent(
|
|
132
|
+
TagComponent.componentName,
|
|
133
|
+
containerMock,
|
|
134
|
+
navigatorMock);
|
|
135
|
+
|
|
136
|
+
tagComponent.activate();
|
|
137
|
+
|
|
138
|
+
const geometry1: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
139
|
+
const tag1: SpotTag = new SpotTag("id1", geometry1, {});
|
|
140
|
+
|
|
141
|
+
const geometry2: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
142
|
+
const tag2: SpotTag = new SpotTag("id2", geometry2, {});
|
|
143
|
+
|
|
144
|
+
tagComponent.add([tag1, tag2]);
|
|
145
|
+
|
|
146
|
+
(<Subject<Transform>>navigatorMock.stateService.currentTransform$)
|
|
147
|
+
.next(new TransformHelper().createTransform());
|
|
148
|
+
|
|
149
|
+
const result1: Tag = tagComponent.get(tag1.id);
|
|
150
|
+
|
|
151
|
+
expect(result1).toBeDefined();
|
|
152
|
+
expect(result1.id).toBe(tag1.id);
|
|
153
|
+
|
|
154
|
+
const result2: Tag = tagComponent.get(tag2.id);
|
|
155
|
+
|
|
156
|
+
expect(result2).toBeDefined();
|
|
157
|
+
expect(result2.id).toBe(tag2.id);
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
describe("TagComponent.getAll", () => {
|
|
162
|
+
it("should get a single tag when deactivated", () => {
|
|
163
|
+
const tagComponent: TagComponent =
|
|
164
|
+
new TagComponent(
|
|
165
|
+
TagComponent.componentName,
|
|
166
|
+
new ContainerMockCreator().create(),
|
|
167
|
+
new NavigatorMockCreator().create());
|
|
168
|
+
|
|
169
|
+
const geometry: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
170
|
+
const tag: SpotTag = new SpotTag("id", geometry, {});
|
|
171
|
+
|
|
172
|
+
tagComponent.add([tag]);
|
|
173
|
+
|
|
174
|
+
const result: Tag[] = tagComponent.getAll();
|
|
175
|
+
|
|
176
|
+
expect(result.length).toBe(1);
|
|
177
|
+
expect(result[0].id).toBe(tag.id);
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it("should get multiple tags when deactivated", () => {
|
|
181
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
182
|
+
(<jasmine.Spy>containerMock.mouseService.filtered$).and.returnValue(Observable.empty<MouseEvent>());
|
|
183
|
+
|
|
184
|
+
const tagComponent: TagComponent =
|
|
185
|
+
new TagComponent(
|
|
186
|
+
TagComponent.componentName,
|
|
187
|
+
new ContainerMockCreator().create(),
|
|
188
|
+
new NavigatorMockCreator().create());
|
|
189
|
+
|
|
190
|
+
const geometry1: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
191
|
+
const tag1: SpotTag = new SpotTag("id1", geometry1, {});
|
|
192
|
+
|
|
193
|
+
const geometry2: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
194
|
+
const tag2: SpotTag = new SpotTag("id2", geometry2, {});
|
|
195
|
+
|
|
196
|
+
tagComponent.add([tag1, tag2]);
|
|
197
|
+
|
|
198
|
+
const result: Tag[] = tagComponent.getAll();
|
|
199
|
+
|
|
200
|
+
expect(result.length).toBe(2);
|
|
201
|
+
|
|
202
|
+
const ids: string[] = result.map((tag: Tag): string => { return tag.id; });
|
|
203
|
+
expect(ids.indexOf(tag1.id)).not.toBe(-1);
|
|
204
|
+
expect(ids.indexOf(tag2.id)).not.toBe(-1);
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it("should get a single tag when activated", () => {
|
|
208
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
209
|
+
(<jasmine.Spy>containerMock.mouseService.filtered$).and.returnValue(Observable.empty<MouseEvent>());
|
|
210
|
+
const navigatorMock: Navigator = new NavigatorMockCreator().create();
|
|
211
|
+
|
|
212
|
+
const tagComponent: TagComponent =
|
|
213
|
+
new TagComponent(
|
|
214
|
+
TagComponent.componentName,
|
|
215
|
+
containerMock,
|
|
216
|
+
navigatorMock);
|
|
217
|
+
|
|
218
|
+
tagComponent.activate();
|
|
219
|
+
|
|
220
|
+
const geometry: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
221
|
+
const tag: SpotTag = new SpotTag("id", geometry, {});
|
|
222
|
+
|
|
223
|
+
tagComponent.add([tag]);
|
|
224
|
+
|
|
225
|
+
(<Subject<Transform>>navigatorMock.stateService.currentTransform$)
|
|
226
|
+
.next(new TransformHelper().createTransform());
|
|
227
|
+
|
|
228
|
+
const result: Tag[] = tagComponent.getAll();
|
|
229
|
+
|
|
230
|
+
expect(result.length).toBe(1);
|
|
231
|
+
expect(result[0].id).toBe(tag.id);
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
it("should add multiple tags when activated", () => {
|
|
235
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
236
|
+
(<jasmine.Spy>containerMock.mouseService.filtered$).and.returnValue(Observable.empty<MouseEvent>());
|
|
237
|
+
const navigatorMock: Navigator = new NavigatorMockCreator().create();
|
|
238
|
+
|
|
239
|
+
const tagComponent: TagComponent =
|
|
240
|
+
new TagComponent(
|
|
241
|
+
TagComponent.componentName,
|
|
242
|
+
containerMock,
|
|
243
|
+
navigatorMock);
|
|
244
|
+
|
|
245
|
+
tagComponent.activate();
|
|
246
|
+
|
|
247
|
+
const geometry1: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
248
|
+
const tag1: SpotTag = new SpotTag("id1", geometry1, {});
|
|
249
|
+
|
|
250
|
+
const geometry2: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
251
|
+
const tag2: SpotTag = new SpotTag("id2", geometry2, {});
|
|
252
|
+
|
|
253
|
+
tagComponent.add([tag1, tag2]);
|
|
254
|
+
|
|
255
|
+
(<Subject<Transform>>navigatorMock.stateService.currentTransform$)
|
|
256
|
+
.next(new TransformHelper().createTransform());
|
|
257
|
+
|
|
258
|
+
const result: Tag[] = tagComponent.getAll();
|
|
259
|
+
|
|
260
|
+
expect(result.length).toBe(2);
|
|
261
|
+
|
|
262
|
+
const ids: string[] = result.map((tag: Tag): string => { return tag.id; });
|
|
263
|
+
expect(ids.indexOf(tag1.id)).not.toBe(-1);
|
|
264
|
+
expect(ids.indexOf(tag2.id)).not.toBe(-1);
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
describe("TagComponent.remove", () => {
|
|
269
|
+
it("should remove a single tag when deactivated", () => {
|
|
270
|
+
const tagComponent: TagComponent =
|
|
271
|
+
new TagComponent(
|
|
272
|
+
TagComponent.componentName,
|
|
273
|
+
new ContainerMockCreator().create(),
|
|
274
|
+
new NavigatorMockCreator().create());
|
|
275
|
+
|
|
276
|
+
const geometry: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
277
|
+
const tag: SpotTag = new SpotTag("id", geometry, {});
|
|
278
|
+
|
|
279
|
+
tagComponent.add([tag]);
|
|
280
|
+
tagComponent.remove([tag.id]);
|
|
281
|
+
|
|
282
|
+
const result: Tag = tagComponent.get(tag.id);
|
|
283
|
+
|
|
284
|
+
expect(result).toBeUndefined();
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
it("should remove multiple tags when deactivated", () => {
|
|
288
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
289
|
+
(<jasmine.Spy>containerMock.mouseService.filtered$).and.returnValue(Observable.empty<MouseEvent>());
|
|
290
|
+
|
|
291
|
+
const tagComponent: TagComponent =
|
|
292
|
+
new TagComponent(
|
|
293
|
+
TagComponent.componentName,
|
|
294
|
+
new ContainerMockCreator().create(),
|
|
295
|
+
new NavigatorMockCreator().create());
|
|
296
|
+
|
|
297
|
+
const geometry1: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
298
|
+
const tag1: SpotTag = new SpotTag("id1", geometry1, {});
|
|
299
|
+
|
|
300
|
+
const geometry2: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
301
|
+
const tag2: SpotTag = new SpotTag("id2", geometry2, {});
|
|
302
|
+
|
|
303
|
+
tagComponent.add([tag1, tag2]);
|
|
304
|
+
tagComponent.remove([tag1.id, tag2.id]);
|
|
305
|
+
|
|
306
|
+
const result1: Tag = tagComponent.get(tag1.id);
|
|
307
|
+
expect(result1).toBeUndefined();
|
|
308
|
+
|
|
309
|
+
const result2: Tag = tagComponent.get(tag2.id);
|
|
310
|
+
expect(result2).toBeUndefined();
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
it("should remove one of multiple tags when deactivated", () => {
|
|
314
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
315
|
+
(<jasmine.Spy>containerMock.mouseService.filtered$).and.returnValue(Observable.empty<MouseEvent>());
|
|
316
|
+
|
|
317
|
+
const tagComponent: TagComponent =
|
|
318
|
+
new TagComponent(
|
|
319
|
+
TagComponent.componentName,
|
|
320
|
+
new ContainerMockCreator().create(),
|
|
321
|
+
new NavigatorMockCreator().create());
|
|
322
|
+
|
|
323
|
+
const geometry1: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
324
|
+
const tag1: SpotTag = new SpotTag("id1", geometry1, {});
|
|
325
|
+
|
|
326
|
+
const geometry2: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
327
|
+
const tag2: SpotTag = new SpotTag("id2", geometry2, {});
|
|
328
|
+
|
|
329
|
+
tagComponent.add([tag1, tag2]);
|
|
330
|
+
tagComponent.remove([tag1.id]);
|
|
331
|
+
|
|
332
|
+
const result1: Tag = tagComponent.get(tag1.id);
|
|
333
|
+
expect(result1).toBeUndefined();
|
|
334
|
+
|
|
335
|
+
const result2: Tag = tagComponent.get(tag2.id);
|
|
336
|
+
expect(result2).toBeDefined();
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
it("should remove a single tag when activated", () => {
|
|
340
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
341
|
+
(<jasmine.Spy>containerMock.mouseService.filtered$).and.returnValue(Observable.empty<MouseEvent>());
|
|
342
|
+
const navigatorMock: Navigator = new NavigatorMockCreator().create();
|
|
343
|
+
|
|
344
|
+
const tagComponent: TagComponent =
|
|
345
|
+
new TagComponent(
|
|
346
|
+
TagComponent.componentName,
|
|
347
|
+
containerMock,
|
|
348
|
+
navigatorMock);
|
|
349
|
+
|
|
350
|
+
tagComponent.activate();
|
|
351
|
+
|
|
352
|
+
const geometry: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
353
|
+
const tag: SpotTag = new SpotTag("id", geometry, {});
|
|
354
|
+
|
|
355
|
+
tagComponent.add([tag]);
|
|
356
|
+
|
|
357
|
+
(<Subject<Transform>>navigatorMock.stateService.currentTransform$)
|
|
358
|
+
.next(new TransformHelper().createTransform());
|
|
359
|
+
|
|
360
|
+
const result1: Tag = tagComponent.get(tag.id);
|
|
361
|
+
expect(result1).toBeDefined();
|
|
362
|
+
|
|
363
|
+
tagComponent.remove([tag.id]);
|
|
364
|
+
|
|
365
|
+
const result2: Tag = tagComponent.get(tag.id);
|
|
366
|
+
expect(result2).toBeUndefined();
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
it("should remove multiple tags when activated", () => {
|
|
370
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
371
|
+
(<jasmine.Spy>containerMock.mouseService.filtered$).and.returnValue(Observable.empty<MouseEvent>());
|
|
372
|
+
const navigatorMock: Navigator = new NavigatorMockCreator().create();
|
|
373
|
+
|
|
374
|
+
const tagComponent: TagComponent =
|
|
375
|
+
new TagComponent(
|
|
376
|
+
TagComponent.componentName,
|
|
377
|
+
containerMock,
|
|
378
|
+
navigatorMock);
|
|
379
|
+
|
|
380
|
+
tagComponent.activate();
|
|
381
|
+
|
|
382
|
+
const geometry1: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
383
|
+
const tag1: SpotTag = new SpotTag("id1", geometry1, {});
|
|
384
|
+
|
|
385
|
+
const geometry2: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
386
|
+
const tag2: SpotTag = new SpotTag("id2", geometry2, {});
|
|
387
|
+
|
|
388
|
+
tagComponent.add([tag1, tag2]);
|
|
389
|
+
|
|
390
|
+
(<Subject<Transform>>navigatorMock.stateService.currentTransform$)
|
|
391
|
+
.next(new TransformHelper().createTransform());
|
|
392
|
+
|
|
393
|
+
const result1: Tag = tagComponent.get(tag1.id);
|
|
394
|
+
expect(result1).toBeDefined();
|
|
395
|
+
|
|
396
|
+
const result2: Tag = tagComponent.get(tag2.id);
|
|
397
|
+
expect(result2).toBeDefined();
|
|
398
|
+
|
|
399
|
+
tagComponent.remove([tag1.id, tag2.id]);
|
|
400
|
+
|
|
401
|
+
const result3: Tag = tagComponent.get(tag1.id);
|
|
402
|
+
expect(result3).toBeUndefined();
|
|
403
|
+
|
|
404
|
+
const result4: Tag = tagComponent.get(tag2.id);
|
|
405
|
+
expect(result4).toBeUndefined();
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
it("should remove one of multiple tags when activated", () => {
|
|
409
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
410
|
+
(<jasmine.Spy>containerMock.mouseService.filtered$).and.returnValue(Observable.empty<MouseEvent>());
|
|
411
|
+
const navigatorMock: Navigator = new NavigatorMockCreator().create();
|
|
412
|
+
|
|
413
|
+
const tagComponent: TagComponent =
|
|
414
|
+
new TagComponent(
|
|
415
|
+
TagComponent.componentName,
|
|
416
|
+
containerMock,
|
|
417
|
+
navigatorMock);
|
|
418
|
+
|
|
419
|
+
tagComponent.activate();
|
|
420
|
+
|
|
421
|
+
const geometry1: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
422
|
+
const tag1: SpotTag = new SpotTag("id1", geometry1, {});
|
|
423
|
+
|
|
424
|
+
const geometry2: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
425
|
+
const tag2: SpotTag = new SpotTag("id2", geometry2, {});
|
|
426
|
+
|
|
427
|
+
tagComponent.add([tag1, tag2]);
|
|
428
|
+
|
|
429
|
+
(<Subject<Transform>>navigatorMock.stateService.currentTransform$)
|
|
430
|
+
.next(new TransformHelper().createTransform());
|
|
431
|
+
|
|
432
|
+
const result1: Tag = tagComponent.get(tag1.id);
|
|
433
|
+
expect(result1).toBeDefined();
|
|
434
|
+
|
|
435
|
+
const result2: Tag = tagComponent.get(tag2.id);
|
|
436
|
+
expect(result2).toBeDefined();
|
|
437
|
+
|
|
438
|
+
tagComponent.remove([tag1.id]);
|
|
439
|
+
|
|
440
|
+
const result3: Tag = tagComponent.get(tag1.id);
|
|
441
|
+
expect(result3).toBeUndefined();
|
|
442
|
+
|
|
443
|
+
const result4: Tag = tagComponent.get(tag2.id);
|
|
444
|
+
expect(result4).toBeDefined();
|
|
445
|
+
});
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
describe("TagComponent.removeAll", () => {
|
|
449
|
+
it("should remove multiple tags when deactivated", () => {
|
|
450
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
451
|
+
(<jasmine.Spy>containerMock.mouseService.filtered$).and.returnValue(Observable.empty<MouseEvent>());
|
|
452
|
+
|
|
453
|
+
const tagComponent: TagComponent =
|
|
454
|
+
new TagComponent(
|
|
455
|
+
TagComponent.componentName,
|
|
456
|
+
new ContainerMockCreator().create(),
|
|
457
|
+
new NavigatorMockCreator().create());
|
|
458
|
+
|
|
459
|
+
const geometry1: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
460
|
+
const tag1: SpotTag = new SpotTag("id1", geometry1, {});
|
|
461
|
+
|
|
462
|
+
const geometry2: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
463
|
+
const tag2: SpotTag = new SpotTag("id2", geometry2, {});
|
|
464
|
+
|
|
465
|
+
tagComponent.add([tag1, tag2]);
|
|
466
|
+
tagComponent.removeAll();
|
|
467
|
+
|
|
468
|
+
const result1: Tag = tagComponent.get(tag1.id);
|
|
469
|
+
expect(result1).toBeUndefined();
|
|
470
|
+
|
|
471
|
+
const result2: Tag = tagComponent.get(tag2.id);
|
|
472
|
+
expect(result2).toBeUndefined();
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
it("should remove multiple tags when activated", () => {
|
|
476
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
477
|
+
(<jasmine.Spy>containerMock.mouseService.filtered$).and.returnValue(Observable.empty<MouseEvent>());
|
|
478
|
+
const navigatorMock: Navigator = new NavigatorMockCreator().create();
|
|
479
|
+
|
|
480
|
+
const tagComponent: TagComponent =
|
|
481
|
+
new TagComponent(
|
|
482
|
+
TagComponent.componentName,
|
|
483
|
+
containerMock,
|
|
484
|
+
navigatorMock);
|
|
485
|
+
|
|
486
|
+
tagComponent.activate();
|
|
487
|
+
|
|
488
|
+
const geometry1: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
489
|
+
const tag1: SpotTag = new SpotTag("id1", geometry1, {});
|
|
490
|
+
|
|
491
|
+
const geometry2: PointGeometry = new PointGeometry([0.5, 0.5]);
|
|
492
|
+
const tag2: SpotTag = new SpotTag("id2", geometry2, {});
|
|
493
|
+
|
|
494
|
+
tagComponent.add([tag1, tag2]);
|
|
495
|
+
|
|
496
|
+
(<Subject<Transform>>navigatorMock.stateService.currentTransform$)
|
|
497
|
+
.next(new TransformHelper().createTransform());
|
|
498
|
+
|
|
499
|
+
const result1: Tag = tagComponent.get(tag1.id);
|
|
500
|
+
expect(result1).toBeDefined();
|
|
501
|
+
|
|
502
|
+
const result2: Tag = tagComponent.get(tag2.id);
|
|
503
|
+
expect(result2).toBeDefined();
|
|
504
|
+
|
|
505
|
+
tagComponent.removeAll();
|
|
506
|
+
|
|
507
|
+
const result3: Tag = tagComponent.get(tag1.id);
|
|
508
|
+
expect(result3).toBeUndefined();
|
|
509
|
+
|
|
510
|
+
const result4: Tag = tagComponent.get(tag2.id);
|
|
511
|
+
expect(result4).toBeUndefined();
|
|
512
|
+
});
|
|
513
|
+
});
|