@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,1026 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<title>BeeMap and BeeView</title>
|
|
6
|
+
<meta charset='utf-8'/>
|
|
7
|
+
<meta name='viewport' content='width=device-width, initial-scale=1.0, user-scalable=no'/>
|
|
8
|
+
<script src='https://cdn.jsdelivr.net/npm/lodash@4.17.15/lodash.min.js'></script>
|
|
9
|
+
<script src='https://unpkg.com/@reactivex/rxjs@5.5.8/dist/global/Rx.js'></script>
|
|
10
|
+
<script src="dist/mapxus-visual.js"></script>
|
|
11
|
+
<link
|
|
12
|
+
href="dist/mapxus-visual.min.css"
|
|
13
|
+
rel="stylesheet"
|
|
14
|
+
/>
|
|
15
|
+
<!-- <script src='https://web-sdk.mapxus.com/prod/mapxus-visual-1.7.1.js'></script>
|
|
16
|
+
<link href='https://web-sdk.mapxus.com/prod/mapxus-visual-1.7.1.css' rel='stylesheet'/> -->
|
|
17
|
+
<link rel='stylesheet' href='https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css'>
|
|
18
|
+
<!-- dependent mapbox-gl -->
|
|
19
|
+
<script src='https://api.mapbox.com/mapbox-gl-js/v1.12.0/mapbox-gl.js'></script>
|
|
20
|
+
<link href='https://api.mapbox.com/mapbox-gl-js/v1.12.0/mapbox-gl.css' rel='stylesheet'/>
|
|
21
|
+
<!-- mapxus map -->
|
|
22
|
+
<script src='https://web-sdk.mapxus.com/prod/mapxus-map-3.5.8.js'></script>
|
|
23
|
+
<style>
|
|
24
|
+
body {
|
|
25
|
+
margin: 0;
|
|
26
|
+
padding: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
html,
|
|
30
|
+
body,
|
|
31
|
+
#map {
|
|
32
|
+
height: 100%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.min {
|
|
36
|
+
width: 320px;
|
|
37
|
+
height: 240px;
|
|
38
|
+
position: absolute;
|
|
39
|
+
bottom: 20px;
|
|
40
|
+
left: 20px;
|
|
41
|
+
border-radius: 6px;
|
|
42
|
+
z-index: 99;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
#beeview {
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.switch {
|
|
50
|
+
position: absolute;
|
|
51
|
+
bottom: 196px;
|
|
52
|
+
left: 276px;
|
|
53
|
+
z-index: 100;
|
|
54
|
+
opacity: 0.5;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.arrow {
|
|
60
|
+
background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjY0cHgiIGhlaWdodD0iNjRweCIgdmlld0JveD0iMCAwIDY0IDY0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPCEtLSBHZW5lcmF0b3I6IHNrZXRjaHRvb2wgMy43LjIgKDI4Mjc2KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT40RTEyNjkyQy0xNDYxLTRDOTUtQjgzOC1GRDI5NUEyNjIyNEY8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIHNrZXRjaHRvb2wuPC9kZXNjPgogICAgPGRlZnM+PC9kZWZzPgogICAgPGcgaWQ9IlBhZ2UtMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9InZpZXdfY29tcG9uZW50X3Bob3RvIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjU2LjAwMDAwMCwgMC4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9ImZsYXAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI1Ni4wMDAwMDAsIDAuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICA8cG9seWdvbiBpZD0iUGF0aC0xODM1IiBmaWxsLW9wYWNpdHk9IjAuMyIgZmlsbD0iIzI0MjUyOCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzIuMDAwMDAwLCAzMi4wMDAwMDApIHNjYWxlKC0xLCAxKSB0cmFuc2xhdGUoLTMyLjAwMDAwMCwgLTMyLjAwMDAwMCkgIiBwb2ludHM9IjAgNjQgNjQgMCAwIDAiPjwvcG9seWdvbj4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik00OCwxNiBMMzMuNSwxNiBDMzIuNjcxNTcyOSwxNiAzMiwxNS4zMjg0MjcxIDMyLDE0LjUgQzMyLDEzLjY3MTU3MjkgMzIuNjcxNTcyOSwxMyAzMy41LDEzIEw0OS41LDEzIEM0OS45MTQyMTM2LDEzIDUwLjI4OTIxMzYsMTMuMTY3ODkzMiA1MC41NjA2NjAyLDEzLjQzOTMzOTggQzUwLjgzMjEwNjgsMTMuNzEwNzg2NCA1MSwxNC4wODU3ODY0IDUxLDE0LjUgTDUxLDMwLjUgQzUxLDMxLjMyODQyNzEgNTAuMzI4NDI3MSwzMiA0OS41LDMyIEM0OC42NzE1NzI5LDMyIDQ4LDMxLjMyODQyNzEgNDgsMzAuNSBMNDgsMTYgTDQ4LDE2IFoiIGlkPSJDb21iaW5lZC1TaGFwZSIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=');
|
|
61
|
+
background-size: 100%;
|
|
62
|
+
background-repeat: no-repeat;
|
|
63
|
+
height: 64px;
|
|
64
|
+
width: 64px;
|
|
65
|
+
z-index: 100;
|
|
66
|
+
border-top-right-radius: 6px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.mapboxgl-popup-content {
|
|
70
|
+
padding: 2px !important;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.thumb-image {
|
|
74
|
+
background: black;
|
|
75
|
+
background-size: 240px 120px;
|
|
76
|
+
width: 160px;
|
|
77
|
+
height: 120px;
|
|
78
|
+
border-radius: 3px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.layer {
|
|
82
|
+
width: 160px;
|
|
83
|
+
height: 120px;
|
|
84
|
+
background: black;
|
|
85
|
+
opacity: 0.5;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.loading {
|
|
89
|
+
border-radius: 100%;
|
|
90
|
+
margin-left: 65px;
|
|
91
|
+
margin-top: 40px;
|
|
92
|
+
-webkit-animation-fill-mode: both;
|
|
93
|
+
animation-fill-mode: both;
|
|
94
|
+
border: 2px solid #fff;
|
|
95
|
+
border-bottom-color: transparent;
|
|
96
|
+
height: 25px;
|
|
97
|
+
width: 25px;
|
|
98
|
+
background: transparent !important;
|
|
99
|
+
display: inline-block;
|
|
100
|
+
-webkit-animation: rotate 0.75s 0s linear infinite;
|
|
101
|
+
animation: rotate 0.75s 0s linear infinite;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@keyframes rotate {
|
|
105
|
+
0% {
|
|
106
|
+
-webkit-transform: rotate(0deg) scale(1);
|
|
107
|
+
transform: rotate(0deg) scale(1);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
50% {
|
|
111
|
+
-webkit-transform: rotate(180deg) scale(0.6);
|
|
112
|
+
transform: rotate(180deg) scale(0.6);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
100% {
|
|
116
|
+
-webkit-transform: rotate(360deg) scale(1);
|
|
117
|
+
transform: rotate(360deg) scale(1);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@-webkit-keyframes rotate {
|
|
122
|
+
0% {
|
|
123
|
+
-webkit-transform: rotate(0deg) scale(1);
|
|
124
|
+
transform: rotate(0deg) scale(1);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
50% {
|
|
128
|
+
-webkit-transform: rotate(180deg) scale(0.6);
|
|
129
|
+
transform: rotate(180deg) scale(0.6);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
100% {
|
|
133
|
+
-webkit-transform: rotate(360deg) scale(1);
|
|
134
|
+
transform: rotate(360deg) scale(1);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@-moz-keyframes rotate {
|
|
139
|
+
0% {
|
|
140
|
+
-webkit-transform: rotate(0deg) scale(1);
|
|
141
|
+
transform: rotate(0deg) scale(1);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
50% {
|
|
145
|
+
-webkit-transform: rotate(180deg) scale(0.6);
|
|
146
|
+
transform: rotate(180deg) scale(0.6);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
100% {
|
|
150
|
+
-webkit-transform: rotate(360deg) scale(1);
|
|
151
|
+
transform: rotate(360deg) scale(1);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.layout {
|
|
156
|
+
display: none;
|
|
157
|
+
position: absolute;
|
|
158
|
+
top: 10px;
|
|
159
|
+
left: 10px;
|
|
160
|
+
font-size: 14px;
|
|
161
|
+
height: 31px;
|
|
162
|
+
border-radius: 5px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.message {
|
|
166
|
+
display: none;
|
|
167
|
+
width: 100%;
|
|
168
|
+
position: absolute;
|
|
169
|
+
z-index: 9;
|
|
170
|
+
bottom: 0;
|
|
171
|
+
padding: 40px 20px 20px 20px;
|
|
172
|
+
background: white;
|
|
173
|
+
border-top-left-radius: 5px;
|
|
174
|
+
border-top-right-radius: 5px;
|
|
175
|
+
box-shadow: 3px 1px 15px #888888;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
header,
|
|
179
|
+
content {
|
|
180
|
+
display: flex;
|
|
181
|
+
justify-content: center;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
header > div {
|
|
185
|
+
width: 25%;
|
|
186
|
+
background: rgb(103, 179, 163);
|
|
187
|
+
color: white;
|
|
188
|
+
padding: 10px;
|
|
189
|
+
font-size: 12px;
|
|
190
|
+
text-align: center;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
content > div {
|
|
194
|
+
width: 25%;
|
|
195
|
+
background: rgb(248, 248, 248);
|
|
196
|
+
color: rgb(169, 168, 168);
|
|
197
|
+
padding: 10px;
|
|
198
|
+
font-size: 12px;
|
|
199
|
+
text-align: center;
|
|
200
|
+
line-height: 4;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.contents {
|
|
204
|
+
overflow-x: auto;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.message > .cross {
|
|
208
|
+
width: 20px;
|
|
209
|
+
height: 20px;
|
|
210
|
+
background-color: white;
|
|
211
|
+
border-radius: 10px;
|
|
212
|
+
border: 1px solid rgb(173, 173, 181);
|
|
213
|
+
position: absolute;
|
|
214
|
+
right: 5px;
|
|
215
|
+
top: 5px;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.message > .cross:after {
|
|
219
|
+
content: '\2715';
|
|
220
|
+
color: rgb(173, 173, 181);
|
|
221
|
+
font-size: 12px;
|
|
222
|
+
position: relative;
|
|
223
|
+
left: 4px;
|
|
224
|
+
bottom: 4px;
|
|
225
|
+
cursor: pointer;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.contents > content:hover {
|
|
229
|
+
opacity: 0.7;
|
|
230
|
+
cursor: pointer;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.info {
|
|
234
|
+
display: none;
|
|
235
|
+
position: absolute;
|
|
236
|
+
bottom: 267px;
|
|
237
|
+
left: 20px;
|
|
238
|
+
z-index: 100;
|
|
239
|
+
background-color: rgba(255, 255, 255, 0.5);
|
|
240
|
+
padding: 5px;
|
|
241
|
+
border-radius: 5px;
|
|
242
|
+
color: blueviolet;
|
|
243
|
+
font-size: 14px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.input-group {
|
|
247
|
+
background: white;
|
|
248
|
+
border-radius: 5px;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
i {
|
|
252
|
+
color: red;
|
|
253
|
+
font-style: normal;
|
|
254
|
+
font-weight: 700;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
p {
|
|
258
|
+
padding: 0;
|
|
259
|
+
margin: 0;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.card {
|
|
263
|
+
position: relative;
|
|
264
|
+
display: -webkit-box;
|
|
265
|
+
display: -ms-flexbox;
|
|
266
|
+
display: flex;
|
|
267
|
+
-webkit-box-orient: vertical;
|
|
268
|
+
-webkit-box-direction: normal;
|
|
269
|
+
-ms-flex-direction: column;
|
|
270
|
+
flex-direction: column;
|
|
271
|
+
min-width: 0;
|
|
272
|
+
word-wrap: break-word;
|
|
273
|
+
background-color: #fff;
|
|
274
|
+
background-clip: border-box;
|
|
275
|
+
border: 1px solid rgba(0, 0, 0, 0.125);
|
|
276
|
+
border-radius: 0.25rem;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.card-body {
|
|
280
|
+
padding: 16px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.card-toggle {
|
|
284
|
+
position: absolute;
|
|
285
|
+
top: 50px;
|
|
286
|
+
width: 575px;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.card-hidden {
|
|
290
|
+
width: 30px;
|
|
291
|
+
height: 30px;
|
|
292
|
+
border-radius: 50%;
|
|
293
|
+
cursor: pointer;
|
|
294
|
+
border: 1px solid rgb(216, 216, 216);
|
|
295
|
+
background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjVweCIgaGVpZ2h0PSIxMnB4IiB2aWV3Qm94PSIwIDAgMjUgMTIiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUwLjIgKDU1MDQ3KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5jbG9zZTwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+CiAgICAgICAgPGcgaWQ9InNlbGVjdG9yLWhpZGRlbiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI2NS4wMDAwMDAsIC0xMzAuMDAwMDAwKSIgc3Ryb2tlPSIjOEE4QUNCIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8ZyBpZD0ic3dpdGNoX2J0biIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjUyLjAwMDAwMCwgMTEwLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPGcgaWQ9ImNsb3NlIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMy4wMDAwMDAsIDIwLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0yMiw2LjUgQzE5LjE2NDQ3MDEsMi44MzMzMzMzMyAxNS45OTc4MDM0LDEgMTIuNSwxIEM5LjAwMjE5NjU4LDEgNS44MzU1Mjk5MiwyLjgzMzMzMzMzIDMsNi41IiBpZD0iT3ZhbC0zIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMi41MDAwMDAsIDMuNzUwMDAwKSByb3RhdGUoMTgwLjAwMDAwMCkgdHJhbnNsYXRlKC0xMi41MDAwMDAsIC0zLjc1MDAwMCkgIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTEyLjUsMTAuNSBMMTIuNSw2LjUiIGlkPSJMaW5lIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE5LjUsOC41IEwxNy41LDUuNSIgaWQ9IkxpbmUtMiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0yMy41LDQuNSBMMjEuNSwyLjUiIGlkPSJMaW5lLTMiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNNy41LDguNSBMNS41LDUuNSIgaWQ9IkxpbmUtMiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNi41MDAwMDAsIDcuMDAwMDAwKSBzY2FsZSgtMSwgMSkgdHJhbnNsYXRlKC02LjUwMDAwMCwgLTcuMDAwMDAwKSAiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMy41LDQuNSBMMS41LDIuNSIgaWQ9IkxpbmUtMyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMi41MDAwMDAsIDMuNTAwMDAwKSBzY2FsZSgtMSwgMSkgdHJhbnNsYXRlKC0yLjUwMDAwMCwgLTMuNTAwMDAwKSAiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+');
|
|
296
|
+
background-repeat: no-repeat;
|
|
297
|
+
background-position-x: 2px;
|
|
298
|
+
background-position-y: 10px;
|
|
299
|
+
background-color: white;
|
|
300
|
+
display: none;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.card-show {
|
|
304
|
+
width: 25px;
|
|
305
|
+
height: 25px;
|
|
306
|
+
border-radius: 50%;
|
|
307
|
+
cursor: pointer;
|
|
308
|
+
float: right;
|
|
309
|
+
background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTlweCIgaGVpZ2h0PSIxMXB4IiB2aWV3Qm94PSIwIDAgMTkgMTEiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUwLjIgKDU1MDQ3KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5vcGVuPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGRlZnM+PC9kZWZzPgogICAgPGcgaWQ9IlBhZ2UtMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9InNlbGVjdG9yLWRpc3BsYXkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNjguMDAwMDAwLCAtMTMwLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0ic3dpdGNoX2J0biIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjUyLjAwMDAwMCwgMTEwLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPGcgaWQ9Im9wZW4iIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE2LjAwMDAwMCwgMjAuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTkuNSwxMSBDMTIuOTk3ODAzNCwxMSAxNi4xNjQ0NzAxLDkuMTY2NjY2NjcgMTksNS41IEMxNi4xNjQ0NzAxLDEuODMzMzMzMzMgMTIuOTk3ODAzNCwwIDkuNSwwIEM2LjAwMjE5NjU4LDAgMi44MzU1Mjk5MiwxLjgzMzMzMzMzIDAsNS41IEMyLjgzNTUyOTkyLDkuMTY2NjY2NjcgNi4wMDIxOTY1OCwxMSA5LjUsMTEgWiIgaWQ9Ik92YWwtMyIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxjaXJjbGUgaWQ9Ik92YWwtMiIgZmlsbD0iIzhBOEFDQiIgY3g9IjkuNSIgY3k9IjUuNSIgcj0iMy41Ij48L2NpcmNsZT4KICAgICAgICAgICAgICAgICAgICA8Y2lyY2xlIGlkPSJPdmFsLTIiIGZpbGw9IiNGRkZGRkYiIGN4PSI5LjUiIGN5PSI1LjUiIHI9IjEuNSI+PC9jaXJjbGU+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==');
|
|
310
|
+
background-repeat: no-repeat;
|
|
311
|
+
background-position-x: 3px;
|
|
312
|
+
background-position-y: 7px;
|
|
313
|
+
background-color: rgb(138, 140, 201);
|
|
314
|
+
}
|
|
315
|
+
</style>
|
|
316
|
+
</head>
|
|
317
|
+
|
|
318
|
+
<body>
|
|
319
|
+
<div id='map'></div>
|
|
320
|
+
<div id='beeview' class='min'></div>
|
|
321
|
+
<div class='info'>
|
|
322
|
+
<div class='image-angle'>Bearing: <span>0</span></div>
|
|
323
|
+
<div class='image-key'>Key: <span>null</span></div>
|
|
324
|
+
</div>
|
|
325
|
+
<div class='switch'>
|
|
326
|
+
<div class='arrow'></div>
|
|
327
|
+
</div>
|
|
328
|
+
<div class='layout'>
|
|
329
|
+
<div class='input-group input-group-sm mb-3'>
|
|
330
|
+
<input
|
|
331
|
+
type='search'
|
|
332
|
+
class='form-control'
|
|
333
|
+
disabled
|
|
334
|
+
value='k11'
|
|
335
|
+
placeholder='for building search'
|
|
336
|
+
/>
|
|
337
|
+
<div class='input-group-append'>
|
|
338
|
+
<button class='btn btn-outline-secondary' type='button' disabled>
|
|
339
|
+
Search
|
|
340
|
+
</button>
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
<div class='card'>
|
|
344
|
+
<div class='card-body'>
|
|
345
|
+
<p class='card-text'>Click on a green dot to see the 360 view.</p>
|
|
346
|
+
<p class='card-text'>
|
|
347
|
+
Click the right-upper corner of the small map view to switch with
|
|
348
|
+
the main map view.
|
|
349
|
+
</p>
|
|
350
|
+
<p class='card-text'>
|
|
351
|
+
Drag on the 360 view to view different directions.
|
|
352
|
+
</p>
|
|
353
|
+
<p class='card-text'>
|
|
354
|
+
Click on the path (white dots on the floor) on the 360 view to
|
|
355
|
+
<i>“walk around”</i>.
|
|
356
|
+
</p>
|
|
357
|
+
</div>
|
|
358
|
+
</div>
|
|
359
|
+
<div class='card-toggle'>
|
|
360
|
+
<div class='card-show'></div>
|
|
361
|
+
<div class='card-hidden'></div>
|
|
362
|
+
</div>
|
|
363
|
+
</div>
|
|
364
|
+
<div class='message'>
|
|
365
|
+
<div class='cross'></div>
|
|
366
|
+
<header>
|
|
367
|
+
<div>Name</div>
|
|
368
|
+
<div>Street</div>
|
|
369
|
+
<div>Floors</div>
|
|
370
|
+
<div>Coordinate</div>
|
|
371
|
+
</header>
|
|
372
|
+
<div class='contents'></div>
|
|
373
|
+
</div>
|
|
374
|
+
|
|
375
|
+
<script>
|
|
376
|
+
// hepler
|
|
377
|
+
var Angles = (function () {
|
|
378
|
+
function Angles() {
|
|
379
|
+
var min = 0;
|
|
380
|
+
var max = 360;
|
|
381
|
+
this.angles = [];
|
|
382
|
+
this.step = 15;
|
|
383
|
+
for (var i = min; i < max / this.step; i++) {
|
|
384
|
+
this.angles.push(i * this.step);
|
|
385
|
+
}
|
|
386
|
+
this.angles = this.angles.reverse();
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
Angles.prototype.position = function (bearing) {
|
|
390
|
+
return this.angles[Math.floor(Math.floor(bearing) / this.step)];
|
|
391
|
+
};
|
|
392
|
+
return Angles;
|
|
393
|
+
})();
|
|
394
|
+
var Visual = (function () {
|
|
395
|
+
function Visual(mapbox) {
|
|
396
|
+
this.mapbox = mapbox;
|
|
397
|
+
this.layerLine = 'layer-visual-line';
|
|
398
|
+
this.layerPoint = 'layer-visual-point';
|
|
399
|
+
this.layerPointHover = 'layer-visual-point-hover';
|
|
400
|
+
this.layerPointClicked = 'layer-visual-point-clicked';
|
|
401
|
+
this.sourcePoint = 'source-visual-point';
|
|
402
|
+
this.sourceLine = 'source-visual-line';
|
|
403
|
+
this.sourceClicked = 'source-visual-clicked';
|
|
404
|
+
this.total = [];
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
Visual.prototype.init = function (buildingId, floor, callback) {
|
|
408
|
+
if (this.mapbox) {
|
|
409
|
+
if (this.mapbox.getLayer(this.layerPointClicked)) {
|
|
410
|
+
this.mapbox.removeLayer(this.layerPointClicked);
|
|
411
|
+
}
|
|
412
|
+
if (this.mapbox.getLayer(this.layerPointHover)) {
|
|
413
|
+
this.mapbox.removeLayer(this.layerPointHover);
|
|
414
|
+
}
|
|
415
|
+
if (this.mapbox.getLayer(this.layerLine)) {
|
|
416
|
+
this.mapbox.removeLayer(this.layerLine);
|
|
417
|
+
}
|
|
418
|
+
if (this.mapbox.getLayer(this.layerPoint)) {
|
|
419
|
+
this.mapbox.removeLayer(this.layerPoint);
|
|
420
|
+
}
|
|
421
|
+
if (this.mapbox.getSource(this.sourceClicked)) {
|
|
422
|
+
this.mapbox.removeSource(this.sourceClicked);
|
|
423
|
+
}
|
|
424
|
+
if (this.mapbox.getSource(this.sourceLine)) {
|
|
425
|
+
this.mapbox.removeSource(this.sourceLine);
|
|
426
|
+
}
|
|
427
|
+
if (this.mapbox.getSource(this.sourcePoint)) {
|
|
428
|
+
this.mapbox.removeSource(this.sourcePoint);
|
|
429
|
+
}
|
|
430
|
+
var northEast = [21.09088179431916, 105.89776179980794];
|
|
431
|
+
var southWest = [20.953224870825338, 105.75942488596058];
|
|
432
|
+
beeview.searchOutdoorImageByBbox(
|
|
433
|
+
northEast[0],
|
|
434
|
+
northEast[1],
|
|
435
|
+
southWest[0],
|
|
436
|
+
southWest[1]
|
|
437
|
+
).then(
|
|
438
|
+
function (json) {
|
|
439
|
+
json = json.reduce(function (pre, cur) {
|
|
440
|
+
return pre.concat(cur);
|
|
441
|
+
}, []);
|
|
442
|
+
var visualAddSource = this.addSource(this.getPointData(json))
|
|
443
|
+
.addPoint(floor)
|
|
444
|
+
.addLine(floor);
|
|
445
|
+
if (visualAddSource) {
|
|
446
|
+
visualAddSource.addPointHover()
|
|
447
|
+
.addPointClicked();
|
|
448
|
+
}
|
|
449
|
+
if (callback) {
|
|
450
|
+
callback();
|
|
451
|
+
}
|
|
452
|
+
}.bind(this)
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
return this;
|
|
456
|
+
};
|
|
457
|
+
Visual.prototype.updatePointClicked = function (lngLat) {
|
|
458
|
+
var data = {
|
|
459
|
+
type: 'Feature',
|
|
460
|
+
geometry: {
|
|
461
|
+
type: 'Point',
|
|
462
|
+
coordinates: lngLat
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
var source = this.mapbox.getSource(this.sourceClicked);
|
|
466
|
+
if (source) {
|
|
467
|
+
source.setData(data);
|
|
468
|
+
}
|
|
469
|
+
return this;
|
|
470
|
+
};
|
|
471
|
+
Visual.prototype.filter = function (floor) {
|
|
472
|
+
if (this.mapbox.getLayer(this.layerLine)) {
|
|
473
|
+
this.mapbox.setFilter(this.layerLine, ['==', 'floor_code', floor]);
|
|
474
|
+
}
|
|
475
|
+
if (this.mapbox.getLayer(this.layerPoint)) {
|
|
476
|
+
this.mapbox.setFilter(this.layerPoint, ['==', 'floor_code', floor]);
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
Visual.prototype.filterHover = function (key) {
|
|
480
|
+
if (this.mapbox.getLayer(this.layerPointHover)) {
|
|
481
|
+
this.mapbox.setFilter(this.layerPointHover, ['==', 'key', key]);
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
Visual.prototype.filterIconBearing = function (angle) {
|
|
485
|
+
if (mapbox.getLayer(this.layerPointClicked)) {
|
|
486
|
+
mapbox.setLayoutProperty(
|
|
487
|
+
this.layerPointClicked,
|
|
488
|
+
'icon-image',
|
|
489
|
+
'yellow_' + angle
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
Visual.prototype.flattenPoint = function (json) {
|
|
494
|
+
var list = [];
|
|
495
|
+
json.forEach(function (value) {
|
|
496
|
+
list = list.concat(value.images);
|
|
497
|
+
});
|
|
498
|
+
return list;
|
|
499
|
+
};
|
|
500
|
+
Visual.prototype.flattenMultiLine = function (json) {
|
|
501
|
+
var list = {};
|
|
502
|
+
json.forEach(function (value) {
|
|
503
|
+
list[value.key] = value.images;
|
|
504
|
+
});
|
|
505
|
+
return list;
|
|
506
|
+
};
|
|
507
|
+
Visual.prototype.getPointData = function (list) {
|
|
508
|
+
return this.collection(
|
|
509
|
+
list.map(data => {
|
|
510
|
+
var coordinates = [data.l.lon, data.l.lat];
|
|
511
|
+
var properties = _.omit(data, ['l']);
|
|
512
|
+
properties.floor_id = data.floor.id;
|
|
513
|
+
properties.floor_code = data.floor.code;
|
|
514
|
+
return this.point(coordinates, properties);
|
|
515
|
+
})
|
|
516
|
+
);
|
|
517
|
+
};
|
|
518
|
+
Visual.prototype.getMultiLineString = function (list) {
|
|
519
|
+
var obj = {};
|
|
520
|
+
_.map(list, function (value, key) {
|
|
521
|
+
var index = key.lastIndexOf('_');
|
|
522
|
+
var floor = key.substr(0, index);
|
|
523
|
+
var num = key.substr(index + 1, key.length - index);
|
|
524
|
+
if (!obj[floor]) {
|
|
525
|
+
obj[floor] = {
|
|
526
|
+
coordinates: [],
|
|
527
|
+
properties: {}
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
obj[floor].coordinates.push(
|
|
531
|
+
value.map(function (val) {
|
|
532
|
+
return [val.l.lon, val.l.lat];
|
|
533
|
+
})
|
|
534
|
+
);
|
|
535
|
+
obj[floor].properties = {
|
|
536
|
+
floor_code: value[0].floor_code,
|
|
537
|
+
floor_id: value[0].floor_id
|
|
538
|
+
};
|
|
539
|
+
});
|
|
540
|
+
return obj;
|
|
541
|
+
};
|
|
542
|
+
Visual.prototype.getMultiLineStringData = function (list) {
|
|
543
|
+
var index = 0;
|
|
544
|
+
var temp = [];
|
|
545
|
+
var data = [];
|
|
546
|
+
_.forEach(
|
|
547
|
+
this.getMultiLineString(list),
|
|
548
|
+
function (value, key, element) {
|
|
549
|
+
index = element[key].coordinates.length - 1;
|
|
550
|
+
value.coordinates.forEach(
|
|
551
|
+
function (val, i) {
|
|
552
|
+
temp.push(val);
|
|
553
|
+
if (i === index) {
|
|
554
|
+
data.push(
|
|
555
|
+
this.multiLineString(temp, element[key].properties)
|
|
556
|
+
);
|
|
557
|
+
temp = [];
|
|
558
|
+
}
|
|
559
|
+
}.bind(this)
|
|
560
|
+
);
|
|
561
|
+
}.bind(this)
|
|
562
|
+
);
|
|
563
|
+
return this.collection(data);
|
|
564
|
+
};
|
|
565
|
+
Visual.prototype.point = function (coordinates, properties) {
|
|
566
|
+
return {
|
|
567
|
+
type: 'Feature',
|
|
568
|
+
geometry: {
|
|
569
|
+
type: 'Point',
|
|
570
|
+
coordinates: coordinates
|
|
571
|
+
},
|
|
572
|
+
properties: properties
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
Visual.prototype.multiLineString = function (coordinates, properties) {
|
|
576
|
+
return {
|
|
577
|
+
type: 'Feature',
|
|
578
|
+
geometry: {
|
|
579
|
+
type: 'MultiLineString',
|
|
580
|
+
coordinates: coordinates
|
|
581
|
+
},
|
|
582
|
+
properties: properties
|
|
583
|
+
};
|
|
584
|
+
};
|
|
585
|
+
Visual.prototype.collection = function (features) {
|
|
586
|
+
return {
|
|
587
|
+
type: 'FeatureCollection',
|
|
588
|
+
features: features
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
Visual.prototype.addSource = function (pointData, multiLineStringData) {
|
|
592
|
+
this.mapbox.addSource(this.sourcePoint, {
|
|
593
|
+
type: 'geojson',
|
|
594
|
+
data: pointData
|
|
595
|
+
});
|
|
596
|
+
this.mapbox.addSource(this.sourceClicked, {
|
|
597
|
+
type: 'geojson',
|
|
598
|
+
data: {
|
|
599
|
+
type: 'Feature',
|
|
600
|
+
geometry: {
|
|
601
|
+
type: 'Point',
|
|
602
|
+
coordinates: []
|
|
603
|
+
},
|
|
604
|
+
properties: {}
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
return this;
|
|
608
|
+
};
|
|
609
|
+
Visual.prototype.addPoint = function (floor) {
|
|
610
|
+
this.mapbox.addLayer({
|
|
611
|
+
id: this.layerPoint,
|
|
612
|
+
type: 'circle',
|
|
613
|
+
source: this.sourcePoint,
|
|
614
|
+
paint: {
|
|
615
|
+
'circle-color': 'rgb(53, 175, 109)',
|
|
616
|
+
'circle-opacity': 0.6
|
|
617
|
+
},
|
|
618
|
+
filter: ['==', 'floor_code', floor]
|
|
619
|
+
});
|
|
620
|
+
return this;
|
|
621
|
+
};
|
|
622
|
+
Visual.prototype.addLine = function (floor) {
|
|
623
|
+
if (this.mapbox.getSource(this.sourceLine)) {
|
|
624
|
+
this.mapbox.addLayer({
|
|
625
|
+
id: this.layerLine,
|
|
626
|
+
type: 'line',
|
|
627
|
+
source: this.sourceLine,
|
|
628
|
+
layout: {
|
|
629
|
+
'line-cap': 'round',
|
|
630
|
+
'line-join': 'round'
|
|
631
|
+
},
|
|
632
|
+
paint: {
|
|
633
|
+
'line-opacity': 0.6,
|
|
634
|
+
'line-color': 'rgb(53, 175, 109)',
|
|
635
|
+
'line-width': 2
|
|
636
|
+
},
|
|
637
|
+
filter: ['==', 'floor_code', floor]
|
|
638
|
+
});
|
|
639
|
+
return this;
|
|
640
|
+
}
|
|
641
|
+
};
|
|
642
|
+
Visual.prototype.addPointHover = function () {
|
|
643
|
+
this.mapbox.addLayer({
|
|
644
|
+
id: this.layerPointHover,
|
|
645
|
+
type: 'symbol',
|
|
646
|
+
source: this.sourcePoint,
|
|
647
|
+
layout: {
|
|
648
|
+
'icon-image': 'blue02_60',
|
|
649
|
+
'icon-allow-overlap': !0,
|
|
650
|
+
'icon-rotate': {
|
|
651
|
+
property: 'heading',
|
|
652
|
+
stops: [[0, 0], [360, 360]]
|
|
653
|
+
},
|
|
654
|
+
'icon-rotation-alignment': 'map'
|
|
655
|
+
},
|
|
656
|
+
filter: ['==', 'key', '']
|
|
657
|
+
});
|
|
658
|
+
return this;
|
|
659
|
+
};
|
|
660
|
+
Visual.prototype.addPointClicked = function () {
|
|
661
|
+
this.mapbox.addLayer({
|
|
662
|
+
id: this.layerPointClicked,
|
|
663
|
+
type: 'symbol',
|
|
664
|
+
source: this.sourceClicked,
|
|
665
|
+
layout: {
|
|
666
|
+
'icon-image': 'yellow_0',
|
|
667
|
+
'icon-allow-overlap': !0,
|
|
668
|
+
'icon-rotate': {
|
|
669
|
+
property: 'heading',
|
|
670
|
+
stops: [[0, 0], [360, 360]]
|
|
671
|
+
},
|
|
672
|
+
'icon-rotation-alignment': 'map'
|
|
673
|
+
}
|
|
674
|
+
});
|
|
675
|
+
return this;
|
|
676
|
+
};
|
|
677
|
+
return Visual;
|
|
678
|
+
})();
|
|
679
|
+
var Thumb = (function () {
|
|
680
|
+
function Thumb() {
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
Thumb.prototype.create = function (popup, key, coordinates) {
|
|
684
|
+
var url = `https://beeview-cdn.mapxus.com/prod/public/previews/${key}/thumbnails/thumb-640.jpg`;
|
|
685
|
+
var html = `<div class='thumb-image' style='background-image: url('${url}')'>
|
|
686
|
+
<div class='layer'>
|
|
687
|
+
<div class='loading'></div>
|
|
688
|
+
</div>
|
|
689
|
+
</div>`;
|
|
690
|
+
this.reqImg(url);
|
|
691
|
+
|
|
692
|
+
popup.setLngLat(coordinates)
|
|
693
|
+
.setHTML(html)
|
|
694
|
+
.addTo(mapbox);
|
|
695
|
+
return this;
|
|
696
|
+
};
|
|
697
|
+
Thumb.prototype.remove = function (popup) {
|
|
698
|
+
popup.remove();
|
|
699
|
+
return this;
|
|
700
|
+
};
|
|
701
|
+
Thumb.prototype.hidden = function (element, opacity, interval) {
|
|
702
|
+
var timer = setInterval(function () {
|
|
703
|
+
opacity += interval;
|
|
704
|
+
if (element && element.style) {
|
|
705
|
+
element.style.opacity = opacity;
|
|
706
|
+
}
|
|
707
|
+
if (opacity < 0) {
|
|
708
|
+
window.clearInterval(timer);
|
|
709
|
+
if (element) element.remove();
|
|
710
|
+
}
|
|
711
|
+
}, 1);
|
|
712
|
+
return this;
|
|
713
|
+
};
|
|
714
|
+
Thumb.prototype.reqImg = function (url) {
|
|
715
|
+
var headers = {
|
|
716
|
+
Accept: 'image/jpeg'
|
|
717
|
+
};
|
|
718
|
+
return fetch(url, {
|
|
719
|
+
headers: headers
|
|
720
|
+
}).then(res => {
|
|
721
|
+
var layer = document.querySelector('.layer');
|
|
722
|
+
this.hidden(layer, 1, -0.01);
|
|
723
|
+
});
|
|
724
|
+
};
|
|
725
|
+
return Thumb;
|
|
726
|
+
})();
|
|
727
|
+
var appId = 'com.mapxus.sample.web';
|
|
728
|
+
var secret = 'EnZ/3WkawM';
|
|
729
|
+
// init mapbox-gl
|
|
730
|
+
var mapbox = new mapboxgl.Map({
|
|
731
|
+
container: 'map',
|
|
732
|
+
zoom: 16.0,
|
|
733
|
+
center: [105.80904031391339, 21.01014900298894]
|
|
734
|
+
});
|
|
735
|
+
// init mapxus map
|
|
736
|
+
var map = new MapxusMap.Map({
|
|
737
|
+
map: mapbox,
|
|
738
|
+
appId: appId,
|
|
739
|
+
secret: secret
|
|
740
|
+
});
|
|
741
|
+
// init beeview
|
|
742
|
+
var beeview = new MapxusVisual.Viewer({
|
|
743
|
+
appId: appId,
|
|
744
|
+
secret: secret,
|
|
745
|
+
container: 'beeview'
|
|
746
|
+
});
|
|
747
|
+
var message = document.querySelector('.message');
|
|
748
|
+
var input = document.querySelector('input[type=search]');
|
|
749
|
+
var search = document.querySelector('button');
|
|
750
|
+
var beeviewElm = document.querySelector('#beeview');
|
|
751
|
+
var mapElm = document.querySelector('#map');
|
|
752
|
+
var switchElm = document.querySelector('.switch');
|
|
753
|
+
var layoutElm = document.querySelector('.layout');
|
|
754
|
+
var infoElm = document.querySelector('.info');
|
|
755
|
+
var cardInfoElm = document.querySelector('.card');
|
|
756
|
+
var cardShowElm = document.querySelector('.card-show');
|
|
757
|
+
var cardHideElm = document.querySelector('.card-hidden');
|
|
758
|
+
var service;
|
|
759
|
+
var visual = new Visual(mapbox);
|
|
760
|
+
var angles = new Angles();
|
|
761
|
+
var thumb = new Thumb();
|
|
762
|
+
|
|
763
|
+
function loadViewer(floor) {
|
|
764
|
+
var popup = new mapboxgl.Popup({
|
|
765
|
+
closeButton: false
|
|
766
|
+
});
|
|
767
|
+
// switch beemap to beeview or beeview to beemap
|
|
768
|
+
switchMap();
|
|
769
|
+
// init beeview info
|
|
770
|
+
visual.init(null, 'G');
|
|
771
|
+
// beeview point click event
|
|
772
|
+
mapbox.on('click', visual.layerPoint, function (event) {
|
|
773
|
+
const key = event.features[0].properties.key;
|
|
774
|
+
selectedNodeKey(key);
|
|
775
|
+
remove(); // remove message window
|
|
776
|
+
hidden(message);
|
|
777
|
+
});
|
|
778
|
+
// beeview node change event
|
|
779
|
+
beeview.on(MapxusVisual.Viewer.nodechanged, function (node) {
|
|
780
|
+
var lngLat = [node.originalLatLon.lon, node.originalLatLon.lat];
|
|
781
|
+
visual.updatePointClicked(lngLat);
|
|
782
|
+
mapbox.panTo(lngLat);
|
|
783
|
+
infoElm.querySelector('.image-key span').innerHTML = node.key;
|
|
784
|
+
});
|
|
785
|
+
// beeview bearing change event
|
|
786
|
+
beeview.on(MapxusVisual.Viewer.bearingchanged, function (bearing) {
|
|
787
|
+
// switch symbol icon
|
|
788
|
+
visual.filterIconBearing(angles.position(bearing));
|
|
789
|
+
infoElm.querySelector('.image-angle span').innerHTML = bearing;
|
|
790
|
+
});
|
|
791
|
+
// beeview mouseenter event
|
|
792
|
+
mapbox.on('mouseenter', visual.layerPoint, function (event) {
|
|
793
|
+
var feature = event.features[0];
|
|
794
|
+
var key = feature.properties.key;
|
|
795
|
+
var coordinates = feature.geometry.coordinates;
|
|
796
|
+
visual.filterHover(key);
|
|
797
|
+
mapbox.getCanvas().style.cursor = 'pointer';
|
|
798
|
+
thumb.create(popup, key, coordinates);
|
|
799
|
+
});
|
|
800
|
+
// beeview mouseleava event
|
|
801
|
+
mapbox.on('mouseleave', visual.layerPoint, function (event) {
|
|
802
|
+
visual.filterHover('');
|
|
803
|
+
mapbox.getCanvas().style.cursor = '';
|
|
804
|
+
thumb.remove(popup);
|
|
805
|
+
});
|
|
806
|
+
// toggle
|
|
807
|
+
search.addEventListener('click', searchBuilding);
|
|
808
|
+
// key enter event
|
|
809
|
+
input.addEventListener('keypress', function (event) {
|
|
810
|
+
if (event.keyCode === 13) {
|
|
811
|
+
searchBuilding();
|
|
812
|
+
}
|
|
813
|
+
});
|
|
814
|
+
|
|
815
|
+
// browser init params
|
|
816
|
+
var params = getBrowserParams();
|
|
817
|
+
if (params && params.name) {
|
|
818
|
+
service.searchByGlobal(params.name).then(function (res) {
|
|
819
|
+
var data = res.data.result.buildings[0];
|
|
820
|
+
map.switchBuilding(data.buildingId, function () {
|
|
821
|
+
selectedNodeKey(params.key, params.bearing, moveToKeyCallback);
|
|
822
|
+
});
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
// mapxus load map listener
|
|
828
|
+
map.renderComplete(function () {
|
|
829
|
+
// buildings service
|
|
830
|
+
service = new MapxusMap.BuildingsService();
|
|
831
|
+
|
|
832
|
+
input.removeAttribute('disabled');
|
|
833
|
+
search.removeAttribute('disabled');
|
|
834
|
+
|
|
835
|
+
loadViewer(map.currentFloor);
|
|
836
|
+
|
|
837
|
+
cardShowElm.addEventListener('click', function () {
|
|
838
|
+
hidden(cardShowElm);
|
|
839
|
+
hidden(cardInfoElm);
|
|
840
|
+
show(cardHideElm);
|
|
841
|
+
});
|
|
842
|
+
cardHideElm.addEventListener('click', function () {
|
|
843
|
+
show(cardShowElm);
|
|
844
|
+
show(cardInfoElm);
|
|
845
|
+
hidden(cardHideElm);
|
|
846
|
+
});
|
|
847
|
+
});
|
|
848
|
+
|
|
849
|
+
// close search pop window
|
|
850
|
+
message.querySelector('.cross').addEventListener('click', function () {
|
|
851
|
+
hidden(message);
|
|
852
|
+
});
|
|
853
|
+
|
|
854
|
+
function switchMap() {
|
|
855
|
+
switchElm.addEventListener('click', toggle, false);
|
|
856
|
+
|
|
857
|
+
function toggle() {
|
|
858
|
+
var rect = document.body.getBoundingClientRect();
|
|
859
|
+
if (beeviewElm.classList.contains('min')) {
|
|
860
|
+
beeviewElm.classList.remove('min');
|
|
861
|
+
beeviewElm.style.width = rect.width + 'px';
|
|
862
|
+
beeviewElm.style.height = rect.height + 'px';
|
|
863
|
+
mapElm.classList.add('min');
|
|
864
|
+
mapElm.style.width = '320px';
|
|
865
|
+
mapElm.style.height = '240px';
|
|
866
|
+
} else {
|
|
867
|
+
mapElm.classList.remove('min');
|
|
868
|
+
mapElm.style.width = rect.width + 'px';
|
|
869
|
+
mapElm.style.height = rect.height + 'px';
|
|
870
|
+
beeviewElm.classList.add('min');
|
|
871
|
+
beeviewElm.style.width = '320px';
|
|
872
|
+
beeviewElm.style.height = '240px';
|
|
873
|
+
}
|
|
874
|
+
mapbox.resize();
|
|
875
|
+
beeview.resize();
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
// search building
|
|
880
|
+
function searchBuilding() {
|
|
881
|
+
/**
|
|
882
|
+
* bbox search
|
|
883
|
+
* params:
|
|
884
|
+
* 1. building name
|
|
885
|
+
*/
|
|
886
|
+
var value = input.value;
|
|
887
|
+
service.searchByGlobal(value)
|
|
888
|
+
.then(function (res) {
|
|
889
|
+
var data = res.data.result.buildings;
|
|
890
|
+
remove();
|
|
891
|
+
show(message);
|
|
892
|
+
for (var i = 0; i < data.length; i++) {
|
|
893
|
+
create(data[i]);
|
|
894
|
+
}
|
|
895
|
+
height(data);
|
|
896
|
+
|
|
897
|
+
visual.updatePointClicked([]);
|
|
898
|
+
|
|
899
|
+
hidden(beeviewElm);
|
|
900
|
+
hidden(switchElm);
|
|
901
|
+
hidden(infoElm);
|
|
902
|
+
|
|
903
|
+
if (!beeviewElm.classList.contains('min')) {
|
|
904
|
+
var rect = document.body.getBoundingClientRect();
|
|
905
|
+
mapElm.classList.remove('min');
|
|
906
|
+
mapElm.style.width = rect.width + 'px';
|
|
907
|
+
mapElm.style.height = rect.height + 'px';
|
|
908
|
+
beeviewElm.classList.add('min');
|
|
909
|
+
beeviewElm.style.width = '320px';
|
|
910
|
+
beeviewElm.style.height = '240px';
|
|
911
|
+
mapbox.resize();
|
|
912
|
+
beeview.resize();
|
|
913
|
+
}
|
|
914
|
+
})
|
|
915
|
+
.catch(function (err) {
|
|
916
|
+
console.error(err);
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
function show(element) {
|
|
921
|
+
element.style.display = 'block';
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
function hidden(element) {
|
|
925
|
+
element.style.display = 'none';
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
function create(data) {
|
|
929
|
+
var name = document.createElement('div');
|
|
930
|
+
var street = document.createElement('div');
|
|
931
|
+
var floors = document.createElement('div');
|
|
932
|
+
var coordinate = document.createElement('div');
|
|
933
|
+
var content = document.createElement('content');
|
|
934
|
+
var contents = message.querySelector('.contents');
|
|
935
|
+
var addressInfo = data.address.default || data.address.cn || data.address.en;
|
|
936
|
+
contents.appendChild(content);
|
|
937
|
+
|
|
938
|
+
name.textContent = data.name.default;
|
|
939
|
+
street.textContent = addressInfo.street;
|
|
940
|
+
floors.textContent = data.floors.map(parseFloor);
|
|
941
|
+
coordinate.textContent = data.labelCenter.lat + ', ' + data.labelCenter.lon;
|
|
942
|
+
content.appendChild(name);
|
|
943
|
+
content.appendChild(street);
|
|
944
|
+
content.appendChild(floors);
|
|
945
|
+
content.appendChild(coordinate);
|
|
946
|
+
|
|
947
|
+
content.addEventListener(
|
|
948
|
+
'click',
|
|
949
|
+
function () {
|
|
950
|
+
map.switchBuilding(data.buildingId, function (building) {
|
|
951
|
+
visual.init(map.building.id, map.currentFloor);
|
|
952
|
+
});
|
|
953
|
+
},
|
|
954
|
+
false
|
|
955
|
+
);
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
function parseFloor(floor) {
|
|
959
|
+
return floor.code;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
function height(data) {
|
|
963
|
+
var contents = message.querySelector('.contents');
|
|
964
|
+
if (data.length > 2) {
|
|
965
|
+
contents.style.height = '200px';
|
|
966
|
+
} else {
|
|
967
|
+
contents.removeAttribute('style');
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
function remove() {
|
|
972
|
+
var layout = message.querySelector('.contents');
|
|
973
|
+
var contents = layout.querySelectorAll('content');
|
|
974
|
+
if (contents) {
|
|
975
|
+
for (var i = 0; i < contents.length; i++) {
|
|
976
|
+
layout.removeChild(contents[i]);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
// selected beeview image node
|
|
982
|
+
function selectedNodeKey(key, bearing, callback) {
|
|
983
|
+
if (key) {
|
|
984
|
+
beeviewElm.style.display = 'block';
|
|
985
|
+
switchElm.style.display = 'block';
|
|
986
|
+
// infoElm.style.display = 'block';
|
|
987
|
+
beeview.moveToKey(key).then(function (node) {
|
|
988
|
+
if (callback) {
|
|
989
|
+
callback(node);
|
|
990
|
+
}
|
|
991
|
+
});
|
|
992
|
+
if (bearing) {
|
|
993
|
+
beeview.setBearing(bearing);
|
|
994
|
+
}
|
|
995
|
+
beeview.resize();
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
function moveToKeyCallback(node) {
|
|
1000
|
+
var floor = node.floor.code || map.currentFloor;
|
|
1001
|
+
map.switchFloor(floor, function () {
|
|
1002
|
+
visual.init(map.building.id, floor, function () {
|
|
1003
|
+
visual.updatePointClicked([node.latLon.lon, node.latLon.lat]);
|
|
1004
|
+
});
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
function getBrowserParams() {
|
|
1009
|
+
var search = location.search;
|
|
1010
|
+
var params = search.substr(1).split('&');
|
|
1011
|
+
var qs = {};
|
|
1012
|
+
params.forEach(function (param) {
|
|
1013
|
+
var list = param.split('=');
|
|
1014
|
+
qs[list[0]] = list[1];
|
|
1015
|
+
});
|
|
1016
|
+
if (!!search) {
|
|
1017
|
+
return qs;
|
|
1018
|
+
} else {
|
|
1019
|
+
return null;
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
</script>
|
|
1023
|
+
</body>
|
|
1024
|
+
|
|
1025
|
+
</html>
|
|
1026
|
+
|