@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,145 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import {ILatLon} from "../../API";
|
|
3
|
+
import {Marker} from "../../Component";
|
|
4
|
+
|
|
5
|
+
export class MarkerScene {
|
|
6
|
+
private _needsRender: boolean;
|
|
7
|
+
private _interactiveObjects: THREE.Object3D[];
|
|
8
|
+
private _markers: { [key: string]: Marker };
|
|
9
|
+
private _objectMarkers: { [id: string]: string };
|
|
10
|
+
private _raycaster: THREE.Raycaster;
|
|
11
|
+
private _scene: THREE.Scene;
|
|
12
|
+
|
|
13
|
+
constructor(scene?: THREE.Scene, raycaster?: THREE.Raycaster) {
|
|
14
|
+
this._needsRender = false;
|
|
15
|
+
this._interactiveObjects = [];
|
|
16
|
+
this._markers = {};
|
|
17
|
+
this._objectMarkers = {};
|
|
18
|
+
this._raycaster = !!raycaster ? raycaster : new THREE.Raycaster();
|
|
19
|
+
this._scene = !!scene ? scene : new THREE.Scene();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public get markers(): { [key: string]: Marker } {
|
|
23
|
+
return this._markers;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public get needsRender(): boolean {
|
|
27
|
+
return this._needsRender;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public add(marker: Marker, position: number[]): void {
|
|
31
|
+
if (marker.id in this._markers) {
|
|
32
|
+
this._dispose(marker.id);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
marker.createGeometry(position);
|
|
36
|
+
this._scene.add(marker.geometry);
|
|
37
|
+
this._markers[marker.id] = marker;
|
|
38
|
+
for (let interactiveObject of marker.getInteractiveObjects()) {
|
|
39
|
+
this._interactiveObjects.push(interactiveObject);
|
|
40
|
+
this._objectMarkers[interactiveObject.uuid] = marker.id;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
this._needsRender = true;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public clear(): void {
|
|
47
|
+
for (const id in this._markers) {
|
|
48
|
+
if (!this._markers.hasOwnProperty) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
this._dispose(id);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
this._needsRender = true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public get(id: string): Marker {
|
|
59
|
+
return this._markers[id];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public getAll(): Marker[] {
|
|
63
|
+
return Object
|
|
64
|
+
.keys(this._markers)
|
|
65
|
+
.map((id: string): Marker => { return this._markers[id]; });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public has(id: string): boolean {
|
|
69
|
+
return id in this._markers;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public intersectObjects([viewportX, viewportY]: number[], camera: THREE.Camera): string {
|
|
73
|
+
this._raycaster.setFromCamera(new THREE.Vector2(viewportX, viewportY), camera);
|
|
74
|
+
|
|
75
|
+
const intersects: THREE.Intersection[] = this._raycaster.intersectObjects(this._interactiveObjects);
|
|
76
|
+
for (const intersect of intersects) {
|
|
77
|
+
if (intersect.object.uuid in this._objectMarkers) {
|
|
78
|
+
return this._objectMarkers[intersect.object.uuid];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public lerpAltitude(id: string, alt: number, alpha: number): void {
|
|
86
|
+
if (!(id in this._markers)) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
this._markers[id].lerpAltitude(alt, alpha);
|
|
91
|
+
|
|
92
|
+
this._needsRender = true;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public remove(id: string): void {
|
|
96
|
+
if (!(id in this._markers)) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
this._dispose(id);
|
|
101
|
+
|
|
102
|
+
this._needsRender = true;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
public render(
|
|
106
|
+
perspectiveCamera: THREE.PerspectiveCamera,
|
|
107
|
+
renderer: THREE.WebGLRenderer): void {
|
|
108
|
+
|
|
109
|
+
renderer.render(this._scene, perspectiveCamera);
|
|
110
|
+
|
|
111
|
+
this._needsRender = false;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
public update(id: string, position: number[], latLon?: ILatLon): void {
|
|
115
|
+
if (!(id in this._markers)) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const marker: Marker = this._markers[id];
|
|
120
|
+
marker.updatePosition(position, latLon);
|
|
121
|
+
|
|
122
|
+
this._needsRender = true;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
private _dispose(id: string): void {
|
|
126
|
+
const marker: Marker = this._markers[id];
|
|
127
|
+
this._scene.remove(marker.geometry);
|
|
128
|
+
for (let interactiveObject of marker.getInteractiveObjects()) {
|
|
129
|
+
const index: number = this._interactiveObjects.indexOf(interactiveObject);
|
|
130
|
+
if (index !== -1) {
|
|
131
|
+
this._interactiveObjects.splice(index, 1);
|
|
132
|
+
} else {
|
|
133
|
+
console.warn(`Object does not exist (${interactiveObject.id}) for ${id}`);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
delete this._objectMarkers[interactiveObject.uuid];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
marker.disposeGeometry();
|
|
140
|
+
|
|
141
|
+
delete this._markers[id];
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export default MarkerScene;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Observable, Subject } from "rxjs";
|
|
2
|
+
import { ILatLon } from "../../API";
|
|
3
|
+
import { Marker } from "../../Component";
|
|
4
|
+
import { GeoRBush } from "../../Geo";
|
|
5
|
+
|
|
6
|
+
type MarkerIndexItem = {
|
|
7
|
+
lat: number;
|
|
8
|
+
lon: number;
|
|
9
|
+
marker: Marker;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export class MarkerSet {
|
|
13
|
+
private _hash: { [id: string]: MarkerIndexItem };
|
|
14
|
+
private _index: GeoRBush<MarkerIndexItem>;
|
|
15
|
+
|
|
16
|
+
private _indexChanged$: Subject<MarkerSet>;
|
|
17
|
+
private _updated$: Subject<Marker[]>;
|
|
18
|
+
|
|
19
|
+
constructor() {
|
|
20
|
+
this._hash = {};
|
|
21
|
+
this._index = new GeoRBush<MarkerIndexItem>(16);
|
|
22
|
+
|
|
23
|
+
this._indexChanged$ = new Subject<MarkerSet>();
|
|
24
|
+
this._updated$ = new Subject<Marker[]>();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public get changed$(): Observable<MarkerSet> {
|
|
28
|
+
return this._indexChanged$;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public get updated$(): Observable<Marker[]> {
|
|
32
|
+
return this._updated$;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public add(markers: Marker[]): void {
|
|
36
|
+
const updated: Marker[] = [];
|
|
37
|
+
const hash: { [id: string]: MarkerIndexItem } = this._hash;
|
|
38
|
+
const index: GeoRBush<MarkerIndexItem> = this._index;
|
|
39
|
+
|
|
40
|
+
for (const marker of markers) {
|
|
41
|
+
const id: string = marker.id;
|
|
42
|
+
|
|
43
|
+
if (id in hash) {
|
|
44
|
+
index.remove(hash[id]);
|
|
45
|
+
updated.push(marker);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const item: MarkerIndexItem = {
|
|
49
|
+
lat: marker.latLon.lat,
|
|
50
|
+
lon: marker.latLon.lon,
|
|
51
|
+
marker: marker,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
hash[id] = item;
|
|
55
|
+
index.insert(item);
|
|
56
|
+
}
|
|
57
|
+
if (updated.length > 0) {
|
|
58
|
+
this._updated$.next(updated);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (markers.length > updated.length) {
|
|
62
|
+
this._indexChanged$.next(this);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public has(id: string): boolean {
|
|
67
|
+
return id in this._hash;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public get(id: string): Marker {
|
|
71
|
+
return this.has(id) ? this._hash[id].marker : undefined;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public getAll(): Marker[] {
|
|
75
|
+
return this._index
|
|
76
|
+
.all()
|
|
77
|
+
.map(
|
|
78
|
+
(indexItem: MarkerIndexItem): Marker => {
|
|
79
|
+
return indexItem.marker;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public remove(ids: string[]): void {
|
|
84
|
+
const hash: { [id: string]: MarkerIndexItem } = this._hash;
|
|
85
|
+
const index: GeoRBush<MarkerIndexItem> = this._index;
|
|
86
|
+
|
|
87
|
+
let changed: boolean = false;
|
|
88
|
+
for (const id of ids) {
|
|
89
|
+
if (!(id in hash)) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const item: MarkerIndexItem = hash[id];
|
|
94
|
+
index.remove(item);
|
|
95
|
+
delete hash[id];
|
|
96
|
+
changed = true;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (changed) {
|
|
100
|
+
this._indexChanged$.next(this);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
public removeAll(): void {
|
|
105
|
+
this._hash = {};
|
|
106
|
+
this._index.clear();
|
|
107
|
+
|
|
108
|
+
this._indexChanged$.next(this);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
public search([sw, ne]: [ILatLon, ILatLon]): Marker[] {
|
|
112
|
+
return this._index
|
|
113
|
+
.search({ maxX: ne.lon, maxY: ne.lat, minX: sw.lon, minY: sw.lat })
|
|
114
|
+
.map(
|
|
115
|
+
(indexItem: MarkerIndexItem): Marker => {
|
|
116
|
+
return indexItem.marker;
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
public update(marker: Marker): void {
|
|
121
|
+
const hash: { [id: string]: MarkerIndexItem } = this._hash;
|
|
122
|
+
const index: GeoRBush<MarkerIndexItem> = this._index;
|
|
123
|
+
const id: string = marker.id;
|
|
124
|
+
|
|
125
|
+
if (!(id in hash)) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
index.remove(hash[id]);
|
|
130
|
+
|
|
131
|
+
const item: MarkerIndexItem = {
|
|
132
|
+
lat: marker.latLon.lat,
|
|
133
|
+
lon: marker.latLon.lon,
|
|
134
|
+
marker: marker,
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
hash[id] = item;
|
|
138
|
+
index.insert(item);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export default MarkerSet;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* @interface IArrowMarkerOptions
|
|
4
|
+
*
|
|
5
|
+
* Interface that represents the options for configuring a `ArrowMarker`.
|
|
6
|
+
*/
|
|
7
|
+
export interface IArrowMarkerOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Value indicating if the marker should be interactive or not.
|
|
10
|
+
*
|
|
11
|
+
* @description If the marker is configured to be interactive
|
|
12
|
+
* it will be draggable in the viewer and retrievable with the
|
|
13
|
+
* `getMarkerIdAt` method on the `MarkerComponent`.
|
|
14
|
+
*
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
interactive?: boolean;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The color of the marker.
|
|
21
|
+
*
|
|
22
|
+
* @default "#fff"
|
|
23
|
+
*/
|
|
24
|
+
color?: number | string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The opacity of the marker.
|
|
28
|
+
*
|
|
29
|
+
* @default 0.4
|
|
30
|
+
*/
|
|
31
|
+
opacity?: number;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The radius of the circle in meters.
|
|
35
|
+
*
|
|
36
|
+
* @default 1
|
|
37
|
+
*/
|
|
38
|
+
radius?: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default IArrowMarkerOptions;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* @interface ICircleMarkerOptions
|
|
4
|
+
*
|
|
5
|
+
* Interface that represents the options for configuring a `CircleMarker`.
|
|
6
|
+
*/
|
|
7
|
+
export interface ICircleMarkerOptions {
|
|
8
|
+
/**
|
|
9
|
+
* The color of the marker.
|
|
10
|
+
*
|
|
11
|
+
* @default "#fff"
|
|
12
|
+
*/
|
|
13
|
+
color?: number | string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The opacity of the marker.
|
|
17
|
+
*
|
|
18
|
+
* @default 0.4
|
|
19
|
+
*/
|
|
20
|
+
opacity?: number;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The radius of the circle in meters.
|
|
24
|
+
*
|
|
25
|
+
* @default 1
|
|
26
|
+
*/
|
|
27
|
+
radius?: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default ICircleMarkerOptions;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* @interface IDotMarkerOptions
|
|
4
|
+
*
|
|
5
|
+
* Interface that represents the options for configuring a `DotMarker`.
|
|
6
|
+
*/
|
|
7
|
+
export interface IDotMarkerOptions {
|
|
8
|
+
/**
|
|
9
|
+
* The position offset factor value.
|
|
10
|
+
*
|
|
11
|
+
* @default -0.1
|
|
12
|
+
*/
|
|
13
|
+
offsetFactor?: number;
|
|
14
|
+
|
|
15
|
+
outerColor?: number | string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default IDotMarkerOptions;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Marker,
|
|
3
|
+
MarkerComponent,
|
|
4
|
+
} from "../../../Component";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @interface IMarkerEvent
|
|
8
|
+
*
|
|
9
|
+
* Interface that represents a marker event occuring in the viewer target element.
|
|
10
|
+
*/
|
|
11
|
+
export interface IMarkerEvent {
|
|
12
|
+
/**
|
|
13
|
+
* The marker that was affected by the event.
|
|
14
|
+
*/
|
|
15
|
+
marker: Marker;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The marker component object that fired the event.
|
|
19
|
+
*/
|
|
20
|
+
target: MarkerComponent;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The event type.
|
|
24
|
+
*/
|
|
25
|
+
type: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default IMarkerEvent;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @interface ISimpleMarkerOptions
|
|
3
|
+
*
|
|
4
|
+
* Interface that represents the options for configuring a `SimpleMarker`.
|
|
5
|
+
*/
|
|
6
|
+
export interface ISimpleMarkerOptions {
|
|
7
|
+
/**
|
|
8
|
+
* The color of the ball inside the marker.
|
|
9
|
+
*
|
|
10
|
+
* @default "#f00"
|
|
11
|
+
*/
|
|
12
|
+
ballColor?: number | string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The opacity of the ball inside the marker.
|
|
16
|
+
*
|
|
17
|
+
* @default 0.8
|
|
18
|
+
*/
|
|
19
|
+
ballOpacity?: number;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The color of the ice creame shape.
|
|
23
|
+
*
|
|
24
|
+
* @default "#f00"
|
|
25
|
+
*/
|
|
26
|
+
color?: number | string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Value indicating if the marker should be interactive or not.
|
|
30
|
+
*
|
|
31
|
+
* @description If the marker is configured to be interactive
|
|
32
|
+
* it will be draggable in the viewer and retrievable with the
|
|
33
|
+
* `getMarkerIdAt` method on the `MarkerComponent`.
|
|
34
|
+
*
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
interactive?: boolean;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The opacity of the ice creame shape.
|
|
41
|
+
*
|
|
42
|
+
* @default 0.4
|
|
43
|
+
*/
|
|
44
|
+
opacity?: number;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The radius of the ice cream shape in meters.
|
|
48
|
+
*
|
|
49
|
+
* @default 1
|
|
50
|
+
*/
|
|
51
|
+
radius?: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default ISimpleMarkerOptions;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export {ICircleMarkerOptions} from "./ICircleMarkerOptions";
|
|
2
|
+
export {IDotMarkerOptions} from "./IDotMarkerOptions";
|
|
3
|
+
export {IMarkerEvent} from "./IMarkerEvent";
|
|
4
|
+
export {ISimpleMarkerOptions} from "./ISimpleMarkerOptions";
|
|
5
|
+
export {IArrowMarkerOptions} from "./IArrowMarkerOptions";
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
|
|
3
|
+
import { ILatLon } from "../../../API";
|
|
4
|
+
import { Marker } from "./Marker";
|
|
5
|
+
import type { IArrowMarkerOptions } from "../../marker/interfaces/IArrowMarkerOptions";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @class ArrowMarker
|
|
9
|
+
*
|
|
10
|
+
* @classdesc Non-interactive marker with a flat circle shape. The circle
|
|
11
|
+
* marker can not be configured to be interactive.
|
|
12
|
+
*
|
|
13
|
+
* Circle marker properties can not be updated after creation.
|
|
14
|
+
*
|
|
15
|
+
* To create and add one `ArrowMarker` with default configuration
|
|
16
|
+
* and one with configuration use
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```
|
|
20
|
+
* var defaultMarker = new Beeview.MarkerComponent.ArrowMarker(
|
|
21
|
+
* "id-1",
|
|
22
|
+
* { lat: 0, lon: 0, });
|
|
23
|
+
*
|
|
24
|
+
* var configuredMarker = new Beeview.MarkerComponent.ArrowMarker(
|
|
25
|
+
* "id-2",
|
|
26
|
+
* { lat: 0, lon: 0, },
|
|
27
|
+
* {
|
|
28
|
+
* color: "#0Ff",
|
|
29
|
+
* opacity: 0.3,
|
|
30
|
+
* radius: 0.7,
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* markerComponent.add([defaultMarker, configuredMarker]);
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export class ArrowMarker extends Marker {
|
|
37
|
+
private _color: number | string;
|
|
38
|
+
private _opacity: number;
|
|
39
|
+
private _radius: number;
|
|
40
|
+
private _interactive: boolean;
|
|
41
|
+
|
|
42
|
+
constructor(id: string, latLon: ILatLon, options?: IArrowMarkerOptions) {
|
|
43
|
+
super(id, latLon);
|
|
44
|
+
options = !!options ? options : {};
|
|
45
|
+
this._color = options.color != null ? options.color : 0xffffff;
|
|
46
|
+
this._opacity = options.opacity != null ? options.opacity : 0.4;
|
|
47
|
+
this._radius = options.radius != null ? options.radius : 1;
|
|
48
|
+
this._interactive =
|
|
49
|
+
options.interactive != null ? options.interactive : true;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
protected _createGeometry(position: number[]): void {
|
|
53
|
+
const circle: THREE.Mesh = new THREE.Mesh(
|
|
54
|
+
new THREE.CircleGeometry(this._radius, 100),
|
|
55
|
+
new THREE.MeshBasicMaterial({
|
|
56
|
+
color: this._color,
|
|
57
|
+
opacity: this._opacity,
|
|
58
|
+
transparent: true,
|
|
59
|
+
}),
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
circle.up.fromArray([0, 0, 1]);
|
|
63
|
+
circle.renderOrder = -1;
|
|
64
|
+
const group: THREE.Object3D = new THREE.Object3D();
|
|
65
|
+
group.add(circle);
|
|
66
|
+
|
|
67
|
+
group.position.fromArray(position);
|
|
68
|
+
|
|
69
|
+
this._geometry = group;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
protected _disposeGeometry(): void {
|
|
73
|
+
for (let mesh of <THREE.Mesh[]>this._geometry.children) {
|
|
74
|
+
mesh.geometry.dispose();
|
|
75
|
+
(mesh.material as THREE.Material).dispose();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
protected _getInteractiveObjects(): THREE.Object3D[] {
|
|
80
|
+
return this._interactive ? [this._geometry.children[0]] : [];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export default ArrowMarker;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
|
|
3
|
+
import { ILatLon } from "../../../API";
|
|
4
|
+
import { Marker } from "./Marker";
|
|
5
|
+
import type { ICircleMarkerOptions } from "../../marker/interfaces/ICircleMarkerOptions";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @class CircleMarker
|
|
9
|
+
*
|
|
10
|
+
* @classdesc Non-interactive marker with a flat circle shape. The circle
|
|
11
|
+
* marker can not be configured to be interactive.
|
|
12
|
+
*
|
|
13
|
+
* Circle marker properties can not be updated after creation.
|
|
14
|
+
*
|
|
15
|
+
* To create and add one `CircleMarker` with default configuration
|
|
16
|
+
* and one with configuration use
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```
|
|
20
|
+
* var defaultMarker = new Beeview.MarkerComponent.CircleMarker(
|
|
21
|
+
* "id-1",
|
|
22
|
+
* { lat: 0, lon: 0, });
|
|
23
|
+
*
|
|
24
|
+
* var configuredMarker = new Beeview.MarkerComponent.CircleMarker(
|
|
25
|
+
* "id-2",
|
|
26
|
+
* { lat: 0, lon: 0, },
|
|
27
|
+
* {
|
|
28
|
+
* color: "#0Ff",
|
|
29
|
+
* opacity: 0.3,
|
|
30
|
+
* radius: 0.7,
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* markerComponent.add([defaultMarker, configuredMarker]);
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export class CircleMarker extends Marker {
|
|
37
|
+
private _color: number | string;
|
|
38
|
+
private _opacity: number;
|
|
39
|
+
private _radius: number;
|
|
40
|
+
|
|
41
|
+
constructor(id: string, latLon: ILatLon, options?: ICircleMarkerOptions) {
|
|
42
|
+
super(id, latLon);
|
|
43
|
+
|
|
44
|
+
options = !!options ? options : {};
|
|
45
|
+
this._color = options.color != null ? options.color : 0xffffff;
|
|
46
|
+
this._opacity = options.opacity != null ? options.opacity : 0.4;
|
|
47
|
+
this._radius = options.radius != null ? options.radius : 0.4;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
protected _createGeometry(position: number[]): void {
|
|
51
|
+
const circle: THREE.Mesh = new THREE.Mesh(
|
|
52
|
+
new THREE.CircleGeometry(this._radius, 100),
|
|
53
|
+
new THREE.MeshBasicMaterial({
|
|
54
|
+
color: this._color,
|
|
55
|
+
opacity: this._opacity,
|
|
56
|
+
transparent: true,
|
|
57
|
+
}),
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
circle.up.fromArray([0, 0, 1]);
|
|
61
|
+
circle.renderOrder = -1;
|
|
62
|
+
circle.position.z = 0.0001;
|
|
63
|
+
const group: THREE.Object3D = new THREE.Object3D();
|
|
64
|
+
group.add(circle);
|
|
65
|
+
group.position.fromArray(position);
|
|
66
|
+
|
|
67
|
+
this._geometry = group;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
protected _disposeGeometry(): void {
|
|
71
|
+
for (let mesh of <THREE.Mesh[]>this._geometry.children) {
|
|
72
|
+
mesh.geometry.dispose();
|
|
73
|
+
(mesh.material as THREE.Material).dispose();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
protected _getInteractiveObjects(): THREE.Object3D[] {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export default CircleMarker;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
|
|
3
|
+
import { ILatLon } from "../../../API";
|
|
4
|
+
import { Marker } from "./Marker";
|
|
5
|
+
import IDotMarkerOptions from "../interfaces/IDotMarkerOptions";
|
|
6
|
+
|
|
7
|
+
export class DotMarker extends Marker {
|
|
8
|
+
private _offsetFactor: number;
|
|
9
|
+
private _outerColor: number | string;
|
|
10
|
+
|
|
11
|
+
constructor(id: string, latLon: ILatLon, options?: IDotMarkerOptions) {
|
|
12
|
+
super(id, latLon);
|
|
13
|
+
|
|
14
|
+
options = !!options ? options : {};
|
|
15
|
+
this._offsetFactor =
|
|
16
|
+
options.offsetFactor != null ? options.offsetFactor : -0.1;
|
|
17
|
+
this._outerColor =
|
|
18
|
+
options.outerColor != null ? options.outerColor : 0x000000;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
protected _createGeometry(position: number[]): void {
|
|
22
|
+
const circleOuter: THREE.Mesh = new THREE.Mesh(
|
|
23
|
+
new THREE.CircleGeometry(0.2, 100),
|
|
24
|
+
new THREE.MeshBasicMaterial({
|
|
25
|
+
color: this._outerColor,
|
|
26
|
+
opacity: 0.05,
|
|
27
|
+
transparent: true,
|
|
28
|
+
polygonOffset: true,
|
|
29
|
+
polygonOffsetFactor: this._offsetFactor,
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const circleInner: THREE.Mesh = new THREE.Mesh(
|
|
34
|
+
new THREE.CircleGeometry(0.125, 100),
|
|
35
|
+
new THREE.MeshBasicMaterial({
|
|
36
|
+
color: 0xffffff,
|
|
37
|
+
opacity: 0.7,
|
|
38
|
+
transparent: true,
|
|
39
|
+
polygonOffset: true,
|
|
40
|
+
polygonOffsetFactor: this._offsetFactor - 0.1,
|
|
41
|
+
}),
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
circleOuter.up.fromArray([0, 0, 1]);
|
|
45
|
+
circleOuter.renderOrder = -1;
|
|
46
|
+
circleOuter.position.z = 0.0001;
|
|
47
|
+
circleInner.position.z = 0.0001;
|
|
48
|
+
const group: THREE.Object3D = new THREE.Object3D();
|
|
49
|
+
group.add(circleOuter);
|
|
50
|
+
group.add(circleInner);
|
|
51
|
+
group.position.fromArray(position);
|
|
52
|
+
|
|
53
|
+
this._geometry = group;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
protected _disposeGeometry(): void {
|
|
57
|
+
for (let mesh of <THREE.Mesh[]>this._geometry.children) {
|
|
58
|
+
mesh.geometry.dispose();
|
|
59
|
+
(mesh.material as THREE.Material).dispose();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
protected _getInteractiveObjects(): THREE.Object3D[] {
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default DotMarker;
|