@openglobus/og 0.18.0 → 0.18.1
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/README.md +8 -8
- package/lib/@openglobus/og.esm.js +2 -0
- package/lib/@openglobus/og.esm.js.map +1 -0
- package/lib/@openglobus/og.umd.js +2 -0
- package/lib/@openglobus/og.umd.js.map +1 -0
- package/lib/js/Clock.d.ts +106 -0
- package/{src/Clock.ts → lib/js/Clock.js} +31 -126
- package/lib/js/Deferred.d.ts +6 -0
- package/lib/js/Deferred.js +13 -0
- package/lib/js/Events.d.ts +90 -0
- package/{src/Events.ts → lib/js/Events.js} +29 -84
- package/lib/js/Extent.d.ts +145 -0
- package/{src/Extent.ts → lib/js/Extent.js} +74 -120
- package/lib/js/Globe.d.ts +132 -0
- package/{src/Globe.ts → lib/js/Globe.js} +61 -159
- package/lib/js/ImageCanvas.d.ts +128 -0
- package/{src/ImageCanvas.ts → lib/js/ImageCanvas.js} +24 -65
- package/lib/js/Lock.d.ts +15 -0
- package/{src/Lock.ts → lib/js/Lock.js} +7 -21
- package/lib/js/LonLat.d.ts +128 -0
- package/{src/LonLat.ts → lib/js/LonLat.js} +44 -75
- package/lib/js/Object3d.d.ts +49 -0
- package/{src/Object3d.ts → lib/js/Object3d.js} +64 -184
- package/lib/js/Popup.d.ts +46 -0
- package/{src/Popup.ts → lib/js/Popup.js} +42 -110
- package/lib/js/QueueArray.d.ts +16 -0
- package/{src/QueueArray.ts → lib/js/QueueArray.js} +12 -25
- package/lib/js/Rectangle.d.ts +76 -0
- package/{src/Rectangle.ts → lib/js/Rectangle.js} +12 -50
- package/lib/js/Stack.d.ts +20 -0
- package/{src/Stack.ts → lib/js/Stack.js} +13 -29
- package/lib/js/astro/astro.d.ts +39 -0
- package/{src/astro/astro.ts → lib/js/astro/astro.js} +2 -8
- package/lib/js/astro/earth.d.ts +8 -0
- package/{src/astro/earth.ts → lib/js/astro/earth.js} +3 -39
- package/lib/js/astro/jd.d.ts +234 -0
- package/{src/astro/jd.ts → lib/js/astro/jd.js} +55 -134
- package/lib/js/astro/orbit.d.ts +5 -0
- package/{src/astro/orbit.ts → lib/js/astro/orbit.js} +26 -39
- package/lib/js/astro/rotation.d.ts +2 -0
- package/{src/astro/rotation.ts → lib/js/astro/rotation.js} +2 -11
- package/lib/js/bv/Box.d.ts +32 -0
- package/{src/bv/Box.ts → lib/js/bv/Box.js} +7 -35
- package/lib/js/bv/Sphere.d.ts +37 -0
- package/{src/bv/Sphere.ts → lib/js/bv/Sphere.js} +6 -34
- package/{src/bv/index.ts → lib/js/bv/index.d.ts} +0 -1
- package/lib/js/bv/index.js +3 -0
- package/lib/js/camera/Camera.d.ts +314 -0
- package/{src/camera/Camera.ts → lib/js/camera/Camera.js} +77 -326
- package/lib/js/camera/Frustum.d.ts +139 -0
- package/{src/camera/Frustum.ts → lib/js/camera/Frustum.js} +66 -185
- package/lib/js/camera/PlanetCamera.d.ts +234 -0
- package/{src/camera/PlanetCamera.ts → lib/js/camera/PlanetCamera.js} +65 -338
- package/{src/camera/index.ts → lib/js/camera/index.d.ts} +0 -1
- package/lib/js/camera/index.js +3 -0
- package/lib/js/cons.d.ts +40 -0
- package/{src/cons.ts → lib/js/cons.js} +10 -22
- package/lib/js/control/Atmosphere.d.ts +16 -0
- package/{src/control/Atmosphere.ts → lib/js/control/Atmosphere.js} +33 -86
- package/lib/js/control/CompassButton.d.ts +16 -0
- package/{src/control/CompassButton.ts → lib/js/control/CompassButton.js} +18 -43
- package/lib/js/control/Control.d.ts +100 -0
- package/{src/control/Control.ts → lib/js/control/Control.js} +22 -89
- package/lib/js/control/DebugInfo.d.ts +25 -0
- package/{src/control/DebugInfo.ts → lib/js/control/DebugInfo.js} +38 -84
- package/lib/js/control/DrawingSwitcher.d.ts +13 -0
- package/{src/control/DrawingSwitcher.ts → lib/js/control/DrawingSwitcher.js} +13 -30
- package/lib/js/control/EarthCoordinates.d.ts +41 -0
- package/{src/control/EarthCoordinates.ts → lib/js/control/EarthCoordinates.js} +58 -119
- package/lib/js/control/EarthNavigation.d.ts +50 -0
- package/{src/control/EarthNavigation.ts → lib/js/control/EarthNavigation.js} +70 -161
- package/lib/js/control/GeoImageDragControl.d.ts +22 -0
- package/{src/control/GeoImageDragControl.ts → lib/js/control/GeoImageDragControl.js} +26 -49
- package/lib/js/control/KeyboardNavigation.d.ts +28 -0
- package/{src/control/KeyboardNavigation.ts → lib/js/control/KeyboardNavigation.js} +67 -92
- package/lib/js/control/LayerAnimation.d.ts +71 -0
- package/{src/control/LayerAnimation.ts → lib/js/control/LayerAnimation.js} +82 -162
- package/lib/js/control/LayerSwitcher.d.ts +21 -0
- package/{src/control/LayerSwitcher.ts → lib/js/control/LayerSwitcher.js} +16 -41
- package/lib/js/control/Lighting.d.ts +49 -0
- package/{src/control/Lighting.ts → lib/js/control/Lighting.js} +106 -219
- package/lib/js/control/MouseNavigation.d.ts +62 -0
- package/{src/control/MouseNavigation.ts → lib/js/control/MouseNavigation.js} +105 -211
- package/lib/js/control/MouseWheelZoomControl.d.ts +44 -0
- package/lib/js/control/MouseWheelZoomControl.js +181 -0
- package/lib/js/control/RulerSwitcher.d.ts +17 -0
- package/{src/control/RulerSwitcher.ts → lib/js/control/RulerSwitcher.js} +13 -28
- package/lib/js/control/ScaleControl.d.ts +24 -0
- package/lib/js/control/ScaleControl.js +91 -0
- package/lib/js/control/SegmentBoundVisualization.d.ts +12 -0
- package/lib/js/control/SegmentBoundVisualization.js +37 -0
- package/lib/js/control/ShowFps.d.ts +9 -0
- package/lib/js/control/ShowFps.js +20 -0
- package/lib/js/control/SimpleNavigation.d.ts +25 -0
- package/{src/control/SimpleNavigation.ts → lib/js/control/SimpleNavigation.js} +29 -51
- package/lib/js/control/SimpleSkyBackground.d.ts +15 -0
- package/{src/control/SimpleSkyBackground.ts → lib/js/control/SimpleSkyBackground.js} +21 -48
- package/lib/js/control/Sun.d.ts +33 -0
- package/{src/control/Sun.ts → lib/js/control/Sun.js} +34 -85
- package/lib/js/control/ToggleWireframe.d.ts +14 -0
- package/lib/js/control/ToggleWireframe.js +28 -0
- package/lib/js/control/TouchNavigation.d.ts +52 -0
- package/{src/control/TouchNavigation.ts → lib/js/control/TouchNavigation.js} +88 -193
- package/lib/js/control/ZoomControl.d.ts +27 -0
- package/{src/control/ZoomControl.ts → lib/js/control/ZoomControl.js} +25 -50
- package/lib/js/control/drawing/DrawingControl.d.ts +12 -0
- package/{src/control/drawing/DrawingControl.ts → lib/js/control/drawing/DrawingControl.js} +10 -20
- package/lib/js/control/drawing/LineStringDrawingScene.d.ts +15 -0
- package/{src/control/drawing/LineStringDrawingScene.ts → lib/js/control/drawing/LineStringDrawingScene.js} +28 -85
- package/lib/js/control/drawing/PolygonDrawingScene.d.ts +98 -0
- package/{src/control/drawing/PolygonDrawingScene.ts → lib/js/control/drawing/PolygonDrawingScene.js} +190 -388
- package/lib/js/control/elevationProfile/ElevationProfile.d.ts +61 -0
- package/{src/control/elevationProfile/ElevationProfile.ts → lib/js/control/elevationProfile/ElevationProfile.js} +56 -148
- package/lib/js/control/heightRuler/HeightRuler.d.ts +7 -0
- package/{src/control/heightRuler/HeightRuler.ts → lib/js/control/heightRuler/HeightRuler.js} +4 -9
- package/lib/js/control/heightRuler/HeightRulerScene.d.ts +35 -0
- package/{src/control/heightRuler/HeightRulerScene.ts → lib/js/control/heightRuler/HeightRulerScene.js} +47 -99
- package/lib/js/control/heightRuler/HeightRulerSwitcher.d.ts +6 -0
- package/{src/control/heightRuler/HeightRulerSwitcher.ts → lib/js/control/heightRuler/HeightRulerSwitcher.js} +2 -4
- package/{src/control/index.ts → lib/js/control/index.d.ts} +1 -18
- package/lib/js/control/index.js +28 -0
- package/lib/js/control/ruler/Ruler.d.ts +13 -0
- package/lib/js/control/ruler/Ruler.js +23 -0
- package/lib/js/control/ruler/RulerScene.d.ts +88 -0
- package/lib/js/control/ruler/RulerScene.js +324 -0
- package/lib/js/control/selection/Selection.d.ts +55 -0
- package/{src/control/selection/Selection.ts → lib/js/control/selection/Selection.js} +15 -34
- package/lib/js/control/selection/SelectionScene.d.ts +44 -0
- package/{src/control/selection/SelectionScene.ts → lib/js/control/selection/SelectionScene.js} +26 -113
- package/lib/js/control/timeline/TimelineControl.d.ts +18 -0
- package/{src/control/timeline/TimelineControl.ts → lib/js/control/timeline/TimelineControl.js} +13 -43
- package/lib/js/control/timeline/TimelineModel.d.ts +41 -0
- package/{src/control/timeline/TimelineModel.ts → lib/js/control/timeline/TimelineModel.js} +26 -74
- package/lib/js/control/timeline/TimelineView.d.ts +85 -0
- package/{src/control/timeline/TimelineView.ts → lib/js/control/timeline/TimelineView.js} +133 -281
- package/lib/js/control/timeline/timelineUtils.d.ts +12 -0
- package/lib/js/control/timeline/timelineUtils.js +112 -0
- package/lib/js/control/visibleExtent/Segment.d.ts +277 -0
- package/{src → lib/js}/control/visibleExtent/Segment.js +145 -698
- package/lib/js/control/visibleExtent/VisibleExtent.d.ts +5 -0
- package/{src → lib/js}/control/visibleExtent/VisibleExtent.js +1 -18
- package/lib/js/control/visibleExtent/drawnode.d.ts +7 -0
- package/{src/control/visibleExtent/drawnode.ts → lib/js/control/visibleExtent/drawnode.js} +1 -28
- package/lib/js/ellipsoid/Ellipsoid.d.ts +187 -0
- package/{src/ellipsoid/Ellipsoid.ts → lib/js/ellipsoid/Ellipsoid.js} +82 -267
- package/lib/js/ellipsoid/index.d.ts +3 -0
- package/lib/js/ellipsoid/index.js +3 -0
- package/lib/js/ellipsoid/wgs84.d.ts +6 -0
- package/{src/ellipsoid/wgs84.ts → lib/js/ellipsoid/wgs84.js} +1 -2
- package/lib/js/entity/BaseBillboard.d.ts +222 -0
- package/{src/entity/BaseBillboard.ts → lib/js/entity/BaseBillboard.js} +48 -165
- package/lib/js/entity/BaseBillboardHandler.d.ts +81 -0
- package/{src/entity/BaseBillboardHandler.ts → lib/js/entity/BaseBillboardHandler.js} +139 -365
- package/lib/js/entity/Billboard.d.ts +113 -0
- package/{src/entity/Billboard.ts → lib/js/entity/Billboard.js} +19 -83
- package/lib/js/entity/BillboardHandler.d.ts +15 -0
- package/{src/entity/BillboardHandler.ts → lib/js/entity/BillboardHandler.js} +27 -59
- package/lib/js/entity/Entity.d.ts +354 -0
- package/{src/entity/Entity.ts → lib/js/entity/Entity.js} +101 -373
- package/lib/js/entity/EntityCollection.d.ts +364 -0
- package/{src/entity/EntityCollection.ts → lib/js/entity/EntityCollection.js} +51 -353
- package/lib/js/entity/GeoObject.d.ts +138 -0
- package/{src/entity/GeoObject.ts → lib/js/entity/GeoObject.js} +41 -146
- package/lib/js/entity/GeoObjectHandler.d.ts +99 -0
- package/{src/entity/GeoObjectHandler.ts → lib/js/entity/GeoObjectHandler.js} +162 -423
- package/lib/js/entity/Geometry.d.ts +111 -0
- package/lib/js/entity/Geometry.js +283 -0
- package/lib/js/entity/GeometryHandler.d.ts +84 -0
- package/{src/entity/GeometryHandler.ts → lib/js/entity/GeometryHandler.js} +162 -657
- package/lib/js/entity/Label.d.ts +207 -0
- package/{src/entity/Label.ts → lib/js/entity/Label.js} +62 -164
- package/lib/js/entity/LabelHandler.d.ts +65 -0
- package/{src/entity/LabelHandler.ts → lib/js/entity/LabelHandler.js} +175 -408
- package/lib/js/entity/LabelWorker.d.ts +15 -0
- package/{src/entity/LabelWorker.ts → lib/js/entity/LabelWorker.js} +24 -45
- package/lib/js/entity/PointCloud.d.ts +179 -0
- package/{src/entity/PointCloud.ts → lib/js/entity/PointCloud.js} +65 -265
- package/lib/js/entity/PointCloudHandler.d.ts +42 -0
- package/{src/entity/PointCloudHandler.ts → lib/js/entity/PointCloudHandler.js} +19 -62
- package/lib/js/entity/Polyline.d.ts +337 -0
- package/{src/entity/Polyline.ts → lib/js/entity/Polyline.js} +289 -924
- package/lib/js/entity/PolylineHandler.d.ts +22 -0
- package/{src/entity/PolylineHandler.ts → lib/js/entity/PolylineHandler.js} +12 -37
- package/lib/js/entity/Ray.d.ts +133 -0
- package/{src/entity/Ray.ts → lib/js/entity/Ray.js} +26 -146
- package/lib/js/entity/RayHandler.d.ts +70 -0
- package/{src/entity/RayHandler.ts → lib/js/entity/RayHandler.js} +102 -342
- package/lib/js/entity/Strip.d.ts +127 -0
- package/{src/entity/Strip.ts → lib/js/entity/Strip.js} +102 -372
- package/lib/js/entity/StripHandler.d.ts +42 -0
- package/{src/entity/StripHandler.ts → lib/js/entity/StripHandler.js} +22 -74
- package/{src/entity/index.ts → lib/js/entity/index.d.ts} +1 -2
- package/lib/js/entity/index.js +11 -0
- package/lib/js/index.d.ts +33 -0
- package/lib/js/index.js +33 -0
- package/lib/js/input/KeyboardHandler.d.ts +33 -0
- package/{src/input/KeyboardHandler.ts → lib/js/input/KeyboardHandler.js} +45 -84
- package/lib/js/input/MouseHandler.d.ts +16 -0
- package/{src/input/MouseHandler.ts → lib/js/input/MouseHandler.js} +12 -36
- package/lib/js/input/TouchHandler.d.ts +11 -0
- package/{src/input/TouchHandler.ts → lib/js/input/TouchHandler.js} +11 -23
- package/lib/js/input/input.d.ts +3 -0
- package/{src/input/input.ts → lib/js/input/input.js} +1 -1
- package/lib/js/layer/BaseGeoImage.d.ts +145 -0
- package/{src/layer/BaseGeoImage.ts → lib/js/layer/BaseGeoImage.js} +70 -235
- package/lib/js/layer/CanvasTiles.d.ts +103 -0
- package/{src/layer/CanvasTiles.ts → lib/js/layer/CanvasTiles.js} +54 -146
- package/lib/js/layer/GeoImage.d.ts +61 -0
- package/{src/layer/GeoImage.ts → lib/js/layer/GeoImage.js} +24 -54
- package/lib/js/layer/GeoTexture2d.d.ts +17 -0
- package/lib/js/layer/GeoTexture2d.js +37 -0
- package/lib/js/layer/GeoVideo.d.ts +68 -0
- package/{src/layer/GeoVideo.ts → lib/js/layer/GeoVideo.js} +31 -61
- package/lib/js/layer/KML.d.ts +72 -0
- package/{src/layer/KML.ts → lib/js/layer/KML.js} +94 -138
- package/lib/js/layer/Layer.d.ts +401 -0
- package/{src/layer/Layer.ts → lib/js/layer/Layer.js} +92 -443
- package/lib/js/layer/Material.d.ts +34 -0
- package/{src/layer/Material.ts → lib/js/layer/Material.js} +9 -43
- package/lib/js/layer/Vector.d.ts +244 -0
- package/{src/layer/Vector.ts → lib/js/layer/Vector.js} +147 -418
- package/lib/js/layer/WMS.d.ts +75 -0
- package/{src/layer/WMS.ts → lib/js/layer/WMS.js} +18 -100
- package/lib/js/layer/XYZ.d.ts +149 -0
- package/{src/layer/XYZ.ts → lib/js/layer/XYZ.js} +71 -171
- package/lib/js/layer/index.d.ts +11 -0
- package/lib/js/layer/index.js +11 -0
- package/lib/js/light/LightSource.d.ts +174 -0
- package/{src/light/LightSource.ts → lib/js/light/LightSource.js} +22 -131
- package/lib/js/math/Line2.d.ts +11 -0
- package/{src/math/Line2.ts → lib/js/math/Line2.js} +5 -15
- package/lib/js/math/Line3.d.ts +28 -0
- package/lib/js/math/Line3.js +85 -0
- package/lib/js/math/Mat3.d.ts +77 -0
- package/{src/math/Mat3.ts → lib/js/math/Mat3.js} +22 -51
- package/lib/js/math/Mat4.d.ts +195 -0
- package/{src/math/Mat4.ts → lib/js/math/Mat4.js} +53 -219
- package/lib/js/math/Plane.d.ts +20 -0
- package/{src/math/Plane.ts → lib/js/math/Plane.js} +26 -40
- package/lib/js/math/Quat.d.ts +373 -0
- package/{src/math/Quat.ts → lib/js/math/Quat.js} +106 -319
- package/lib/js/math/Ray.d.ts +76 -0
- package/{src/math/Ray.ts → lib/js/math/Ray.js} +21 -66
- package/lib/js/math/Vec2.d.ts +310 -0
- package/{src/math/Vec2.ts → lib/js/math/Vec2.js} +55 -121
- package/lib/js/math/Vec3.d.ts +472 -0
- package/{src/math/Vec3.ts → lib/js/math/Vec3.js} +103 -236
- package/lib/js/math/Vec4.d.ts +163 -0
- package/{src/math/Vec4.ts → lib/js/math/Vec4.js} +23 -79
- package/lib/js/math/coder.d.ts +51 -0
- package/{src/math/coder.ts → lib/js/math/coder.js} +14 -20
- package/lib/js/math/index.d.ts +11 -0
- package/lib/js/math/index.js +11 -0
- package/lib/js/math.d.ts +266 -0
- package/{src/math.ts → lib/js/math.js} +37 -85
- package/lib/js/mercator.d.ts +92 -0
- package/{src/mercator.ts → lib/js/mercator.js} +13 -37
- package/lib/js/proj/EPSG3857.d.ts +9 -0
- package/{src/proj/EPSG3857.ts → lib/js/proj/EPSG3857.js} +0 -2
- package/lib/js/proj/EPSG4326.d.ts +9 -0
- package/{src/proj/EPSG4326.ts → lib/js/proj/EPSG4326.js} +0 -2
- package/lib/js/proj/Proj.d.ts +43 -0
- package/{src/proj/Proj.ts → lib/js/proj/Proj.js} +4 -29
- package/lib/js/quadTree/EPSG4326QuadTreeStrategy.d.ts +6 -0
- package/lib/js/quadTree/EPSG4326QuadTreeStrategy.js +17 -0
- package/lib/js/quadTree/EarthQuadTreeStrategy.d.ts +6 -0
- package/lib/js/quadTree/EarthQuadTreeStrategy.js +19 -0
- package/lib/js/quadTree/EntityCollectionNode.d.ts +54 -0
- package/{src/quadTree/EntityCollectionNode.ts → lib/js/quadTree/EntityCollectionNode.js} +83 -150
- package/lib/js/quadTree/MarsQuadTreeStrategy.d.ts +6 -0
- package/lib/js/quadTree/MarsQuadTreeStrategy.js +17 -0
- package/lib/js/quadTree/Node.d.ts +61 -0
- package/{src/quadTree/Node.ts → lib/js/quadTree/Node.js} +140 -357
- package/lib/js/quadTree/QuadTreeStrategy.d.ts +25 -0
- package/{src/quadTree/QuadTreeStrategy.ts → lib/js/quadTree/QuadTreeStrategy.js} +13 -44
- package/lib/js/quadTree/Wgs84QuadTreeStrategy.d.ts +6 -0
- package/lib/js/quadTree/Wgs84QuadTreeStrategy.js +15 -0
- package/lib/js/quadTree/index.d.ts +12 -0
- package/lib/js/quadTree/index.js +12 -0
- package/lib/js/quadTree/quadTree.d.ts +40 -0
- package/{src/quadTree/quadTree.ts → lib/js/quadTree/quadTree.js} +0 -9
- package/lib/js/renderer/Renderer.d.ts +311 -0
- package/{src/renderer/Renderer.ts → lib/js/renderer/Renderer.js} +169 -611
- package/lib/js/renderer/RendererEvents.d.ts +237 -0
- package/{src/renderer/RendererEvents.ts → lib/js/renderer/RendererEvents.js} +134 -471
- package/lib/js/scene/Axes.d.ts +12 -0
- package/lib/js/scene/Axes.js +59 -0
- package/lib/js/scene/BaseNode.d.ts +61 -0
- package/{src/scene/BaseNode.ts → lib/js/scene/BaseNode.js} +11 -57
- package/lib/js/scene/Planet.d.ts +623 -0
- package/{src/scene/Planet.ts → lib/js/scene/Planet.js} +251 -935
- package/lib/js/scene/RenderNode.d.ts +150 -0
- package/{src/scene/RenderNode.ts → lib/js/scene/RenderNode.js} +33 -138
- package/lib/js/scene/SkyBox.d.ts +13 -0
- package/{src/scene/SkyBox.ts → lib/js/scene/SkyBox.js} +16 -37
- package/{src/scene/index.ts → lib/js/scene/index.d.ts} +0 -1
- package/lib/js/scene/index.js +5 -0
- package/lib/js/segment/Segment.d.ts +278 -0
- package/{src/segment/Segment.ts → lib/js/segment/Segment.js} +242 -913
- package/lib/js/segment/SegmentLonLat.d.ts +48 -0
- package/{src/segment/SegmentLonLat.ts → lib/js/segment/SegmentLonLat.js} +58 -132
- package/lib/js/segment/SegmentLonLatWgs84.d.ts +10 -0
- package/lib/js/segment/SegmentLonLatWgs84.js +23 -0
- package/lib/js/segment/Slice.d.ts +13 -0
- package/{src/segment/Slice.ts → lib/js/segment/Slice.js} +4 -22
- package/lib/js/segment/segmentHelper.d.ts +18 -0
- package/{src/segment/segmentHelper.ts → lib/js/segment/segmentHelper.js} +30 -88
- package/lib/js/shaders/atmos.d.ts +4 -0
- package/{src/shaders/atmos.ts → lib/js/shaders/atmos.js} +8 -26
- package/lib/js/shaders/billboard.d.ts +3 -0
- package/{src/shaders/billboard.ts → lib/js/shaders/billboard.js} +9 -18
- package/lib/js/shaders/bloom.d.ts +2 -0
- package/{src/shaders/bloom.ts → lib/js/shaders/bloom.js} +5 -8
- package/lib/js/shaders/blur.d.ts +3 -0
- package/{src/shaders/blur.ts → lib/js/shaders/blur.js} +11 -19
- package/lib/js/shaders/depth.d.ts +2 -0
- package/{src/shaders/depth.ts → lib/js/shaders/depth.js} +3 -6
- package/lib/js/shaders/drawnode.d.ts +8 -0
- package/{src/shaders/drawnode.ts → lib/js/shaders/drawnode.js} +23 -75
- package/lib/js/shaders/geoObject.d.ts +3 -0
- package/{src/shaders/geoObject.ts → lib/js/shaders/geoObject.js} +51 -63
- package/lib/js/shaders/label.d.ts +4 -0
- package/{src/shaders/label.ts → lib/js/shaders/label.js} +12 -25
- package/lib/js/shaders/lumFilter.d.ts +2 -0
- package/{src/shaders/lumFilter.ts → lib/js/shaders/lumFilter.js} +4 -7
- package/lib/js/shaders/pickingMask.d.ts +2 -0
- package/{src/shaders/pickingMask.ts → lib/js/shaders/pickingMask.js} +5 -8
- package/lib/js/shaders/pointCloud.d.ts +2 -0
- package/{src/shaders/pointCloud.ts → lib/js/shaders/pointCloud.js} +4 -7
- package/lib/js/shaders/polyline.d.ts +3 -0
- package/{src/shaders/polyline.ts → lib/js/shaders/polyline.js} +7 -22
- package/lib/js/shaders/ray.d.ts +2 -0
- package/{src/shaders/ray.ts → lib/js/shaders/ray.js} +4 -7
- package/lib/js/shaders/screenFrame.d.ts +2 -0
- package/{src/shaders/screenFrame.ts → lib/js/shaders/screenFrame.js} +5 -8
- package/lib/js/shaders/skybox.d.ts +2 -0
- package/{src/shaders/skybox.ts → lib/js/shaders/skybox.js} +10 -13
- package/lib/js/shaders/toneMapping.d.ts +2 -0
- package/{src/shaders/toneMapping.ts → lib/js/shaders/toneMapping.js} +5 -8
- package/lib/js/shaders/utils.d.ts +1 -0
- package/{src/shaders/utils.ts → lib/js/shaders/utils.js} +1 -1
- package/lib/js/terrain/BilTerrain.d.ts +18 -0
- package/{src/terrain/BilTerrain.ts → lib/js/terrain/BilTerrain.js} +21 -118
- package/lib/js/terrain/EmptyTerrain.d.ts +106 -0
- package/{src/terrain/EmptyTerrain.ts → lib/js/terrain/EmptyTerrain.js} +20 -144
- package/lib/js/terrain/Geoid.d.ts +33 -0
- package/lib/js/terrain/Geoid.js +191 -0
- package/lib/js/terrain/GlobusTerrain.d.ts +134 -0
- package/{src/terrain/GlobusTerrain.ts → lib/js/terrain/GlobusTerrain.js} +82 -239
- package/lib/js/terrain/MapboxTerrain.d.ts +21 -0
- package/{src/terrain/MapboxTerrain.ts → lib/js/terrain/MapboxTerrain.js} +46 -215
- package/{src/terrain/index.ts → lib/js/terrain/index.d.ts} +0 -1
- package/lib/js/terrain/index.js +5 -0
- package/lib/js/ui/Button.d.ts +32 -0
- package/lib/js/ui/Button.js +78 -0
- package/lib/js/ui/ButtonGroup.d.ts +16 -0
- package/lib/js/ui/ButtonGroup.js +41 -0
- package/lib/js/ui/Dialog.d.ts +55 -0
- package/lib/js/ui/Dialog.js +173 -0
- package/lib/js/ui/Slider.d.ts +38 -0
- package/lib/js/ui/Slider.js +129 -0
- package/lib/js/ui/ToggleButton.d.ts +20 -0
- package/lib/js/ui/ToggleButton.js +42 -0
- package/lib/js/ui/View.d.ts +37 -0
- package/{src/ui/View.ts → lib/js/ui/View.js} +31 -77
- package/lib/js/ui/icons.d.ts +1 -0
- package/{src/ui/icons.ts → lib/js/ui/icons.js} +1 -1
- package/lib/js/utils/BaseWorker.d.ts +14 -0
- package/{src/utils/BaseWorker.ts → lib/js/utils/BaseWorker.js} +15 -28
- package/lib/js/utils/FontAtlas.d.ts +82 -0
- package/{src/utils/FontAtlas.ts → lib/js/utils/FontAtlas.js} +45 -181
- package/lib/js/utils/GeoImageCreator.d.ts +34 -0
- package/{src/utils/GeoImageCreator.ts → lib/js/utils/GeoImageCreator.js} +34 -91
- package/lib/js/utils/ImagesCacheManager.d.ts +22 -0
- package/{src/utils/ImagesCacheManager.ts → lib/js/utils/ImagesCacheManager.js} +16 -38
- package/lib/js/utils/Loader.d.ts +63 -0
- package/lib/js/utils/Loader.js +156 -0
- package/lib/js/utils/NormalMapCreator.d.ts +52 -0
- package/{src/utils/NormalMapCreator.ts → lib/js/utils/NormalMapCreator.js} +64 -195
- package/lib/js/utils/PlainSegmentWorker.d.ts +24 -0
- package/{src/utils/PlainSegmentWorker.ts → lib/js/utils/PlainSegmentWorker.js} +24 -56
- package/lib/js/utils/TerrainWorker.d.ts +28 -0
- package/{src/utils/TerrainWorker.ts → lib/js/utils/TerrainWorker.js} +19 -56
- package/lib/js/utils/TextureAtlas.d.ts +113 -0
- package/{src/utils/TextureAtlas.ts → lib/js/utils/TextureAtlas.js} +40 -131
- package/lib/js/utils/VectorTileCreator.d.ts +18 -0
- package/{src/utils/VectorTileCreator.ts → lib/js/utils/VectorTileCreator.js} +61 -147
- package/lib/js/utils/colorTable.d.ts +3 -0
- package/{src/utils/colorTable.ts → lib/js/utils/colorTable.js} +2 -2
- package/lib/js/utils/earcut.d.ts +7 -0
- package/{src/utils/earcut.ts → lib/js/utils/earcut.js} +95 -223
- package/lib/js/utils/objParser.d.ts +24 -0
- package/{src/utils/objParser.ts → lib/js/utils/objParser.js} +38 -93
- package/lib/js/utils/shared.d.ts +267 -0
- package/{src/utils/shared.ts → lib/js/utils/shared.js} +184 -341
- package/lib/js/utils/units.d.ts +16 -0
- package/lib/js/utils/units.js +61 -0
- package/lib/js/webgl/BaseFramebuffer.d.ts +53 -0
- package/{src/webgl/BaseFramebuffer.ts → lib/js/webgl/BaseFramebuffer.js} +22 -59
- package/lib/js/webgl/Framebuffer.d.ts +69 -0
- package/{src/webgl/Framebuffer.ts → lib/js/webgl/Framebuffer.js} +30 -87
- package/lib/js/webgl/Handler.d.ts +473 -0
- package/{src/webgl/Handler.ts → lib/js/webgl/Handler.js} +175 -586
- package/lib/js/webgl/Multisample.d.ts +27 -0
- package/lib/js/webgl/Multisample.js +77 -0
- package/lib/js/webgl/Program.d.ts +159 -0
- package/{src/webgl/Program.ts → lib/js/webgl/Program.js} +73 -210
- package/lib/js/webgl/ProgramController.d.ts +86 -0
- package/{src/webgl/ProgramController.ts → lib/js/webgl/ProgramController.js} +11 -45
- package/{src/webgl/index.ts → lib/js/webgl/index.d.ts} +1 -8
- package/lib/js/webgl/index.js +6 -0
- package/lib/js/webgl/types.d.ts +9 -0
- package/{src/webgl/types.ts → lib/js/webgl/types.js} +5 -8
- package/lib/js/webgl/variableHandlers.d.ts +22 -0
- package/lib/js/webgl/variableHandlers.js +78 -0
- package/package.json +23 -34
- package/dist/@openglobus/og.esm.js +0 -2
- package/dist/@openglobus/og.esm.js.map +0 -1
- package/dist/@openglobus/og.umd.js +0 -2
- package/dist/@openglobus/og.umd.js.map +0 -1
- package/src/Deferred.ts +0 -17
- package/src/control/MouseWheelZoomControl.ts +0 -269
- package/src/control/ScaleControl.ts +0 -131
- package/src/control/SegmentBoundVisualization.ts +0 -50
- package/src/control/ShowFps.ts +0 -28
- package/src/control/ToggleWireframe.ts +0 -35
- package/src/control/ruler/Ruler.ts +0 -35
- package/src/control/ruler/RulerScene.ts +0 -437
- package/src/control/timeline/timelineUtils.ts +0 -133
- package/src/ellipsoid/index.ts +0 -4
- package/src/entity/Geometry.ts +0 -486
- package/src/index.ts +0 -173
- package/src/layer/GeoTexture2d.ts +0 -56
- package/src/layer/index.ts +0 -12
- package/src/math/Line3.ts +0 -162
- package/src/math/index.ts +0 -26
- package/src/quadTree/EPSG4326QuadTreeStrategy.ts +0 -24
- package/src/quadTree/EarthQuadTreeStrategy.ts +0 -28
- package/src/quadTree/MarsQuadTreeStrategy.ts +0 -25
- package/src/quadTree/Wgs84QuadTreeStrategy.ts +0 -22
- package/src/quadTree/index.ts +0 -14
- package/src/scene/Axes.ts +0 -78
- package/src/segment/SegmentLonLatWgs84.ts +0 -33
- package/src/terrain/Geoid.ts +0 -273
- package/src/ui/Button.ts +0 -121
- package/src/ui/ButtonGroup.ts +0 -63
- package/src/ui/Dialog.ts +0 -244
- package/src/ui/Slider.ts +0 -188
- package/src/ui/ToggleButton.ts +0 -68
- package/src/utils/Loader.ts +0 -247
- package/src/utils/units.ts +0 -78
- package/src/webgl/Multisample.ts +0 -153
- package/src/webgl/variableHandlers.ts +0 -114
- /package/{dist → lib}/@openglobus/og.css +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Bold.json +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Bold.ttf.cfg +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Bold.ttf.png +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Light.json +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Light.ttf.cfg +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Light.ttf.png +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Medium.json +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Medium.ttf.cfg +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Medium.ttf.png +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/NotoSansArabic-Regular.json +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/NotoSansArabic-Regular.ttf.cfg +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/NotoSansArabic-Regular.ttf.png +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Roboto-Regular.json +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Roboto-Regular.ttf.cfg +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Roboto-Regular.ttf.png +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/arial.js +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/arial.json +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/arial.ttf.cfg +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/arial.ttf.png +0 -0
- /package/{dist → lib}/@openglobus/res/night-4326.png +0 -0
- /package/{dist → lib}/@openglobus/res/night.png +0 -0
- /package/{dist → lib}/@openglobus/res/spec.png +0 -0
|
@@ -1,58 +1,32 @@
|
|
|
1
|
-
import {nextHighestPowerOfTwo} from "../math";
|
|
2
|
-
import {BaseGeoImage
|
|
3
|
-
import {isImageLoaded} from "../utils/shared";
|
|
4
|
-
import {Material} from "./Material";
|
|
5
|
-
|
|
6
|
-
interface IGeoImageParams extends IBaseGeoImageParams {
|
|
7
|
-
image?: HTMLImageElement | HTMLCanvasElement | ImageBitmap;
|
|
8
|
-
src?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
1
|
+
import { nextHighestPowerOfTwo } from "../math";
|
|
2
|
+
import { BaseGeoImage } from "./BaseGeoImage";
|
|
3
|
+
import { isImageLoaded } from "../utils/shared";
|
|
11
4
|
/**
|
|
12
5
|
* Used to load and display a single image over specific corner coordinates on the globe.
|
|
13
6
|
* @class
|
|
14
7
|
* @extends {BaseGeoImage}
|
|
15
8
|
*/
|
|
16
9
|
class GeoImage extends BaseGeoImage {
|
|
17
|
-
|
|
18
|
-
* Image object.
|
|
19
|
-
* @protected
|
|
20
|
-
* @type {HTMLImageElement | HTMLCanvasElement | ImageBitmap}
|
|
21
|
-
*/
|
|
22
|
-
protected _image: HTMLImageElement | HTMLCanvasElement | ImageBitmap | null;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Image source url path.
|
|
26
|
-
* @protected
|
|
27
|
-
* @type {string}
|
|
28
|
-
*/
|
|
29
|
-
protected _src: string | null;
|
|
30
|
-
|
|
31
|
-
protected _onLoad_: ((this: HTMLImageElement, ev: Event) => void) | null;
|
|
32
|
-
|
|
33
|
-
constructor(name: string | null, options: IGeoImageParams = {}) {
|
|
10
|
+
constructor(name, options = {}) {
|
|
34
11
|
super(name, options);
|
|
35
12
|
this._image = options.image || null;
|
|
36
13
|
this._src = options.src || null;
|
|
37
14
|
this._onLoad_ = null;
|
|
38
15
|
}
|
|
39
|
-
|
|
40
|
-
public override get instanceName(): string {
|
|
16
|
+
get instanceName() {
|
|
41
17
|
return "GeoImage";
|
|
42
18
|
}
|
|
43
|
-
|
|
44
|
-
public override abortLoading() {
|
|
19
|
+
abortLoading() {
|
|
45
20
|
if (this._image instanceof HTMLImageElement) {
|
|
46
21
|
this._image.src = "";
|
|
47
22
|
}
|
|
48
23
|
}
|
|
49
|
-
|
|
50
24
|
/**
|
|
51
25
|
* Sets image source url path.
|
|
52
26
|
* @public
|
|
53
27
|
* @param {string} srs - Image url path.
|
|
54
28
|
*/
|
|
55
|
-
|
|
29
|
+
setSrc(src) {
|
|
56
30
|
this._planet && this._planet._geoImageCreator.remove(this);
|
|
57
31
|
this._src = src;
|
|
58
32
|
this._sourceReady = false;
|
|
@@ -62,13 +36,12 @@ class GeoImage extends BaseGeoImage {
|
|
|
62
36
|
this._image.addEventListener("load", this._onLoad_);
|
|
63
37
|
this._image.src = src;
|
|
64
38
|
}
|
|
65
|
-
|
|
66
39
|
/**
|
|
67
40
|
* Sets image object.
|
|
68
41
|
* @public
|
|
69
42
|
* @param {Image} image - Image object.
|
|
70
43
|
*/
|
|
71
|
-
|
|
44
|
+
setImage(image) {
|
|
72
45
|
this._planet && this._planet._geoImageCreator.remove(this);
|
|
73
46
|
this._sourceCreated = false;
|
|
74
47
|
this._sourceReady = false;
|
|
@@ -76,33 +49,31 @@ class GeoImage extends BaseGeoImage {
|
|
|
76
49
|
this._src = image.src;
|
|
77
50
|
if (isImageLoaded(this._image)) {
|
|
78
51
|
this._applyImage(this._image);
|
|
79
|
-
}
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
80
54
|
this._onLoad_ = this._onLoad.bind(this);
|
|
81
55
|
this._image.addEventListener("load", this._onLoad_);
|
|
82
56
|
}
|
|
83
57
|
}
|
|
84
|
-
|
|
85
58
|
/**
|
|
86
59
|
* Creates source gl texture.
|
|
87
60
|
* @virtual
|
|
88
61
|
* @protected
|
|
89
62
|
*/
|
|
90
|
-
|
|
63
|
+
_createSourceTexture() {
|
|
91
64
|
if (!this._sourceCreated && this._image) {
|
|
92
|
-
this._sourceTexture = this._planet
|
|
65
|
+
this._sourceTexture = this._planet.renderer.handler.createTexture_l(this._image);
|
|
93
66
|
this._sourceCreated = true;
|
|
94
67
|
}
|
|
95
68
|
}
|
|
96
|
-
|
|
97
|
-
protected _onLoad(ev: Event) {
|
|
69
|
+
_onLoad(ev) {
|
|
98
70
|
this._applyImage(this._image);
|
|
99
71
|
if (this._image instanceof HTMLImageElement) {
|
|
100
|
-
this._image.removeEventListener("load", this._onLoad_
|
|
72
|
+
this._image.removeEventListener("load", this._onLoad_);
|
|
101
73
|
}
|
|
102
74
|
this._onLoad_ = null;
|
|
103
75
|
}
|
|
104
|
-
|
|
105
|
-
protected _applyImage(img: HTMLImageElement | HTMLCanvasElement | ImageBitmap | null) {
|
|
76
|
+
_applyImage(img) {
|
|
106
77
|
if (img) {
|
|
107
78
|
this._frameWidth = nextHighestPowerOfTwo(img.width * 2, 4096);
|
|
108
79
|
this._frameHeight = nextHighestPowerOfTwo(img.height * 3, 4096);
|
|
@@ -112,14 +83,12 @@ class GeoImage extends BaseGeoImage {
|
|
|
112
83
|
}
|
|
113
84
|
}
|
|
114
85
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
86
|
/**
|
|
118
87
|
* Loads planet segment material. In this case - GeoImage source image.
|
|
119
88
|
* @public
|
|
120
89
|
* @param {Material} material - GeoImage planet material.
|
|
121
90
|
*/
|
|
122
|
-
|
|
91
|
+
loadMaterial(material) {
|
|
123
92
|
material.isLoading = true;
|
|
124
93
|
this._creationProceeding = true;
|
|
125
94
|
if (!this._sourceReady && this._src) {
|
|
@@ -127,27 +96,29 @@ class GeoImage extends BaseGeoImage {
|
|
|
127
96
|
if (this._image instanceof HTMLImageElement) {
|
|
128
97
|
if (isImageLoaded(this._image)) {
|
|
129
98
|
this._applyImage(this._image);
|
|
130
|
-
}
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
131
101
|
this._onLoad_ = this._onLoad.bind(this);
|
|
132
102
|
this._image.addEventListener("load", this._onLoad_);
|
|
133
103
|
}
|
|
134
104
|
}
|
|
135
|
-
}
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
136
107
|
this._image = new Image();
|
|
137
108
|
this._onLoad_ = this._onLoad.bind(this);
|
|
138
109
|
this._image.addEventListener("load", this._onLoad_);
|
|
139
110
|
this._image.src = this._src;
|
|
140
111
|
}
|
|
141
|
-
}
|
|
112
|
+
}
|
|
113
|
+
else if (this._planet) {
|
|
142
114
|
this._planet._geoImageCreator.add(this);
|
|
143
115
|
}
|
|
144
116
|
}
|
|
145
|
-
|
|
146
117
|
/**
|
|
147
118
|
* @public
|
|
148
119
|
* @param {Material} material - GeoImage material.
|
|
149
120
|
*/
|
|
150
|
-
|
|
121
|
+
abortMaterialLoading(material) {
|
|
151
122
|
if (this._image && this._image instanceof HTMLImageElement) {
|
|
152
123
|
this._image.src = "";
|
|
153
124
|
}
|
|
@@ -156,5 +127,4 @@ class GeoImage extends BaseGeoImage {
|
|
|
156
127
|
material.isReady = false;
|
|
157
128
|
}
|
|
158
129
|
}
|
|
159
|
-
|
|
160
|
-
export {GeoImage};
|
|
130
|
+
export { GeoImage };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseGeoImage, IBaseGeoImageParams } from './BaseGeoImage';
|
|
2
|
+
import { Material } from "../layer/Material";
|
|
3
|
+
import { WebGLTextureExt } from "../webgl/Handler";
|
|
4
|
+
interface IGeoTexture2dParams extends IBaseGeoImageParams {
|
|
5
|
+
texture?: WebGLTextureExt;
|
|
6
|
+
frameWidth?: number;
|
|
7
|
+
frameHeight?: number;
|
|
8
|
+
}
|
|
9
|
+
declare class GeoTexture2d extends BaseGeoImage {
|
|
10
|
+
constructor(name: string | null, options?: IGeoTexture2dParams);
|
|
11
|
+
get instanceName(): string;
|
|
12
|
+
loadMaterial(material: Material): void;
|
|
13
|
+
bindTexture(texture: WebGLTextureExt): void;
|
|
14
|
+
setSize(width: number, height: number): void;
|
|
15
|
+
abortMaterialLoading(material: Material): void;
|
|
16
|
+
}
|
|
17
|
+
export { GeoTexture2d };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BaseGeoImage } from './BaseGeoImage';
|
|
2
|
+
import { nextHighestPowerOfTwo } from '../math';
|
|
3
|
+
class GeoTexture2d extends BaseGeoImage {
|
|
4
|
+
constructor(name, options = {}) {
|
|
5
|
+
super(name, options);
|
|
6
|
+
this._sourceTexture = options.texture || null;
|
|
7
|
+
if (options.texture) {
|
|
8
|
+
this._sourceReady = true;
|
|
9
|
+
this._sourceCreated = true;
|
|
10
|
+
}
|
|
11
|
+
this._frameWidth = options.frameWidth != undefined ? nextHighestPowerOfTwo(options.frameWidth) : 256;
|
|
12
|
+
this._frameHeight = options.frameHeight != undefined ? nextHighestPowerOfTwo(options.frameHeight) : 256;
|
|
13
|
+
this._animate = true;
|
|
14
|
+
}
|
|
15
|
+
get instanceName() {
|
|
16
|
+
return "GeoTexture2d";
|
|
17
|
+
}
|
|
18
|
+
loadMaterial(material) {
|
|
19
|
+
this._planet._geoImageCreator.add(this);
|
|
20
|
+
}
|
|
21
|
+
bindTexture(texture) {
|
|
22
|
+
this._sourceReady = true;
|
|
23
|
+
this._sourceCreated = true;
|
|
24
|
+
this._sourceTexture = texture;
|
|
25
|
+
}
|
|
26
|
+
setSize(width, height) {
|
|
27
|
+
this._frameWidth = width;
|
|
28
|
+
this._frameHeight = height;
|
|
29
|
+
this._frameCreated = false;
|
|
30
|
+
}
|
|
31
|
+
abortMaterialLoading(material) {
|
|
32
|
+
this._creationProceeding = false;
|
|
33
|
+
material.isLoading = false;
|
|
34
|
+
material.isReady = false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export { GeoTexture2d };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { BaseGeoImage, IBaseGeoImageParams } from "./BaseGeoImage";
|
|
2
|
+
import { Material } from "./Material";
|
|
3
|
+
interface IGeoVideoParams extends IBaseGeoImageParams {
|
|
4
|
+
videoElement?: HTMLVideoElement;
|
|
5
|
+
src?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Used to load and display a video stream by specific corners coordinates on the globe.
|
|
9
|
+
* @class
|
|
10
|
+
* @extends {BaseGeoImage}
|
|
11
|
+
*/
|
|
12
|
+
declare class GeoVideo extends BaseGeoImage {
|
|
13
|
+
/**
|
|
14
|
+
* HTML5 video element object.
|
|
15
|
+
* @protected
|
|
16
|
+
* @type {HTMLVideoElement}
|
|
17
|
+
*/
|
|
18
|
+
protected _video: HTMLVideoElement | null;
|
|
19
|
+
/**
|
|
20
|
+
* Video source url path.
|
|
21
|
+
* @protected
|
|
22
|
+
* @type {string}
|
|
23
|
+
*/
|
|
24
|
+
protected _src: string | null;
|
|
25
|
+
constructor(name: string | null, options?: IGeoVideoParams);
|
|
26
|
+
get instanceName(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Sets video source url path.
|
|
29
|
+
* @public
|
|
30
|
+
* @param {string} src - Video url path.
|
|
31
|
+
*/
|
|
32
|
+
setSrc(src: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Sets HTML5 video object.
|
|
35
|
+
* @public
|
|
36
|
+
* @param {HTMLVideoElement} video - HTML5 video element object.
|
|
37
|
+
*/
|
|
38
|
+
setVideoElement(video: HTMLVideoElement): void;
|
|
39
|
+
/**
|
|
40
|
+
* Sets layer visibility.
|
|
41
|
+
* @public
|
|
42
|
+
* @param {boolean} visibility - Layer visibility.
|
|
43
|
+
*/
|
|
44
|
+
setVisibility(visibility: boolean): void;
|
|
45
|
+
/**
|
|
46
|
+
* Creates or refresh source video GL texture.
|
|
47
|
+
* @virtual
|
|
48
|
+
* @protected
|
|
49
|
+
*/
|
|
50
|
+
protected _createSourceTexture(): void;
|
|
51
|
+
/**
|
|
52
|
+
* @private
|
|
53
|
+
*/
|
|
54
|
+
protected _onCanPlay(video: HTMLVideoElement): void;
|
|
55
|
+
protected _onError(video: HTMLVideoElement): void;
|
|
56
|
+
/**
|
|
57
|
+
* Loads planet segment material. In this case - GeoImage source video.
|
|
58
|
+
* @public
|
|
59
|
+
* @param {Material} material - GeoImage planet material.
|
|
60
|
+
*/
|
|
61
|
+
loadMaterial(material: Material): void;
|
|
62
|
+
/**
|
|
63
|
+
* @virtual
|
|
64
|
+
* @param {Material} material - GeoImage material.
|
|
65
|
+
*/
|
|
66
|
+
abortMaterialLoading(material: Material): void;
|
|
67
|
+
}
|
|
68
|
+
export { GeoVideo };
|
|
@@ -1,121 +1,91 @@
|
|
|
1
|
-
import {BaseGeoImage
|
|
2
|
-
import {Material} from "./Material";
|
|
3
|
-
|
|
4
|
-
interface IGeoVideoParams extends IBaseGeoImageParams {
|
|
5
|
-
videoElement?: HTMLVideoElement;
|
|
6
|
-
src?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
1
|
+
import { BaseGeoImage } from "./BaseGeoImage";
|
|
9
2
|
/**
|
|
10
3
|
* Used to load and display a video stream by specific corners coordinates on the globe.
|
|
11
4
|
* @class
|
|
12
5
|
* @extends {BaseGeoImage}
|
|
13
6
|
*/
|
|
14
7
|
class GeoVideo extends BaseGeoImage {
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* HTML5 video element object.
|
|
18
|
-
* @protected
|
|
19
|
-
* @type {HTMLVideoElement}
|
|
20
|
-
*/
|
|
21
|
-
protected _video: HTMLVideoElement | null;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Video source url path.
|
|
25
|
-
* @protected
|
|
26
|
-
* @type {string}
|
|
27
|
-
*/
|
|
28
|
-
protected _src: string | null;
|
|
29
|
-
|
|
30
|
-
constructor(name: string | null, options: IGeoVideoParams = {}) {
|
|
8
|
+
constructor(name, options = {}) {
|
|
31
9
|
super(name, options);
|
|
32
|
-
|
|
33
10
|
this._animate = true;
|
|
34
|
-
|
|
35
11
|
this._video = options.videoElement || null;
|
|
36
|
-
|
|
37
12
|
this._src = options.src || null;
|
|
38
13
|
}
|
|
39
|
-
|
|
40
|
-
public override get instanceName(): string {
|
|
14
|
+
get instanceName() {
|
|
41
15
|
return "GeoVideo";
|
|
42
16
|
}
|
|
43
|
-
|
|
44
17
|
/**
|
|
45
18
|
* Sets video source url path.
|
|
46
19
|
* @public
|
|
47
20
|
* @param {string} src - Video url path.
|
|
48
21
|
*/
|
|
49
|
-
|
|
22
|
+
setSrc(src) {
|
|
50
23
|
this._planet && this._planet._geoImageCreator.remove(this);
|
|
51
24
|
this._src = src;
|
|
52
25
|
this._sourceReady = false;
|
|
53
26
|
}
|
|
54
|
-
|
|
55
27
|
/**
|
|
56
28
|
* Sets HTML5 video object.
|
|
57
29
|
* @public
|
|
58
30
|
* @param {HTMLVideoElement} video - HTML5 video element object.
|
|
59
31
|
*/
|
|
60
|
-
|
|
32
|
+
setVideoElement(video) {
|
|
61
33
|
this._planet && this._planet._geoImageCreator.remove(this);
|
|
62
34
|
this._video = video;
|
|
63
35
|
this._src = video.src;
|
|
64
36
|
this._sourceReady = false;
|
|
65
37
|
}
|
|
66
|
-
|
|
67
38
|
/**
|
|
68
39
|
* Sets layer visibility.
|
|
69
40
|
* @public
|
|
70
41
|
* @param {boolean} visibility - Layer visibility.
|
|
71
42
|
*/
|
|
72
|
-
|
|
43
|
+
setVisibility(visibility) {
|
|
73
44
|
if (visibility != this._visibility) {
|
|
74
45
|
super.setVisibility(visibility);
|
|
75
46
|
if (this._planet) {
|
|
76
47
|
if (visibility) {
|
|
77
48
|
this._sourceReady && this._planet._geoImageCreator.add(this);
|
|
78
49
|
this._video && this._video.play();
|
|
79
|
-
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
80
52
|
this._sourceReady && this._planet._geoImageCreator.remove(this);
|
|
81
53
|
this._video && this._video.pause();
|
|
82
54
|
}
|
|
83
55
|
}
|
|
84
56
|
}
|
|
85
57
|
}
|
|
86
|
-
|
|
87
58
|
/**
|
|
88
59
|
* Creates or refresh source video GL texture.
|
|
89
60
|
* @virtual
|
|
90
61
|
* @protected
|
|
91
62
|
*/
|
|
92
|
-
|
|
93
|
-
let gl = this._planet
|
|
63
|
+
_createSourceTexture() {
|
|
64
|
+
let gl = this._planet.renderer.handler.gl;
|
|
94
65
|
if (this._sourceCreated) {
|
|
95
|
-
gl.bindTexture(gl.TEXTURE_2D, this._sourceTexture
|
|
96
|
-
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._video
|
|
97
|
-
}
|
|
98
|
-
|
|
66
|
+
gl.bindTexture(gl.TEXTURE_2D, this._sourceTexture);
|
|
67
|
+
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._video);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
this._sourceTexture = this._planet.renderer.handler.createTexture_n_webgl1(this._video);
|
|
99
71
|
this._sourceCreated = true;
|
|
100
72
|
}
|
|
101
73
|
}
|
|
102
|
-
|
|
103
74
|
/**
|
|
104
75
|
* @private
|
|
105
76
|
*/
|
|
106
|
-
|
|
77
|
+
_onCanPlay(video) {
|
|
107
78
|
this._frameWidth = video.videoWidth;
|
|
108
79
|
this._frameHeight = video.videoHeight;
|
|
109
80
|
video.width = video.videoWidth;
|
|
110
81
|
video.height = video.videoHeight;
|
|
111
82
|
video.play();
|
|
112
83
|
this._sourceReady = true;
|
|
113
|
-
this._planet
|
|
84
|
+
this._planet._geoImageCreator.add(this);
|
|
114
85
|
}
|
|
115
|
-
|
|
116
|
-
protected _onError(video: HTMLVideoElement) {
|
|
86
|
+
_onError(video) {
|
|
117
87
|
let err = "unknown error";
|
|
118
|
-
switch (video.error
|
|
88
|
+
switch (video.error.code) {
|
|
119
89
|
case 1:
|
|
120
90
|
err = "video loading aborted";
|
|
121
91
|
break;
|
|
@@ -129,28 +99,29 @@ class GeoVideo extends BaseGeoImage {
|
|
|
129
99
|
err = "video not supported";
|
|
130
100
|
break;
|
|
131
101
|
}
|
|
132
|
-
console.warn(`Error: ${err} error-code=${video.error
|
|
102
|
+
console.warn(`Error: ${err} error-code=${video.error.code})`);
|
|
133
103
|
}
|
|
134
|
-
|
|
135
104
|
/**
|
|
136
105
|
* Loads planet segment material. In this case - GeoImage source video.
|
|
137
106
|
* @public
|
|
138
107
|
* @param {Material} material - GeoImage planet material.
|
|
139
108
|
*/
|
|
140
|
-
|
|
109
|
+
loadMaterial(material) {
|
|
141
110
|
material.isLoading = true;
|
|
142
111
|
this._creationProceeding = true;
|
|
143
112
|
if (!this._sourceReady && this._src) {
|
|
144
113
|
if (this._video) {
|
|
145
114
|
if (this._video.readyState === this._video.HAVE_ENOUGH_DATA) {
|
|
146
115
|
this._onCanPlay(this._video);
|
|
147
|
-
}
|
|
116
|
+
}
|
|
117
|
+
else if (this._video.src) {
|
|
148
118
|
let that = this;
|
|
149
|
-
this._video.addEventListener("canplay", function (e
|
|
119
|
+
this._video.addEventListener("canplay", function (e) {
|
|
150
120
|
that._onCanPlay(this);
|
|
151
121
|
});
|
|
152
122
|
}
|
|
153
|
-
}
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
154
125
|
this._video = document.createElement("video");
|
|
155
126
|
this._video.crossOrigin = "Anonymous";
|
|
156
127
|
let that = this;
|
|
@@ -167,21 +138,20 @@ class GeoVideo extends BaseGeoImage {
|
|
|
167
138
|
this._video.muted = true;
|
|
168
139
|
this._video.setAttribute("playsinline", "true");
|
|
169
140
|
this._video.setAttribute("webkit-playsinline", "true");
|
|
170
|
-
}
|
|
171
|
-
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
this._planet._geoImageCreator.add(this);
|
|
172
144
|
}
|
|
173
145
|
}
|
|
174
|
-
|
|
175
146
|
/**
|
|
176
147
|
* @virtual
|
|
177
148
|
* @param {Material} material - GeoImage material.
|
|
178
149
|
*/
|
|
179
|
-
|
|
150
|
+
abortMaterialLoading(material) {
|
|
180
151
|
this._video && (this._video.src = "");
|
|
181
152
|
this._creationProceeding = false;
|
|
182
153
|
material.isLoading = false;
|
|
183
154
|
material.isReady = false;
|
|
184
155
|
}
|
|
185
156
|
}
|
|
186
|
-
|
|
187
|
-
export {GeoVideo};
|
|
157
|
+
export { GeoVideo };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Billboard, IBillboardParams } from "../entity/Billboard";
|
|
2
|
+
import { Entity } from "../entity/Entity";
|
|
3
|
+
import { Extent } from "../Extent";
|
|
4
|
+
import { Vector, IVectorParams } from "./Vector";
|
|
5
|
+
interface IKMLParams extends IVectorParams {
|
|
6
|
+
color?: string;
|
|
7
|
+
billboard?: IBillboardParams;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Layer to render KMLs files
|
|
11
|
+
* @class
|
|
12
|
+
* @extends {Vector}
|
|
13
|
+
* @param {string} name
|
|
14
|
+
* @param {*} [options]
|
|
15
|
+
*/
|
|
16
|
+
export declare class KML extends Vector {
|
|
17
|
+
protected _color: string;
|
|
18
|
+
protected _billboard: IBillboardParams;
|
|
19
|
+
constructor(name: string, options?: IKMLParams);
|
|
20
|
+
get instanceName(): string;
|
|
21
|
+
protected _extractCoordonatesFromKml(xmlDoc: XMLDocument): number[][][];
|
|
22
|
+
protected _AGBRtoRGBA(agbr: string): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* @protected
|
|
25
|
+
returns array of longitude, latitude, altitude (altitude optional)
|
|
26
|
+
*/
|
|
27
|
+
protected _parseKMLcoordinates(coords: Element): number[][];
|
|
28
|
+
protected _kmlPlacemarkToEntity(placemark: Element | undefined | null, extent: Extent): Entity | undefined;
|
|
29
|
+
protected _extractStyle(placemark: Element): any;
|
|
30
|
+
protected _parseKML(xml: XMLDocument, extent: Extent, entities?: Entity[]): Entity[];
|
|
31
|
+
protected _convertKMLintoEntities(xml: XMLDocument): any;
|
|
32
|
+
/**
|
|
33
|
+
* Creates billboards or polylines from array of lonlat.
|
|
34
|
+
* @protected
|
|
35
|
+
* @param {Array} coordonates
|
|
36
|
+
* @param {string} color
|
|
37
|
+
* @returns {any}
|
|
38
|
+
*/
|
|
39
|
+
protected _convertCoordonatesIntoEntities(coordinates: number[][][][], color: string, billboard?: IBillboardParams): any;
|
|
40
|
+
/**
|
|
41
|
+
* @protected
|
|
42
|
+
* @returns {Document}
|
|
43
|
+
*/
|
|
44
|
+
protected _getXmlContent(file: Blob): Promise<XMLDocument>;
|
|
45
|
+
protected _expandExtents(extent1: Extent | null | undefined, extent2: Extent): Extent;
|
|
46
|
+
/**
|
|
47
|
+
* @public
|
|
48
|
+
* @param {File[]} kmls
|
|
49
|
+
* @param {string} [color]
|
|
50
|
+
* @param {Billboard} [billboard]
|
|
51
|
+
* @returns {Promise<{entities: Entity[], extent: Extent}>}
|
|
52
|
+
*/
|
|
53
|
+
addKmlFromFiles(kmls: Blob[], color?: string, billboard?: IBillboardParams): Promise<{
|
|
54
|
+
entities: any;
|
|
55
|
+
extent: any;
|
|
56
|
+
} | null>;
|
|
57
|
+
/**
|
|
58
|
+
* @param {string} color
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
setColor(color: string): void;
|
|
62
|
+
protected _getKmlFromUrl(url: string): Promise<Document>;
|
|
63
|
+
/**
|
|
64
|
+
* @public
|
|
65
|
+
* @param {string} url - Url of the KML to display. './myFile.kml' or 'http://mySite/myFile.kml' for example.
|
|
66
|
+
* @param {string} [color]
|
|
67
|
+
* @param {Billboard} [billboard]
|
|
68
|
+
* @returns {Promise<{entities: Entity[], extent: Extent}>}
|
|
69
|
+
*/
|
|
70
|
+
addKmlFromUrl(url: string, color?: string, billboard?: Billboard | IBillboardParams): Promise<any>;
|
|
71
|
+
}
|
|
72
|
+
export {};
|