@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,62 +1,32 @@
|
|
|
1
1
|
import * as math from "../math";
|
|
2
2
|
import * as mercator from "../mercator";
|
|
3
3
|
import * as quadTree from "../quadTree/quadTree";
|
|
4
|
-
import {Entity
|
|
5
|
-
import {EntityCollection} from "../entity/EntityCollection";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from "
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {GeometryHandler} from "../entity/GeometryHandler";
|
|
13
|
-
import {ILayerParams, Layer, LayerEventsList} from "./Layer";
|
|
14
|
-
import {NumberArray3, Vec3} from "../math/Vec3";
|
|
15
|
-
import {Node} from "../quadTree/Node";
|
|
16
|
-
import {Planet} from "../scene/Planet";
|
|
17
|
-
import {QueueArray} from "../QueueArray";
|
|
18
|
-
import {Material} from "./Material";
|
|
19
|
-
import {NumberArray4} from "../math/Vec4";
|
|
20
|
-
|
|
21
|
-
export interface IVectorParams extends ILayerParams {
|
|
22
|
-
entities?: Entity[] | IEntityParams[];
|
|
23
|
-
polygonOffsetUnits?: number;
|
|
24
|
-
nodeCapacity?: number;
|
|
25
|
-
relativeToGround?: boolean;
|
|
26
|
-
clampToGround?: boolean;
|
|
27
|
-
async?: boolean;
|
|
28
|
-
pickingScale?: number;
|
|
29
|
-
scaleByDistance?: NumberArray3;
|
|
30
|
-
labelMaxLetters?: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
type VectorEventsList = [
|
|
34
|
-
"entitymove",
|
|
35
|
-
"draw",
|
|
36
|
-
"entityadd",
|
|
37
|
-
"entityremove"
|
|
38
|
-
]
|
|
39
|
-
|
|
40
|
-
export type VectorEventsType = EventsHandler<VectorEventsList> & EventsHandler<LayerEventsList>;
|
|
41
|
-
|
|
4
|
+
import { Entity } from "../entity/Entity";
|
|
5
|
+
import { EntityCollection } from "../entity/EntityCollection";
|
|
6
|
+
import { EntityCollectionNode, EntityCollectionNodeWGS84 } from "../quadTree/EntityCollectionNode";
|
|
7
|
+
import { Extent } from "../Extent";
|
|
8
|
+
import { GeometryHandler } from "../entity/GeometryHandler";
|
|
9
|
+
import { Layer } from "./Layer";
|
|
10
|
+
import { Vec3 } from "../math/Vec3";
|
|
11
|
+
import { QueueArray } from "../QueueArray";
|
|
42
12
|
/**
|
|
43
13
|
* Creates entity instance array.
|
|
44
14
|
* @param {Entity[] | IEntityParams[]} entities - Entity array.
|
|
45
15
|
* @returns {Entity[]} - Entity array.
|
|
46
16
|
*/
|
|
47
|
-
function _entitiesConstructor(entities
|
|
48
|
-
let res
|
|
17
|
+
function _entitiesConstructor(entities) {
|
|
18
|
+
let res = [];
|
|
49
19
|
for (let i = 0; i < entities.length; i++) {
|
|
50
20
|
let ei = entities[i];
|
|
51
|
-
if (
|
|
52
|
-
res.push(ei
|
|
53
|
-
}
|
|
54
|
-
|
|
21
|
+
if (ei.instanceName === "Entity") {
|
|
22
|
+
res.push(ei);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
res.push(new Entity(ei));
|
|
55
26
|
}
|
|
56
27
|
}
|
|
57
28
|
return res;
|
|
58
29
|
}
|
|
59
|
-
|
|
60
30
|
/**
|
|
61
31
|
* Vector layer represents alternative entities store. Used for geospatial data rendering like
|
|
62
32
|
* points, lines, polygons, geometry objects etc.
|
|
@@ -90,208 +60,98 @@ function _entitiesConstructor(entities: Entity[] | IEntityParams[]): Entity[] {
|
|
|
90
60
|
* @fires EventsHandler<VectorEventsList>#visibilitychange
|
|
91
61
|
*/
|
|
92
62
|
class Vector extends Layer {
|
|
93
|
-
|
|
94
|
-
public override events: VectorEventsType;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Entities collection.
|
|
98
|
-
* @protected
|
|
99
|
-
*/
|
|
100
|
-
protected _entities: Entity[];
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* First index - near distance to the entity, after that entity becomes full scale.
|
|
104
|
-
* Second index - far distance to the entity, when entity becomes zero scale.
|
|
105
|
-
* Third index - far distance to the entity, when entity becomes invisible.
|
|
106
|
-
* @public
|
|
107
|
-
* @type {NumberArray3} - (exactly 3 entries)
|
|
108
|
-
*/
|
|
109
|
-
public scaleByDistance: NumberArray3;
|
|
110
|
-
|
|
111
|
-
public pickingScale: number;
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Asynchronous data handling before rendering.
|
|
115
|
-
* @public
|
|
116
|
-
* @type {boolean}
|
|
117
|
-
*/
|
|
118
|
-
public async: boolean;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Clamp vector data to the ground.
|
|
122
|
-
* @public
|
|
123
|
-
* @type {boolean}
|
|
124
|
-
*/
|
|
125
|
-
public clampToGround: boolean;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Sets vector data relative to the ground relief.
|
|
129
|
-
* @public
|
|
130
|
-
* @type {boolean}
|
|
131
|
-
*/
|
|
132
|
-
public relativeToGround: boolean;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
protected _stripEntityCollection: EntityCollection;
|
|
136
|
-
protected _polylineEntityCollection: EntityCollection;
|
|
137
|
-
protected _geoObjectEntityCollection: EntityCollection;
|
|
138
|
-
public _geometryHandler: GeometryHandler;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Maximum entities quantity in the tree node.
|
|
142
|
-
* @public
|
|
143
|
-
*/
|
|
144
|
-
public _nodeCapacity: number;
|
|
145
|
-
|
|
146
|
-
protected _entityCollectionsTree: EntityCollectionNode | null;
|
|
147
|
-
protected _entityCollectionsTreeNorth: EntityCollectionNodeWGS84 | null;
|
|
148
|
-
protected _entityCollectionsTreeSouth: EntityCollectionNodeWGS84 | null;
|
|
149
|
-
|
|
150
|
-
public _renderingNodes: Record<number, boolean>;
|
|
151
|
-
public _renderingNodesNorth: Record<number, boolean>;
|
|
152
|
-
public _renderingNodesSouth: Record<number, boolean>;
|
|
153
|
-
|
|
154
|
-
protected _counter: number;
|
|
155
|
-
protected _deferredEntitiesPendingQueue: QueueArray<EntityCollectionNode>;
|
|
156
|
-
|
|
157
|
-
protected _pendingsQueue: Entity[];
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Specifies the scale Units for gl.polygonOffset function to calculate depth values, 0.0 is default.
|
|
161
|
-
* @public
|
|
162
|
-
* @type {Number}
|
|
163
|
-
*/
|
|
164
|
-
public polygonOffsetUnits: number;
|
|
165
|
-
|
|
166
|
-
public _secondPASS: EntityCollectionNode[];
|
|
167
|
-
|
|
168
|
-
protected _labelMaxLetters: number;
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
constructor(name?: string | null, options: IVectorParams = {}) {
|
|
63
|
+
constructor(name, options = {}) {
|
|
172
64
|
super(name, options);
|
|
173
|
-
|
|
174
65
|
// @ts-ignore
|
|
175
66
|
this.events = this.events.registerNames(VECTOR_EVENTS);
|
|
176
|
-
|
|
177
67
|
this.isVector = true;
|
|
178
|
-
|
|
179
68
|
this._hasImageryTiles = false;
|
|
180
|
-
|
|
181
69
|
this.scaleByDistance = options.scaleByDistance || [math.MAX32, math.MAX32, math.MAX32];
|
|
182
|
-
|
|
183
70
|
this.pickingScale = options.pickingScale || 1;
|
|
184
|
-
|
|
185
71
|
this.async = options.async !== undefined ? options.async : true;
|
|
186
|
-
|
|
187
72
|
this.clampToGround = options.clampToGround || false;
|
|
188
|
-
|
|
189
73
|
this.relativeToGround = options.relativeToGround || false;
|
|
190
|
-
|
|
191
74
|
this._nodeCapacity = options.nodeCapacity || 30;
|
|
192
|
-
|
|
193
75
|
this._entities = _entitiesConstructor(options.entities || []);
|
|
194
|
-
|
|
195
76
|
this._labelMaxLetters = options.labelMaxLetters || 24;
|
|
196
|
-
|
|
197
77
|
this._stripEntityCollection = new EntityCollection({
|
|
198
78
|
pickingEnabled: this.pickingEnabled
|
|
199
79
|
});
|
|
200
80
|
this._bindEventsDefault(this._stripEntityCollection);
|
|
201
|
-
|
|
202
81
|
this._polylineEntityCollection = new EntityCollection({
|
|
203
82
|
pickingEnabled: this.pickingEnabled
|
|
204
83
|
});
|
|
205
84
|
this._bindEventsDefault(this._polylineEntityCollection);
|
|
206
|
-
|
|
207
85
|
this._geoObjectEntityCollection = new EntityCollection({
|
|
208
86
|
pickingEnabled: this.pickingEnabled
|
|
209
87
|
});
|
|
210
88
|
this._bindEventsDefault(this._geoObjectEntityCollection);
|
|
211
|
-
|
|
212
89
|
this._geometryHandler = new GeometryHandler(this);
|
|
213
|
-
|
|
214
90
|
this._entityCollectionsTree = null;
|
|
215
91
|
this._entityCollectionsTreeNorth = null;
|
|
216
92
|
this._entityCollectionsTreeSouth = null;
|
|
217
|
-
|
|
218
93
|
this._renderingNodes = {};
|
|
219
94
|
this._renderingNodesNorth = {};
|
|
220
95
|
this._renderingNodesSouth = {};
|
|
221
|
-
|
|
222
96
|
this._counter = 0;
|
|
223
|
-
this._deferredEntitiesPendingQueue = new QueueArray
|
|
224
|
-
|
|
97
|
+
this._deferredEntitiesPendingQueue = new QueueArray();
|
|
225
98
|
this._pendingsQueue = [];
|
|
226
|
-
|
|
227
99
|
this.setEntities(this._entities);
|
|
228
|
-
|
|
229
100
|
this.polygonOffsetUnits = options.polygonOffsetUnits != undefined ? options.polygonOffsetUnits : 0.0;
|
|
230
|
-
|
|
231
101
|
this.pickingEnabled = this._pickingEnabled;
|
|
232
|
-
|
|
233
102
|
this._secondPASS = [];
|
|
234
103
|
}
|
|
235
|
-
|
|
236
|
-
public get labelMaxLetters(): number {
|
|
104
|
+
get labelMaxLetters() {
|
|
237
105
|
return this._labelMaxLetters;
|
|
238
106
|
}
|
|
239
|
-
|
|
240
|
-
public override get instanceName() {
|
|
107
|
+
get instanceName() {
|
|
241
108
|
return "Vector";
|
|
242
109
|
}
|
|
243
|
-
|
|
244
|
-
protected override _bindPicking() {
|
|
110
|
+
_bindPicking() {
|
|
245
111
|
this._pickingColor.clear();
|
|
246
112
|
}
|
|
247
|
-
|
|
248
113
|
/**
|
|
249
114
|
* Adds layer to the planet.
|
|
250
115
|
* @public
|
|
251
116
|
* @param {Planet} planet - Planet scene object.
|
|
252
117
|
* @returns {Vector} -
|
|
253
118
|
*/
|
|
254
|
-
|
|
119
|
+
addTo(planet) {
|
|
255
120
|
if (!this._planet) {
|
|
256
121
|
this._assignPlanet(planet);
|
|
257
|
-
this._geometryHandler.assignHandler(planet.renderer
|
|
122
|
+
this._geometryHandler.assignHandler(planet.renderer.handler);
|
|
258
123
|
this._polylineEntityCollection.addTo(planet, true);
|
|
259
124
|
this._stripEntityCollection.addTo(planet, true);
|
|
260
125
|
this._geoObjectEntityCollection.addTo(planet, true);
|
|
261
126
|
this.setEntities(this._entities);
|
|
262
127
|
}
|
|
263
128
|
}
|
|
264
|
-
|
|
265
|
-
public override remove(): this {
|
|
129
|
+
remove() {
|
|
266
130
|
super.remove();
|
|
267
131
|
this._polylineEntityCollection.remove();
|
|
268
132
|
this._stripEntityCollection.remove();
|
|
269
133
|
this._geoObjectEntityCollection.remove();
|
|
270
134
|
return this;
|
|
271
135
|
}
|
|
272
|
-
|
|
273
136
|
/**
|
|
274
137
|
* Returns stored entities.
|
|
275
138
|
* @public
|
|
276
139
|
* @returns {Array.<Entity>} -
|
|
277
140
|
*/
|
|
278
|
-
|
|
279
|
-
return
|
|
141
|
+
getEntities() {
|
|
142
|
+
return [].concat(this._entities);
|
|
280
143
|
}
|
|
281
|
-
|
|
282
144
|
//_fitExtent(entity) {
|
|
283
145
|
// var ee = entity.getExtent(),
|
|
284
146
|
// e = this._extent,
|
|
285
147
|
// maxLon = -180, maxLat = -90,
|
|
286
148
|
// minLon = 180, minLat = 90;
|
|
287
|
-
|
|
288
149
|
// if (this._entities.length !== 0) {
|
|
289
150
|
// maxLon = e.southWest.lon;
|
|
290
151
|
// minLon = e.northEast.lon;
|
|
291
152
|
// maxLat = e.northEast.lat;
|
|
292
153
|
// minLat = e.southWest.lat;
|
|
293
154
|
// }
|
|
294
|
-
|
|
295
155
|
// if (ee.southWest.lon < minLon) {
|
|
296
156
|
// e.southWest.lon = ee.southWest.lon;
|
|
297
157
|
// }
|
|
@@ -306,7 +166,6 @@ class Vector extends Layer {
|
|
|
306
166
|
// }
|
|
307
167
|
// this.setExtent(this._extent);
|
|
308
168
|
//}
|
|
309
|
-
|
|
310
169
|
/**
|
|
311
170
|
* Adds entity to the layer.
|
|
312
171
|
* @public
|
|
@@ -314,7 +173,7 @@ class Vector extends Layer {
|
|
|
314
173
|
* @param {boolean} [rightNow=false] - Entity insertion option. False is default.
|
|
315
174
|
* @returns {Vector} - Returns this layer.
|
|
316
175
|
*/
|
|
317
|
-
|
|
176
|
+
add(entity, rightNow = false) {
|
|
318
177
|
if (!(entity._layer || entity._entityCollection)) {
|
|
319
178
|
entity._layer = this;
|
|
320
179
|
entity._layerIndex = this._entities.length;
|
|
@@ -324,7 +183,6 @@ class Vector extends Layer {
|
|
|
324
183
|
}
|
|
325
184
|
return this;
|
|
326
185
|
}
|
|
327
|
-
|
|
328
186
|
/**
|
|
329
187
|
* Adds entity to the layer in the index position.
|
|
330
188
|
* @public
|
|
@@ -333,7 +191,7 @@ class Vector extends Layer {
|
|
|
333
191
|
* @param {boolean} [rightNow] - Entity insertion option. False is default.
|
|
334
192
|
* @returns {Vector} - Returns this layer.
|
|
335
193
|
*/
|
|
336
|
-
|
|
194
|
+
insert(entity, index, rightNow = false) {
|
|
337
195
|
if (!(entity._layer || entity._entityCollection)) {
|
|
338
196
|
entity._layer = this;
|
|
339
197
|
entity._layerIndex = index;
|
|
@@ -342,67 +200,56 @@ class Vector extends Layer {
|
|
|
342
200
|
for (let i = index + 1, len = this._entities.length; i < len; i++) {
|
|
343
201
|
this._entities[i]._layerIndex = i;
|
|
344
202
|
}
|
|
345
|
-
|
|
346
203
|
this._proceedEntity(entity, rightNow);
|
|
347
204
|
}
|
|
348
|
-
|
|
349
205
|
return this;
|
|
350
206
|
}
|
|
351
|
-
|
|
352
|
-
protected _proceedEntity(entity: Entity, rightNow: boolean = false) {
|
|
207
|
+
_proceedEntity(entity, rightNow = false) {
|
|
353
208
|
let temp = this._hasImageryTiles;
|
|
354
|
-
|
|
355
209
|
if (entity.strip) {
|
|
356
210
|
this._stripEntityCollection.add(entity);
|
|
357
211
|
}
|
|
358
|
-
|
|
359
212
|
if (entity.polyline || entity.ray) {
|
|
360
213
|
this._polylineEntityCollection.add(entity);
|
|
361
214
|
}
|
|
362
|
-
|
|
363
215
|
if (entity.geoObject) {
|
|
364
216
|
this._geoObjectEntityCollection.add(entity);
|
|
365
217
|
}
|
|
366
|
-
|
|
367
218
|
if (entity.geometry) {
|
|
368
219
|
this._hasImageryTiles = true;
|
|
369
220
|
if (this._planet) {
|
|
370
|
-
this._planet.renderer
|
|
221
|
+
this._planet.renderer.assignPickingColor(entity);
|
|
371
222
|
this._geometryHandler.add(entity.geometry);
|
|
372
223
|
}
|
|
373
224
|
}
|
|
374
|
-
|
|
375
225
|
if (entity.billboard || entity.label || entity.geoObject) {
|
|
376
226
|
if (this._planet) {
|
|
377
227
|
if (entity._cartesian.isZero() && !entity._lonLat.isZero()) {
|
|
378
|
-
entity._setCartesian3vSilent(
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
} else {
|
|
228
|
+
entity._setCartesian3vSilent(this._planet.ellipsoid.lonLatToCartesian(entity._lonLat));
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
382
231
|
entity._lonLat = this._planet.ellipsoid.cartesianToLonLat(entity._cartesian);
|
|
383
232
|
}
|
|
384
|
-
|
|
385
233
|
// north tree
|
|
386
234
|
if (entity._lonLat.lat > mercator.MAX_LAT) {
|
|
387
|
-
this._entityCollectionsTreeNorth
|
|
388
|
-
this._entityCollectionsTreeNorth
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
this._entityCollectionsTreeSouth
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
235
|
+
this._entityCollectionsTreeNorth.__setLonLat__(entity);
|
|
236
|
+
this._entityCollectionsTreeNorth.insertEntity(entity, rightNow);
|
|
237
|
+
}
|
|
238
|
+
else if (entity._lonLat.lat < mercator.MIN_LAT) {
|
|
239
|
+
this._entityCollectionsTreeSouth.__setLonLat__(entity);
|
|
240
|
+
this._entityCollectionsTreeSouth.insertEntity(entity, rightNow);
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
this._entityCollectionsTree.__setLonLat__(entity);
|
|
244
|
+
this._entityCollectionsTree.insertEntity(entity, rightNow);
|
|
395
245
|
}
|
|
396
246
|
}
|
|
397
247
|
}
|
|
398
|
-
|
|
399
248
|
if (this._planet && this._hasImageryTiles !== temp) {
|
|
400
249
|
this._planet.updateVisibleLayers();
|
|
401
250
|
}
|
|
402
|
-
|
|
403
251
|
this.events.dispatch(this.events.entityadd, entity);
|
|
404
252
|
}
|
|
405
|
-
|
|
406
253
|
/**
|
|
407
254
|
* Adds entity array to the layer.
|
|
408
255
|
* @public
|
|
@@ -410,14 +257,13 @@ class Vector extends Layer {
|
|
|
410
257
|
* @param {boolean} [rightNow=false] - Entity insertion option. False is default.
|
|
411
258
|
* @returns {Vector} - Returns this layer.
|
|
412
259
|
*/
|
|
413
|
-
|
|
260
|
+
addEntities(entities, rightNow = false) {
|
|
414
261
|
let i = entities.length;
|
|
415
262
|
while (i--) {
|
|
416
263
|
this.add(entities[i], rightNow);
|
|
417
264
|
}
|
|
418
265
|
return this;
|
|
419
266
|
}
|
|
420
|
-
|
|
421
267
|
/**
|
|
422
268
|
* Remove entity from layer.
|
|
423
269
|
* TODO: memory leaks.
|
|
@@ -425,40 +271,29 @@ class Vector extends Layer {
|
|
|
425
271
|
* @param {Entity} entity - Entity to remove.
|
|
426
272
|
* @returns {Vector} - Returns this layer.
|
|
427
273
|
*/
|
|
428
|
-
|
|
429
|
-
|
|
274
|
+
removeEntity(entity) {
|
|
430
275
|
if (entity._layer && this.isEqual(entity._layer)) {
|
|
431
|
-
|
|
432
276
|
this._entities.splice(entity._layerIndex, 1);
|
|
433
|
-
|
|
434
277
|
this._reindexEntitiesArray(entity._layerIndex);
|
|
435
|
-
|
|
436
278
|
entity._layer = null;
|
|
437
|
-
|
|
438
279
|
entity._layerIndex = -1;
|
|
439
|
-
|
|
440
280
|
if (entity._entityCollection) {
|
|
441
|
-
|
|
442
281
|
entity._entityCollection._removeEntitySilent(entity);
|
|
443
|
-
|
|
444
282
|
let node = entity._nodePtr;
|
|
445
|
-
|
|
446
283
|
while (node) {
|
|
447
284
|
node.count--;
|
|
448
|
-
node = node.parentNode
|
|
285
|
+
node = node.parentNode;
|
|
449
286
|
}
|
|
450
|
-
|
|
451
|
-
if (
|
|
452
|
-
entity._nodePtr &&
|
|
287
|
+
if (entity._nodePtr &&
|
|
453
288
|
entity._nodePtr.count === 0 &&
|
|
454
|
-
entity._nodePtr.deferredEntities.length === 0
|
|
455
|
-
) {
|
|
289
|
+
entity._nodePtr.deferredEntities.length === 0) {
|
|
456
290
|
entity._nodePtr.entityCollection = null;
|
|
457
291
|
//
|
|
458
292
|
// ...
|
|
459
293
|
//
|
|
460
294
|
}
|
|
461
|
-
}
|
|
295
|
+
}
|
|
296
|
+
else if (entity._nodePtr && entity._nodePtr.deferredEntities.length) {
|
|
462
297
|
let defEntities = entity._nodePtr.deferredEntities;
|
|
463
298
|
let j = defEntities.length;
|
|
464
299
|
while (j--) {
|
|
@@ -467,379 +302,306 @@ class Vector extends Layer {
|
|
|
467
302
|
let node = entity._nodePtr;
|
|
468
303
|
while (node) {
|
|
469
304
|
node.count--;
|
|
470
|
-
node = node.parentNode
|
|
305
|
+
node = node.parentNode;
|
|
471
306
|
}
|
|
472
307
|
break;
|
|
473
308
|
}
|
|
474
309
|
}
|
|
475
310
|
}
|
|
476
|
-
|
|
477
311
|
if (entity.geometry) {
|
|
478
312
|
if (this._planet) {
|
|
479
313
|
this._geometryHandler.remove(entity.geometry);
|
|
480
|
-
this._planet.renderer
|
|
314
|
+
this._planet.renderer.clearPickingColor(entity);
|
|
481
315
|
}
|
|
482
316
|
}
|
|
483
|
-
|
|
484
317
|
entity._nodePtr = undefined;
|
|
485
|
-
|
|
486
318
|
this.events.dispatch(this.events.entityremove, entity);
|
|
487
319
|
}
|
|
488
|
-
|
|
489
320
|
return this;
|
|
490
321
|
}
|
|
491
|
-
|
|
492
322
|
/**
|
|
493
323
|
* Set layer picking events active.
|
|
494
324
|
* @public
|
|
495
325
|
* @param {boolean} picking - Picking enable flag.
|
|
496
326
|
*/
|
|
497
|
-
|
|
498
|
-
|
|
327
|
+
set pickingEnabled(picking) {
|
|
499
328
|
this._pickingEnabled = picking;
|
|
500
|
-
|
|
501
329
|
this._stripEntityCollection.setPickingEnabled(picking);
|
|
502
|
-
|
|
503
330
|
this._polylineEntityCollection.setPickingEnabled(picking);
|
|
504
|
-
|
|
505
331
|
this._geoObjectEntityCollection.setPickingEnabled(picking);
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
node.entityCollection!.setPickingEnabled(picking);
|
|
332
|
+
this._entityCollectionsTree && this._entityCollectionsTree.traverseTree((node) => {
|
|
333
|
+
node.entityCollection.setPickingEnabled(picking);
|
|
509
334
|
});
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
node.entityCollection!.setPickingEnabled(picking);
|
|
335
|
+
this._entityCollectionsTreeNorth && this._entityCollectionsTreeNorth.traverseTree((node) => {
|
|
336
|
+
node.entityCollection.setPickingEnabled(picking);
|
|
513
337
|
});
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
node.entityCollection!.setPickingEnabled(picking);
|
|
338
|
+
this._entityCollectionsTreeSouth && this._entityCollectionsTreeSouth.traverseTree((node) => {
|
|
339
|
+
node.entityCollection.setPickingEnabled(picking);
|
|
517
340
|
});
|
|
518
341
|
}
|
|
519
|
-
|
|
520
342
|
/**
|
|
521
343
|
* Refresh collected entities indexes from startIndex entities collection array position.
|
|
522
344
|
* @protected
|
|
523
345
|
* @param {number} startIndex - Entity array index.
|
|
524
346
|
*/
|
|
525
|
-
|
|
347
|
+
_reindexEntitiesArray(startIndex) {
|
|
526
348
|
const e = this._entities;
|
|
527
349
|
for (let i = startIndex; i < e.length; i++) {
|
|
528
350
|
e[i]._layerIndex = i;
|
|
529
351
|
}
|
|
530
352
|
}
|
|
531
|
-
|
|
532
353
|
/**
|
|
533
354
|
* Removes entities from layer.
|
|
534
355
|
* @public
|
|
535
356
|
* @param {Array.<Entity>} entities - Entity array.
|
|
536
357
|
* @returns {Vector} - Returns this layer.
|
|
537
358
|
*/
|
|
538
|
-
|
|
359
|
+
removeEntities(entities) {
|
|
539
360
|
let i = entities.length;
|
|
540
361
|
while (i--) {
|
|
541
362
|
this.removeEntity(entities[i]);
|
|
542
363
|
}
|
|
543
364
|
return this;
|
|
544
365
|
}
|
|
545
|
-
|
|
546
366
|
// public setScaleByDistance(near, far, farInvisible) {
|
|
547
367
|
// this.scaleByDistance[0] = near;
|
|
548
368
|
// this.scaleByDistance[1] = far;
|
|
549
369
|
// this.scaleByDistance[2] = farInvisible || math.MAX32;
|
|
550
370
|
// }
|
|
551
|
-
|
|
552
371
|
/**
|
|
553
372
|
* TODO: Clear the layer.
|
|
554
373
|
* @public
|
|
555
374
|
*/
|
|
556
|
-
|
|
557
|
-
let temp
|
|
558
|
-
|
|
375
|
+
clear() {
|
|
376
|
+
let temp = new Array(this._entities.length);
|
|
559
377
|
for (let i = 0; i < temp.length; i++) {
|
|
560
378
|
temp[i] = this._entities[i];
|
|
561
379
|
}
|
|
562
|
-
|
|
563
380
|
let i = this._entities.length;
|
|
564
381
|
while (i--) {
|
|
565
382
|
this._entities[i].remove();
|
|
566
383
|
}
|
|
567
|
-
|
|
568
384
|
this._entities.length = 0;
|
|
569
385
|
this._entities = [];
|
|
570
386
|
for (let i = 0; i < temp.length; i++) {
|
|
571
387
|
this._entities[i] = temp[i];
|
|
572
388
|
}
|
|
573
|
-
|
|
574
389
|
this._entityCollectionsTree = null;
|
|
575
390
|
this._entityCollectionsTreeNorth = null;
|
|
576
391
|
this._entityCollectionsTreeSouth = null;
|
|
577
392
|
}
|
|
578
|
-
|
|
579
393
|
/**
|
|
580
394
|
* Safety entities loop.
|
|
581
395
|
* @public
|
|
582
396
|
* @param {(entity: Entity, index?: number) => void} callback - Entity callback.
|
|
583
397
|
*/
|
|
584
|
-
|
|
398
|
+
each(callback) {
|
|
585
399
|
let e = this._entities;
|
|
586
400
|
let i = e.length;
|
|
587
401
|
while (i--) {
|
|
588
402
|
callback(e[i], i);
|
|
589
403
|
}
|
|
590
404
|
}
|
|
591
|
-
|
|
592
405
|
/**
|
|
593
406
|
* Removes current entities from layer and adds new entities.
|
|
594
407
|
* @public
|
|
595
408
|
* @param {Array.<Entity>} entities - New entity array.
|
|
596
409
|
* @returns {Vector} - Returns layer instance.
|
|
597
410
|
*/
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
let temp: Entity[] = new Array(entities.length);
|
|
601
|
-
|
|
411
|
+
setEntities(entities) {
|
|
412
|
+
let temp = new Array(entities.length);
|
|
602
413
|
for (let i = 0, len = entities.length; i < len; i++) {
|
|
603
414
|
temp[i] = entities[i];
|
|
604
415
|
}
|
|
605
|
-
|
|
606
416
|
this.clear();
|
|
607
|
-
|
|
608
417
|
this._entities = new Array(temp.length);
|
|
609
|
-
|
|
610
418
|
let entitiesForTree = [];
|
|
611
|
-
|
|
612
419
|
for (let i = 0; i < temp.length; i++) {
|
|
613
420
|
let ei = temp[i];
|
|
614
|
-
|
|
615
421
|
ei._layer = this;
|
|
616
422
|
ei._layerIndex = i;
|
|
617
|
-
|
|
618
423
|
if (ei.strip) {
|
|
619
424
|
this._stripEntityCollection.add(ei);
|
|
620
|
-
}
|
|
425
|
+
}
|
|
426
|
+
else if (ei.polyline || ei.ray) {
|
|
621
427
|
this._polylineEntityCollection.add(ei);
|
|
622
|
-
}
|
|
428
|
+
}
|
|
429
|
+
else if (ei.geoObject) {
|
|
623
430
|
this._geoObjectEntityCollection.add(ei);
|
|
624
|
-
}
|
|
431
|
+
}
|
|
432
|
+
else if (ei.billboard || ei.label) {
|
|
625
433
|
entitiesForTree.push(ei);
|
|
626
434
|
}
|
|
627
|
-
|
|
628
435
|
if (ei.geometry) {
|
|
629
436
|
this._hasImageryTiles = true;
|
|
630
437
|
if (this._planet) {
|
|
631
|
-
this._planet.renderer
|
|
438
|
+
this._planet.renderer.assignPickingColor(ei);
|
|
632
439
|
this._geometryHandler.add(ei.geometry);
|
|
633
440
|
}
|
|
634
441
|
}
|
|
635
|
-
|
|
636
442
|
this._entities[i] = ei;
|
|
637
443
|
}
|
|
638
|
-
|
|
639
444
|
this._createEntityCollectionsTree(entitiesForTree);
|
|
640
|
-
|
|
641
445
|
return this;
|
|
642
446
|
}
|
|
643
|
-
|
|
644
447
|
/**
|
|
645
448
|
* @todo: replace to a strategy node collecting algorithm
|
|
646
449
|
*/
|
|
647
|
-
|
|
648
|
-
|
|
450
|
+
_createEntityCollectionsTree(entitiesForTree) {
|
|
649
451
|
if (this._planet) {
|
|
650
|
-
|
|
651
|
-
this.
|
|
652
|
-
|
|
653
|
-
quadTree.NW,
|
|
654
|
-
null,
|
|
655
|
-
0,
|
|
656
|
-
Extent.createFromArray([-20037508.34, -20037508.34, 20037508.34, 20037508.34]),
|
|
657
|
-
this._planet,
|
|
658
|
-
0
|
|
659
|
-
);
|
|
660
|
-
|
|
661
|
-
this._entityCollectionsTreeNorth = new EntityCollectionNodeWGS84(
|
|
662
|
-
this,
|
|
663
|
-
quadTree.NW,
|
|
664
|
-
null,
|
|
665
|
-
0,
|
|
666
|
-
Extent.createFromArray([-180, mercator.MAX_LAT, 180, 90]),
|
|
667
|
-
this._planet,
|
|
668
|
-
0
|
|
669
|
-
);
|
|
670
|
-
|
|
671
|
-
this._entityCollectionsTreeSouth = new EntityCollectionNodeWGS84(
|
|
672
|
-
this,
|
|
673
|
-
quadTree.NW,
|
|
674
|
-
null,
|
|
675
|
-
0,
|
|
676
|
-
Extent.createFromArray([-180, -90, 180, mercator.MIN_LAT]),
|
|
677
|
-
this._planet,
|
|
678
|
-
0
|
|
679
|
-
);
|
|
680
|
-
|
|
452
|
+
this._entityCollectionsTree = new EntityCollectionNode(this, quadTree.NW, null, 0, Extent.createFromArray([-20037508.34, -20037508.34, 20037508.34, 20037508.34]), this._planet, 0);
|
|
453
|
+
this._entityCollectionsTreeNorth = new EntityCollectionNodeWGS84(this, quadTree.NW, null, 0, Extent.createFromArray([-180, mercator.MAX_LAT, 180, 90]), this._planet, 0);
|
|
454
|
+
this._entityCollectionsTreeSouth = new EntityCollectionNodeWGS84(this, quadTree.NW, null, 0, Extent.createFromArray([-180, -90, 180, mercator.MIN_LAT]), this._planet, 0);
|
|
681
455
|
for (let i = 0, len = entitiesForTree.length; i < len; i++) {
|
|
682
456
|
let entity = entitiesForTree[i];
|
|
683
457
|
// north tree
|
|
684
458
|
if (entity._lonLat.lat > mercator.MAX_LAT) {
|
|
685
459
|
this._entityCollectionsTreeNorth.__setLonLat__(entity);
|
|
686
|
-
}
|
|
460
|
+
}
|
|
461
|
+
else if (entity._lonLat.lat < mercator.MIN_LAT) {
|
|
687
462
|
// south tree
|
|
688
463
|
this._entityCollectionsTreeSouth.__setLonLat__(entity);
|
|
689
|
-
}
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
690
466
|
this._entityCollectionsTree.__setLonLat__(entity);
|
|
691
467
|
}
|
|
692
468
|
}
|
|
693
|
-
|
|
694
469
|
this._entityCollectionsTree.buildTree(entitiesForTree);
|
|
695
470
|
this._entityCollectionsTreeNorth.buildTree(entitiesForTree);
|
|
696
471
|
this._entityCollectionsTreeSouth.buildTree(entitiesForTree);
|
|
697
472
|
}
|
|
698
473
|
}
|
|
699
|
-
|
|
700
474
|
/**
|
|
701
475
|
* @todo (refactoring) could be used in somethig like bindEntityCollectionQuad(...)
|
|
702
476
|
* @param entityCollection
|
|
703
477
|
*/
|
|
704
|
-
|
|
705
|
-
|
|
478
|
+
_bindEventsDefault(entityCollection) {
|
|
706
479
|
let ve = this.events;
|
|
707
|
-
|
|
708
480
|
//
|
|
709
481
|
// @todo: replace with arrow functions and '...e'
|
|
710
482
|
//
|
|
711
|
-
entityCollection.events.on("entitymove", function (e
|
|
483
|
+
entityCollection.events.on("entitymove", function (e) {
|
|
712
484
|
ve.dispatch(ve.entitymove, e);
|
|
713
485
|
});
|
|
714
|
-
entityCollection.events.on("mousemove", function (e
|
|
486
|
+
entityCollection.events.on("mousemove", function (e) {
|
|
715
487
|
ve.dispatch(ve.mousemove, e);
|
|
716
488
|
});
|
|
717
|
-
entityCollection.events.on("mouseenter", function (e
|
|
489
|
+
entityCollection.events.on("mouseenter", function (e) {
|
|
718
490
|
ve.dispatch(ve.mouseenter, e);
|
|
719
491
|
});
|
|
720
|
-
entityCollection.events.on("mouseleave", function (e
|
|
492
|
+
entityCollection.events.on("mouseleave", function (e) {
|
|
721
493
|
ve.dispatch(ve.mouseleave, e);
|
|
722
494
|
});
|
|
723
|
-
entityCollection.events.on("lclick", function (e
|
|
495
|
+
entityCollection.events.on("lclick", function (e) {
|
|
724
496
|
ve.dispatch(ve.lclick, e);
|
|
725
497
|
});
|
|
726
|
-
entityCollection.events.on("rclick", function (e
|
|
498
|
+
entityCollection.events.on("rclick", function (e) {
|
|
727
499
|
ve.dispatch(ve.rclick, e);
|
|
728
500
|
});
|
|
729
|
-
entityCollection.events.on("mclick", function (e
|
|
501
|
+
entityCollection.events.on("mclick", function (e) {
|
|
730
502
|
ve.dispatch(ve.mclick, e);
|
|
731
503
|
});
|
|
732
|
-
entityCollection.events.on("ldblclick", function (e
|
|
504
|
+
entityCollection.events.on("ldblclick", function (e) {
|
|
733
505
|
ve.dispatch(ve.ldblclick, e);
|
|
734
506
|
});
|
|
735
|
-
entityCollection.events.on("rdblclick", function (e
|
|
507
|
+
entityCollection.events.on("rdblclick", function (e) {
|
|
736
508
|
ve.dispatch(ve.rdblclick, e);
|
|
737
509
|
});
|
|
738
|
-
entityCollection.events.on("mdblclick", function (e
|
|
510
|
+
entityCollection.events.on("mdblclick", function (e) {
|
|
739
511
|
ve.dispatch(ve.mdblclick, e);
|
|
740
512
|
});
|
|
741
|
-
entityCollection.events.on("lup", function (e
|
|
513
|
+
entityCollection.events.on("lup", function (e) {
|
|
742
514
|
ve.dispatch(ve.lup, e);
|
|
743
515
|
});
|
|
744
|
-
entityCollection.events.on("rup", function (e
|
|
516
|
+
entityCollection.events.on("rup", function (e) {
|
|
745
517
|
ve.dispatch(ve.rup, e);
|
|
746
518
|
});
|
|
747
|
-
entityCollection.events.on("mup", function (e
|
|
519
|
+
entityCollection.events.on("mup", function (e) {
|
|
748
520
|
ve.dispatch(ve.mup, e);
|
|
749
521
|
});
|
|
750
|
-
entityCollection.events.on("ldown", function (e
|
|
522
|
+
entityCollection.events.on("ldown", function (e) {
|
|
751
523
|
ve.dispatch(ve.ldown, e);
|
|
752
524
|
});
|
|
753
|
-
entityCollection.events.on("rdown", function (e
|
|
525
|
+
entityCollection.events.on("rdown", function (e) {
|
|
754
526
|
ve.dispatch(ve.rdown, e);
|
|
755
527
|
});
|
|
756
|
-
entityCollection.events.on("mdown", function (e
|
|
528
|
+
entityCollection.events.on("mdown", function (e) {
|
|
757
529
|
ve.dispatch(ve.mdown, e);
|
|
758
530
|
});
|
|
759
|
-
entityCollection.events.on("lhold", function (e
|
|
531
|
+
entityCollection.events.on("lhold", function (e) {
|
|
760
532
|
ve.dispatch(ve.lhold, e);
|
|
761
533
|
});
|
|
762
|
-
entityCollection.events.on("rhold", function (e
|
|
534
|
+
entityCollection.events.on("rhold", function (e) {
|
|
763
535
|
ve.dispatch(ve.rhold, e);
|
|
764
536
|
});
|
|
765
|
-
entityCollection.events.on("mhold", function (e
|
|
537
|
+
entityCollection.events.on("mhold", function (e) {
|
|
766
538
|
ve.dispatch(ve.mhold, e);
|
|
767
539
|
});
|
|
768
|
-
entityCollection.events.on("mousewheel", function (e
|
|
540
|
+
entityCollection.events.on("mousewheel", function (e) {
|
|
769
541
|
ve.dispatch(ve.mousewheel, e);
|
|
770
542
|
});
|
|
771
|
-
entityCollection.events.on("touchmove", function (e
|
|
543
|
+
entityCollection.events.on("touchmove", function (e) {
|
|
772
544
|
ve.dispatch(ve.touchmove, e);
|
|
773
545
|
});
|
|
774
|
-
entityCollection.events.on("touchstart", function (e
|
|
546
|
+
entityCollection.events.on("touchstart", function (e) {
|
|
775
547
|
ve.dispatch(ve.touchstart, e);
|
|
776
548
|
});
|
|
777
|
-
entityCollection.events.on("touchend", function (e
|
|
549
|
+
entityCollection.events.on("touchend", function (e) {
|
|
778
550
|
ve.dispatch(ve.touchend, e);
|
|
779
551
|
});
|
|
780
|
-
entityCollection.events.on("doubletouch", function (e
|
|
552
|
+
entityCollection.events.on("doubletouch", function (e) {
|
|
781
553
|
ve.dispatch(ve.doubletouch, e);
|
|
782
554
|
});
|
|
783
|
-
entityCollection.events.on("touchleave", function (e
|
|
555
|
+
entityCollection.events.on("touchleave", function (e) {
|
|
784
556
|
ve.dispatch(ve.touchleave, e);
|
|
785
557
|
});
|
|
786
|
-
entityCollection.events.on("touchenter", function (e
|
|
558
|
+
entityCollection.events.on("touchenter", function (e) {
|
|
787
559
|
ve.dispatch(ve.touchenter, e);
|
|
788
560
|
});
|
|
789
561
|
}
|
|
790
|
-
|
|
791
|
-
protected _collectStripCollectionPASS(outArr: EntityCollection[]) {
|
|
562
|
+
_collectStripCollectionPASS(outArr) {
|
|
792
563
|
let ec = this._stripEntityCollection;
|
|
793
|
-
|
|
794
564
|
ec._fadingOpacity = this._fadingOpacity;
|
|
795
565
|
ec.scaleByDistance = this.scaleByDistance;
|
|
796
566
|
ec.pickingScale = this.pickingScale;
|
|
797
567
|
ec.polygonOffsetUnits = this.polygonOffsetUnits;
|
|
798
|
-
|
|
799
568
|
outArr.push(ec);
|
|
800
569
|
}
|
|
801
|
-
|
|
802
|
-
protected _collectPolylineCollectionPASS(outArr: EntityCollection[]) {
|
|
570
|
+
_collectPolylineCollectionPASS(outArr) {
|
|
803
571
|
let ec = this._polylineEntityCollection;
|
|
804
|
-
|
|
805
572
|
ec._fadingOpacity = this._fadingOpacity;
|
|
806
573
|
ec.scaleByDistance = this.scaleByDistance;
|
|
807
574
|
ec.pickingScale = this.pickingScale;
|
|
808
575
|
ec.polygonOffsetUnits = this.polygonOffsetUnits;
|
|
809
|
-
|
|
810
576
|
outArr.push(ec);
|
|
811
|
-
|
|
812
577
|
if (this.clampToGround || this.relativeToGround) {
|
|
813
578
|
let rtg = Number(this.relativeToGround);
|
|
814
|
-
|
|
815
|
-
const
|
|
816
|
-
const visibleExtent = this._planet!.getViewExtent();
|
|
579
|
+
const nodes = this._planet._renderedNodes;
|
|
580
|
+
const visibleExtent = this._planet.getViewExtent();
|
|
817
581
|
let e = ec._entities;
|
|
818
582
|
let e_i = e.length;
|
|
819
583
|
let res = new Vec3();
|
|
820
|
-
|
|
821
584
|
while (e_i--) {
|
|
822
|
-
let p = e[e_i].polyline
|
|
585
|
+
let p = e[e_i].polyline;
|
|
823
586
|
if (p && visibleExtent.overlaps(p._extent)) {
|
|
824
587
|
// TODO:this works only for mercator area.
|
|
825
588
|
// needs to be working on poles.
|
|
826
|
-
let coords = p._pathLonLatMerc,
|
|
827
|
-
c_j = coords.length;
|
|
589
|
+
let coords = p._pathLonLatMerc, c_j = coords.length;
|
|
828
590
|
while (c_j--) {
|
|
829
591
|
let c_j_h = coords[c_j].length;
|
|
830
592
|
while (c_j_h--) {
|
|
831
|
-
let ll = coords[c_j][c_j_h],
|
|
832
|
-
n_k = nodes.length;
|
|
593
|
+
let ll = coords[c_j][c_j_h], n_k = nodes.length;
|
|
833
594
|
while (n_k--) {
|
|
834
595
|
let seg = nodes[n_k].segment;
|
|
835
596
|
if (seg._extent.isInside(ll)) {
|
|
836
|
-
let cart = p._path3v[c_j][c_j_h]
|
|
597
|
+
let cart = p._path3v[c_j][c_j_h];
|
|
837
598
|
seg.getTerrainPoint(cart, ll, res);
|
|
838
599
|
let alt = (rtg && p.altitude) || 0.0;
|
|
839
600
|
if (alt) {
|
|
840
|
-
let n = this._planet
|
|
601
|
+
let n = this._planet.ellipsoid.getSurfaceNormal3v(res);
|
|
841
602
|
p.setPoint3v(res.addA(n.scale(alt)), c_j_h, c_j, true);
|
|
842
|
-
}
|
|
603
|
+
}
|
|
604
|
+
else {
|
|
843
605
|
p.setPoint3v(res, c_j_h, c_j, true);
|
|
844
606
|
}
|
|
845
607
|
break;
|
|
@@ -851,17 +613,13 @@ class Vector extends Layer {
|
|
|
851
613
|
}
|
|
852
614
|
}
|
|
853
615
|
}
|
|
854
|
-
|
|
855
|
-
protected _collectGeoObjectCollectionPASS(outArr: EntityCollection[]) {
|
|
616
|
+
_collectGeoObjectCollectionPASS(outArr) {
|
|
856
617
|
let ec = this._geoObjectEntityCollection;
|
|
857
|
-
|
|
858
618
|
ec._fadingOpacity = this._fadingOpacity;
|
|
859
619
|
ec.scaleByDistance = this.scaleByDistance;
|
|
860
620
|
ec.pickingScale = this.pickingScale;
|
|
861
621
|
ec.polygonOffsetUnits = this.polygonOffsetUnits;
|
|
862
|
-
|
|
863
622
|
outArr.push(ec);
|
|
864
|
-
|
|
865
623
|
// if (this.clampToGround || this.relativeToGround) {
|
|
866
624
|
// let rtg = Number(this.relativeToGround);
|
|
867
625
|
//
|
|
@@ -903,23 +661,17 @@ class Vector extends Layer {
|
|
|
903
661
|
// }
|
|
904
662
|
// }
|
|
905
663
|
}
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
if (
|
|
911
|
-
(this._fading && this._fadingOpacity > 0.0) ||
|
|
912
|
-
(this.minZoom <= p.maxCurrZoom && this.maxZoom >= p.maxCurrZoom)
|
|
913
|
-
) {
|
|
664
|
+
collectVisibleCollections(outArr) {
|
|
665
|
+
let p = this._planet;
|
|
666
|
+
if ((this._fading && this._fadingOpacity > 0.0) ||
|
|
667
|
+
(this.minZoom <= p.maxCurrZoom && this.maxZoom >= p.maxCurrZoom)) {
|
|
914
668
|
this._renderingNodes = {};
|
|
915
669
|
this._renderingNodesNorth = {};
|
|
916
670
|
this._renderingNodesSouth = {};
|
|
917
|
-
|
|
918
671
|
// Common collections first
|
|
919
672
|
this._collectStripCollectionPASS(outArr);
|
|
920
673
|
this._collectPolylineCollectionPASS(outArr);
|
|
921
674
|
this._collectGeoObjectCollectionPASS(outArr);
|
|
922
|
-
|
|
923
675
|
// Merc nodes
|
|
924
676
|
this._secondPASS = [];
|
|
925
677
|
this._entityCollectionsTree && this._entityCollectionsTree.collectRenderCollectionsPASS1(p._visibleNodes, outArr);
|
|
@@ -927,7 +679,6 @@ class Vector extends Layer {
|
|
|
927
679
|
while (i--) {
|
|
928
680
|
this._secondPASS[i].collectRenderCollectionsPASS2(p._visibleNodes, outArr, this._secondPASS[i].nodeId);
|
|
929
681
|
}
|
|
930
|
-
|
|
931
682
|
// North nodes
|
|
932
683
|
this._secondPASS = [];
|
|
933
684
|
this._entityCollectionsTreeNorth && this._entityCollectionsTreeNorth.collectRenderCollectionsPASS1(p._visibleNodesNorth, outArr);
|
|
@@ -935,7 +686,6 @@ class Vector extends Layer {
|
|
|
935
686
|
while (i--) {
|
|
936
687
|
this._secondPASS[i].collectRenderCollectionsPASS2(p._visibleNodesNorth, outArr, this._secondPASS[i].nodeId);
|
|
937
688
|
}
|
|
938
|
-
|
|
939
689
|
// South nodes
|
|
940
690
|
this._secondPASS = [];
|
|
941
691
|
this._entityCollectionsTreeSouth && this._entityCollectionsTreeSouth.collectRenderCollectionsPASS1(p._visibleNodesSouth, outArr);
|
|
@@ -945,26 +695,25 @@ class Vector extends Layer {
|
|
|
945
695
|
}
|
|
946
696
|
}
|
|
947
697
|
}
|
|
948
|
-
|
|
949
|
-
public _queueDeferredNode(node: EntityCollectionNode) {
|
|
698
|
+
_queueDeferredNode(node) {
|
|
950
699
|
if (this._visibility) {
|
|
951
700
|
node._inTheQueue = true;
|
|
952
701
|
if (this._counter >= 1) {
|
|
953
702
|
this._deferredEntitiesPendingQueue.push(node);
|
|
954
|
-
}
|
|
703
|
+
}
|
|
704
|
+
else {
|
|
955
705
|
this._execDeferredNode(node);
|
|
956
706
|
}
|
|
957
707
|
}
|
|
958
708
|
}
|
|
959
|
-
|
|
960
|
-
protected _execDeferredNode(node: EntityCollectionNode) {
|
|
709
|
+
_execDeferredNode(node) {
|
|
961
710
|
this._counter++;
|
|
962
711
|
setTimeout(() => {
|
|
963
712
|
node.applyCollection();
|
|
964
713
|
this._counter--;
|
|
965
714
|
if (this._deferredEntitiesPendingQueue.length && this._counter < 1) {
|
|
966
715
|
while (this._deferredEntitiesPendingQueue.length) {
|
|
967
|
-
let n = this._deferredEntitiesPendingQueue.pop()
|
|
716
|
+
let n = this._deferredEntitiesPendingQueue.pop();
|
|
968
717
|
n._inTheQueue = false;
|
|
969
718
|
if (n.isVisible()) {
|
|
970
719
|
this._execDeferredNode(n);
|
|
@@ -974,53 +723,46 @@ class Vector extends Layer {
|
|
|
974
723
|
}
|
|
975
724
|
}, 0);
|
|
976
725
|
}
|
|
977
|
-
|
|
978
726
|
/**
|
|
979
727
|
* Start to load tile material.
|
|
980
728
|
* @public
|
|
981
729
|
* @virtual
|
|
982
730
|
* @param {Material} material - Current material.
|
|
983
731
|
*/
|
|
984
|
-
|
|
732
|
+
loadMaterial(material) {
|
|
985
733
|
const seg = material.segment;
|
|
986
|
-
|
|
987
734
|
if (this._isBaseLayer) {
|
|
988
735
|
material.texture = seg._isNorth ? seg.planet.solidTextureOne : seg.planet.solidTextureTwo;
|
|
989
|
-
}
|
|
736
|
+
}
|
|
737
|
+
else {
|
|
990
738
|
material.texture = seg.planet.transparentTexture;
|
|
991
739
|
}
|
|
992
|
-
|
|
993
|
-
if (this._planet!.layerLock.isFree()) {
|
|
740
|
+
if (this._planet.layerLock.isFree()) {
|
|
994
741
|
material.isReady = false;
|
|
995
742
|
material.isLoading = true;
|
|
996
|
-
this._planet
|
|
743
|
+
this._planet._vectorTileCreator.add(material);
|
|
997
744
|
}
|
|
998
745
|
}
|
|
999
|
-
|
|
1000
746
|
/**
|
|
1001
747
|
* Abort exact material loading.
|
|
1002
748
|
* @public
|
|
1003
749
|
* @override
|
|
1004
750
|
* @param {Material} material - Segment material.
|
|
1005
751
|
*/
|
|
1006
|
-
|
|
752
|
+
abortMaterialLoading(material) {
|
|
1007
753
|
material.isLoading = false;
|
|
1008
754
|
material.isReady = false;
|
|
1009
755
|
}
|
|
1010
|
-
|
|
1011
|
-
public override applyMaterial(material: Material, isForced: boolean = false): NumberArray4 {
|
|
756
|
+
applyMaterial(material, isForced = false) {
|
|
1012
757
|
if (material.isReady) {
|
|
1013
758
|
return [0, 0, 1, 1];
|
|
1014
|
-
}
|
|
759
|
+
}
|
|
760
|
+
else {
|
|
1015
761
|
!material.isLoading && this.loadMaterial(material);
|
|
1016
|
-
|
|
1017
762
|
const segment = material.segment;
|
|
1018
|
-
let pn = segment.node,
|
|
1019
|
-
notEmpty = false;
|
|
1020
|
-
|
|
763
|
+
let pn = segment.node, notEmpty = false;
|
|
1021
764
|
let mId = this.__id;
|
|
1022
765
|
let psegm = material;
|
|
1023
|
-
|
|
1024
766
|
while (pn.parentNode) {
|
|
1025
767
|
if (psegm && psegm.isReady) {
|
|
1026
768
|
notEmpty = true;
|
|
@@ -1029,7 +771,6 @@ class Vector extends Layer {
|
|
|
1029
771
|
pn = pn.parentNode;
|
|
1030
772
|
psegm = pn.segment.materials[mId];
|
|
1031
773
|
}
|
|
1032
|
-
|
|
1033
774
|
if (notEmpty) {
|
|
1034
775
|
material.appliedNodeId = pn.nodeId;
|
|
1035
776
|
material.texture = psegm.texture;
|
|
@@ -1041,11 +782,13 @@ class Vector extends Layer {
|
|
|
1041
782
|
dZ2,
|
|
1042
783
|
dZ2
|
|
1043
784
|
];
|
|
1044
|
-
}
|
|
785
|
+
}
|
|
786
|
+
else {
|
|
1045
787
|
if (material.textureExists && material._updateTexture) {
|
|
1046
788
|
material.texture = material._updateTexture;
|
|
1047
789
|
material.pickingMask = material._updatePickingMask;
|
|
1048
|
-
}
|
|
790
|
+
}
|
|
791
|
+
else {
|
|
1049
792
|
material.texture = segment.planet.transparentTexture;
|
|
1050
793
|
material.pickingMask = segment.planet.transparentTexture;
|
|
1051
794
|
}
|
|
@@ -1054,67 +797,53 @@ class Vector extends Layer {
|
|
|
1054
797
|
}
|
|
1055
798
|
}
|
|
1056
799
|
}
|
|
1057
|
-
|
|
1058
|
-
public override clearMaterial(material: Material) {
|
|
800
|
+
clearMaterial(material) {
|
|
1059
801
|
if (material.isReady) {
|
|
1060
|
-
const gl = material.segment.handler.gl
|
|
1061
|
-
|
|
802
|
+
const gl = material.segment.handler.gl;
|
|
1062
803
|
material.isReady = false;
|
|
1063
804
|
material.pickingReady = false;
|
|
1064
|
-
|
|
1065
805
|
let t = material.texture;
|
|
1066
806
|
material.texture = null;
|
|
1067
807
|
t && !t.default && gl.deleteTexture(t);
|
|
1068
|
-
|
|
1069
808
|
t = material.pickingMask;
|
|
1070
809
|
material.pickingMask = null;
|
|
1071
810
|
t && !t.default && gl.deleteTexture(t);
|
|
1072
|
-
|
|
1073
811
|
t = material._updateTexture;
|
|
1074
812
|
material._updateTexture = null;
|
|
1075
813
|
t && !t.default && gl.deleteTexture(t);
|
|
1076
|
-
|
|
1077
814
|
t = material._updatePickingMask;
|
|
1078
815
|
material._updatePickingMask = null;
|
|
1079
816
|
t && !t.default && gl.deleteTexture(t);
|
|
1080
817
|
}
|
|
1081
|
-
|
|
1082
818
|
this.abortMaterialLoading(material);
|
|
1083
|
-
|
|
1084
819
|
material.isLoading = false;
|
|
1085
820
|
material.textureExists = false;
|
|
1086
821
|
}
|
|
1087
|
-
|
|
1088
|
-
public update() {
|
|
822
|
+
update() {
|
|
1089
823
|
this._geometryHandler.update();
|
|
1090
824
|
this.events.dispatch(this.events.draw, this);
|
|
1091
825
|
}
|
|
1092
826
|
}
|
|
1093
|
-
|
|
1094
|
-
const VECTOR_EVENTS: VectorEventsList = [
|
|
827
|
+
const VECTOR_EVENTS = [
|
|
1095
828
|
/**
|
|
1096
829
|
* Triggered when entity has moved.
|
|
1097
830
|
* @event EventsHandler<VectorEventsList>#draw
|
|
1098
831
|
*/
|
|
1099
832
|
"entitymove",
|
|
1100
|
-
|
|
1101
833
|
/**
|
|
1102
834
|
* Triggered when layer begin draw.
|
|
1103
835
|
* @event EventsHandler<VectorEventsList>#draw
|
|
1104
836
|
*/
|
|
1105
837
|
"draw",
|
|
1106
|
-
|
|
1107
838
|
/**
|
|
1108
839
|
* Triggered when new entity added to the layer.
|
|
1109
840
|
* @event EventsHandler<VectorEventsList>#entityadd
|
|
1110
841
|
*/
|
|
1111
842
|
"entityadd",
|
|
1112
|
-
|
|
1113
843
|
/**
|
|
1114
844
|
* Triggered when entity removes from the collection.
|
|
1115
845
|
* @event EventsHandler<VectorEventsList>#entityremove
|
|
1116
846
|
*/
|
|
1117
847
|
"entityremove"
|
|
1118
848
|
];
|
|
1119
|
-
|
|
1120
|
-
export {Vector};
|
|
849
|
+
export { Vector };
|