@openglobus/og 0.19.3 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/css/og.css +18 -4
- package/lib/@openglobus/js/Clock.d.ts +106 -0
- package/lib/@openglobus/js/Deferred.d.ts +6 -0
- package/lib/@openglobus/js/Events.d.ts +90 -0
- package/lib/@openglobus/js/Extent.d.ts +145 -0
- package/lib/@openglobus/js/Globe.d.ts +134 -0
- package/lib/@openglobus/js/ImageCanvas.d.ts +128 -0
- package/lib/@openglobus/js/Lock.d.ts +15 -0
- package/lib/@openglobus/js/LonLat.d.ts +128 -0
- package/lib/@openglobus/js/Object3d.d.ts +64 -0
- package/lib/@openglobus/js/Popup.d.ts +46 -0
- package/lib/@openglobus/js/QueueArray.d.ts +16 -0
- package/lib/@openglobus/js/Rectangle.d.ts +76 -0
- package/lib/@openglobus/js/Stack.d.ts +20 -0
- package/lib/@openglobus/js/astro/astro.d.ts +39 -0
- package/lib/@openglobus/js/astro/earth.d.ts +8 -0
- package/lib/@openglobus/js/astro/jd.d.ts +234 -0
- package/lib/@openglobus/js/astro/orbit.d.ts +5 -0
- package/lib/@openglobus/js/astro/rotation.d.ts +2 -0
- package/lib/@openglobus/js/bv/Box.d.ts +32 -0
- package/lib/@openglobus/js/bv/Sphere.d.ts +37 -0
- package/lib/@openglobus/js/bv/index.d.ts +3 -0
- package/lib/@openglobus/js/camera/Camera.d.ts +314 -0
- package/lib/@openglobus/js/camera/Frustum.d.ts +139 -0
- package/lib/@openglobus/js/camera/PlanetCamera.d.ts +234 -0
- package/lib/@openglobus/js/camera/index.d.ts +3 -0
- package/lib/@openglobus/js/cons.d.ts +40 -0
- package/lib/@openglobus/js/control/Atmosphere.d.ts +16 -0
- package/lib/@openglobus/js/control/CompassButton.d.ts +16 -0
- package/lib/@openglobus/js/control/Control.d.ts +100 -0
- package/lib/@openglobus/js/control/DebugInfo.d.ts +25 -0
- package/lib/@openglobus/js/control/DrawingSwitcher.d.ts +13 -0
- package/lib/@openglobus/js/control/EarthCoordinates.d.ts +41 -0
- package/lib/@openglobus/js/control/EarthNavigation.d.ts +50 -0
- package/lib/@openglobus/js/control/GeoImageDragControl.d.ts +22 -0
- package/lib/@openglobus/js/control/KeyboardNavigation.d.ts +28 -0
- package/lib/@openglobus/js/control/LayerAnimation.d.ts +71 -0
- package/lib/@openglobus/js/control/LayerSwitcher.d.ts +36 -0
- package/lib/@openglobus/js/control/Lighting.d.ts +53 -0
- package/lib/@openglobus/js/control/MouseNavigation.d.ts +64 -0
- package/lib/@openglobus/js/control/MouseWheelZoomControl.d.ts +44 -0
- package/lib/@openglobus/js/control/RulerSwitcher.d.ts +17 -0
- package/lib/@openglobus/js/control/ScaleControl.d.ts +24 -0
- package/lib/@openglobus/js/control/SegmentBoundVisualization.d.ts +12 -0
- package/lib/@openglobus/js/control/ShowFps.d.ts +9 -0
- package/lib/@openglobus/js/control/SimpleNavigation.d.ts +25 -0
- package/lib/@openglobus/js/control/SimpleSkyBackground.d.ts +17 -0
- package/lib/@openglobus/js/control/Sun.d.ts +33 -0
- package/lib/@openglobus/js/control/ToggleWireframe.d.ts +14 -0
- package/lib/@openglobus/js/control/TouchNavigation.d.ts +52 -0
- package/lib/@openglobus/js/control/ZoomControl.d.ts +27 -0
- package/lib/@openglobus/js/control/drawing/DrawingControl.d.ts +12 -0
- package/lib/@openglobus/js/control/drawing/LineStringDrawingScene.d.ts +15 -0
- package/lib/@openglobus/js/control/drawing/PolygonDrawingScene.d.ts +98 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfile.d.ts +77 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileButtonsView.d.ts +14 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileControl.d.ts +33 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileLegend.d.ts +20 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileScene.d.ts +80 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileView.d.ts +63 -0
- package/lib/@openglobus/js/control/elevationProfile/PointListDialog.d.ts +12 -0
- package/lib/@openglobus/js/control/heightRuler/HeightRuler.d.ts +7 -0
- package/lib/@openglobus/js/control/heightRuler/HeightRulerScene.d.ts +35 -0
- package/lib/@openglobus/js/control/heightRuler/HeightRulerSwitcher.d.ts +6 -0
- package/lib/@openglobus/js/control/index.d.ts +29 -0
- package/lib/@openglobus/js/control/ruler/Ruler.d.ts +13 -0
- package/lib/@openglobus/js/control/ruler/RulerScene.d.ts +88 -0
- package/lib/@openglobus/js/control/selection/Selection.d.ts +55 -0
- package/lib/@openglobus/js/control/selection/SelectionScene.d.ts +44 -0
- package/lib/@openglobus/js/control/timeline/TimelineControl.d.ts +18 -0
- package/lib/@openglobus/js/control/timeline/TimelineModel.d.ts +41 -0
- package/lib/@openglobus/js/control/timeline/TimelineView.d.ts +85 -0
- package/lib/@openglobus/js/control/timeline/timelineUtils.d.ts +12 -0
- package/lib/@openglobus/js/control/visibleExtent/drawnode.d.ts +7 -0
- package/lib/@openglobus/js/ellipsoid/Ellipsoid.d.ts +193 -0
- package/lib/@openglobus/js/ellipsoid/index.d.ts +3 -0
- package/lib/@openglobus/js/ellipsoid/wgs84.d.ts +6 -0
- package/lib/@openglobus/js/entity/BaseBillboard.d.ts +222 -0
- package/lib/@openglobus/js/entity/BaseBillboardHandler.d.ts +81 -0
- package/lib/@openglobus/js/entity/Billboard.d.ts +113 -0
- package/lib/@openglobus/js/entity/BillboardHandler.d.ts +15 -0
- package/lib/@openglobus/js/entity/Entity.d.ts +354 -0
- package/lib/@openglobus/js/entity/EntityCollection.d.ts +363 -0
- package/lib/@openglobus/js/entity/GeoObject.d.ts +152 -0
- package/lib/@openglobus/js/entity/GeoObjectHandler.d.ts +104 -0
- package/lib/@openglobus/js/entity/Geometry.d.ts +124 -0
- package/lib/@openglobus/js/entity/GeometryHandler.d.ts +84 -0
- package/lib/@openglobus/js/entity/Label.d.ts +214 -0
- package/lib/@openglobus/js/entity/LabelHandler.d.ts +65 -0
- package/lib/@openglobus/js/entity/LabelWorker.d.ts +15 -0
- package/lib/@openglobus/js/entity/PointCloud.d.ts +179 -0
- package/lib/@openglobus/js/entity/PointCloudHandler.d.ts +42 -0
- package/lib/@openglobus/js/entity/Polyline.d.ts +345 -0
- package/lib/@openglobus/js/entity/PolylineHandler.d.ts +22 -0
- package/lib/@openglobus/js/entity/Ray.d.ts +133 -0
- package/lib/@openglobus/js/entity/RayHandler.d.ts +70 -0
- package/lib/@openglobus/js/entity/Strip.d.ts +139 -0
- package/lib/@openglobus/js/entity/StripHandler.d.ts +42 -0
- package/lib/@openglobus/js/entity/index.d.ts +10 -0
- package/lib/@openglobus/js/index.d.ts +33 -0
- package/lib/@openglobus/js/input/KeyboardHandler.d.ts +33 -0
- package/lib/@openglobus/js/input/MouseHandler.d.ts +16 -0
- package/lib/@openglobus/js/input/TouchHandler.d.ts +11 -0
- package/lib/@openglobus/js/input/input.d.ts +3 -0
- package/lib/@openglobus/js/layer/BaseGeoImage.d.ts +145 -0
- package/lib/@openglobus/js/layer/Bing.d.ts +4 -0
- package/lib/@openglobus/js/layer/CanvasTiles.d.ts +103 -0
- package/lib/@openglobus/js/layer/GeoImage.d.ts +61 -0
- package/lib/@openglobus/js/layer/GeoTexture2d.d.ts +17 -0
- package/lib/@openglobus/js/layer/GeoVideo.d.ts +68 -0
- package/lib/@openglobus/js/layer/KML.d.ts +72 -0
- package/lib/@openglobus/js/layer/Layer.d.ts +415 -0
- package/lib/@openglobus/js/layer/Material.d.ts +34 -0
- package/lib/@openglobus/js/layer/OpenStreetMap.d.ts +4 -0
- package/lib/@openglobus/js/layer/Vector.d.ts +246 -0
- package/lib/@openglobus/js/layer/WMS.d.ts +75 -0
- package/lib/@openglobus/js/layer/XYZ.d.ts +148 -0
- package/lib/@openglobus/js/layer/index.d.ts +12 -0
- package/lib/@openglobus/js/light/LightSource.d.ts +174 -0
- package/lib/@openglobus/js/math/Line2.d.ts +11 -0
- package/lib/@openglobus/js/math/Line3.d.ts +28 -0
- package/lib/@openglobus/js/math/Mat3.d.ts +77 -0
- package/lib/@openglobus/js/math/Mat4.d.ts +195 -0
- package/lib/@openglobus/js/math/Plane.d.ts +20 -0
- package/lib/@openglobus/js/math/Quat.d.ts +373 -0
- package/lib/@openglobus/js/math/Ray.d.ts +76 -0
- package/lib/@openglobus/js/math/Vec2.d.ts +310 -0
- package/lib/@openglobus/js/math/Vec3.d.ts +472 -0
- package/lib/@openglobus/js/math/Vec4.d.ts +163 -0
- package/lib/@openglobus/js/math/coder.d.ts +51 -0
- package/lib/@openglobus/js/math/index.d.ts +11 -0
- package/lib/@openglobus/js/math.d.ts +266 -0
- package/lib/@openglobus/js/mercator.d.ts +92 -0
- package/lib/@openglobus/js/proj/EPSG3857.d.ts +9 -0
- package/lib/@openglobus/js/proj/EPSG4326.d.ts +9 -0
- package/lib/@openglobus/js/proj/Proj.d.ts +43 -0
- package/lib/@openglobus/js/quadTree/EPSG4326QuadTreeStrategy.d.ts +6 -0
- package/lib/@openglobus/js/quadTree/EarthQuadTreeStrategy.d.ts +9 -0
- package/lib/@openglobus/js/quadTree/EntityCollectionNode.d.ts +54 -0
- package/lib/@openglobus/js/quadTree/MarsQuadTreeStrategy.d.ts +11 -0
- package/lib/@openglobus/js/quadTree/Node.d.ts +80 -0
- package/lib/@openglobus/js/quadTree/QuadTreeStrategy.d.ts +28 -0
- package/lib/@openglobus/js/quadTree/Wgs84QuadTreeStrategy.d.ts +6 -0
- package/lib/@openglobus/js/quadTree/index.d.ts +12 -0
- package/lib/@openglobus/js/quadTree/quadTree.d.ts +40 -0
- package/lib/@openglobus/js/renderer/Renderer.d.ts +319 -0
- package/lib/@openglobus/js/renderer/RendererEvents.d.ts +240 -0
- package/lib/@openglobus/js/scene/Axes.d.ts +12 -0
- package/lib/@openglobus/js/scene/BaseNode.d.ts +61 -0
- package/lib/@openglobus/js/scene/Planet.d.ts +652 -0
- package/lib/@openglobus/js/scene/RenderNode.d.ts +150 -0
- package/lib/@openglobus/js/scene/SkyBox.d.ts +13 -0
- package/lib/@openglobus/js/scene/index.d.ts +5 -0
- package/lib/@openglobus/js/segment/Segment.d.ts +288 -0
- package/lib/@openglobus/js/segment/SegmentLonLat.d.ts +44 -0
- package/lib/@openglobus/js/segment/SegmentLonLatWgs84.d.ts +10 -0
- package/lib/@openglobus/js/segment/Slice.d.ts +13 -0
- package/lib/@openglobus/js/segment/segmentHelper.d.ts +18 -0
- package/lib/@openglobus/js/shaders/atmos.d.ts +4 -0
- package/lib/@openglobus/js/shaders/billboard.d.ts +3 -0
- package/lib/@openglobus/js/shaders/bloom.d.ts +2 -0
- package/lib/@openglobus/js/shaders/blur.d.ts +3 -0
- package/lib/@openglobus/js/shaders/depth.d.ts +2 -0
- package/lib/@openglobus/js/shaders/drawnode.d.ts +8 -0
- package/lib/@openglobus/js/shaders/geoObject.d.ts +3 -0
- package/lib/@openglobus/js/shaders/label.d.ts +4 -0
- package/lib/@openglobus/js/shaders/lumFilter.d.ts +2 -0
- package/lib/@openglobus/js/shaders/pointCloud.d.ts +2 -0
- package/lib/@openglobus/js/shaders/polyline.d.ts +3 -0
- package/lib/@openglobus/js/shaders/ray.d.ts +2 -0
- package/lib/@openglobus/js/shaders/screenFrame.d.ts +2 -0
- package/lib/@openglobus/js/shaders/skybox.d.ts +2 -0
- package/lib/@openglobus/js/shaders/toneMapping.d.ts +2 -0
- package/lib/@openglobus/js/shaders/utils.d.ts +1 -0
- package/lib/@openglobus/js/terrain/BilTerrain.d.ts +18 -0
- package/lib/@openglobus/js/terrain/EmptyTerrain.d.ts +113 -0
- package/lib/@openglobus/js/terrain/Geoid.d.ts +33 -0
- package/lib/@openglobus/js/terrain/GlobusRgbTerrain.d.ts +6 -0
- package/lib/@openglobus/js/terrain/GlobusTerrain.d.ts +137 -0
- package/lib/{js/terrain/MapboxTerrain.d.ts → @openglobus/js/terrain/RgbTerrain.d.ts} +6 -5
- package/lib/@openglobus/js/terrain/index.d.ts +6 -0
- package/lib/@openglobus/js/ui/Button.d.ts +32 -0
- package/lib/@openglobus/js/ui/ButtonGroup.d.ts +16 -0
- package/lib/@openglobus/js/ui/Color.d.ts +22 -0
- package/lib/@openglobus/js/ui/Dialog.d.ts +55 -0
- package/lib/@openglobus/js/ui/Slider.d.ts +38 -0
- package/lib/@openglobus/js/ui/ToggleButton.d.ts +20 -0
- package/lib/@openglobus/js/ui/View.d.ts +37 -0
- package/lib/@openglobus/js/ui/icons.d.ts +1 -0
- package/lib/@openglobus/js/utils/BaseWorker.d.ts +14 -0
- package/lib/@openglobus/js/utils/FontAtlas.d.ts +82 -0
- package/lib/@openglobus/js/utils/GeoImageCreator.d.ts +34 -0
- package/lib/@openglobus/js/utils/ImagesCacheManager.d.ts +22 -0
- package/lib/@openglobus/js/utils/Loader.d.ts +63 -0
- package/lib/@openglobus/js/utils/NormalMapCreator.d.ts +52 -0
- package/lib/@openglobus/js/utils/PlainSegmentWorker.d.ts +24 -0
- package/lib/@openglobus/js/utils/TerrainWorker.d.ts +28 -0
- package/lib/@openglobus/js/utils/TextureAtlas.d.ts +113 -0
- package/lib/@openglobus/js/utils/VectorTileCreator.d.ts +18 -0
- package/lib/@openglobus/js/utils/colorTable.d.ts +3 -0
- package/lib/@openglobus/js/utils/earcut.d.ts +7 -0
- package/lib/@openglobus/js/utils/objParser.d.ts +24 -0
- package/lib/@openglobus/js/utils/shared.d.ts +263 -0
- package/lib/@openglobus/js/utils/units.d.ts +16 -0
- package/lib/@openglobus/js/webgl/BaseFramebuffer.d.ts +53 -0
- package/lib/@openglobus/js/webgl/Framebuffer.d.ts +69 -0
- package/lib/@openglobus/js/webgl/Handler.d.ts +473 -0
- package/lib/@openglobus/js/webgl/Multisample.d.ts +27 -0
- package/lib/@openglobus/js/webgl/Program.d.ts +159 -0
- package/lib/@openglobus/js/webgl/ProgramController.d.ts +86 -0
- package/lib/@openglobus/js/webgl/index.d.ts +6 -0
- package/lib/@openglobus/js/webgl/types.d.ts +9 -0
- package/lib/@openglobus/js/webgl/variableHandlers.d.ts +22 -0
- package/lib/@openglobus/og.css +1 -1
- package/lib/@openglobus/og.esm.js +1 -1
- package/lib/@openglobus/og.esm.js.map +1 -1
- package/lib/@openglobus/og.umd.js +1 -1
- package/lib/@openglobus/og.umd.js.map +1 -1
- package/lib/js/Extent.js +2 -2
- package/lib/js/Globe.d.ts +1 -1
- package/lib/js/Object3d.d.ts +16 -1
- package/lib/js/Object3d.js +66 -1
- package/lib/js/astro/jd.js +26 -26
- package/lib/js/camera/Frustum.d.ts +1 -1
- package/lib/js/camera/Frustum.js +3 -2
- package/lib/js/control/DebugInfo.js +19 -18
- package/lib/js/control/Lighting.d.ts +4 -0
- package/lib/js/control/Lighting.js +51 -12
- package/lib/js/control/SimpleSkyBackground.d.ts +2 -0
- package/lib/js/control/SimpleSkyBackground.js +13 -3
- package/lib/js/control/drawing/PolygonDrawingScene.js +2 -2
- package/lib/js/control/timeline/timelineUtils.js +32 -32
- package/lib/js/control/visibleExtent/drawnode.js +1 -1
- package/lib/js/entity/GeoObject.d.ts +20 -6
- package/lib/js/entity/GeoObject.js +44 -4
- package/lib/js/entity/GeoObjectHandler.d.ts +6 -1
- package/lib/js/entity/GeoObjectHandler.js +58 -6
- package/lib/js/entity/Geometry.d.ts +24 -11
- package/lib/js/entity/Geometry.js +17 -9
- package/lib/js/entity/GeometryHandler.js +5 -5
- package/lib/js/entity/Label.d.ts +7 -0
- package/lib/js/entity/Label.js +11 -0
- package/lib/js/entity/Polyline.d.ts +15 -7
- package/lib/js/entity/Polyline.js +54 -6
- package/lib/js/entity/Strip.d.ts +12 -0
- package/lib/js/entity/Strip.js +16 -0
- package/lib/js/entity/StripHandler.js +1 -1
- package/lib/js/entity/index.d.ts +10 -11
- package/lib/js/entity/index.js +10 -11
- package/lib/js/index.d.ts +5 -5
- package/lib/js/index.js +5 -5
- package/lib/js/layer/Bing.d.ts +4 -0
- package/lib/js/layer/Bing.js +40 -0
- package/lib/js/layer/GeoImage.d.ts +1 -1
- package/lib/js/layer/GeoVideo.d.ts +1 -1
- package/lib/js/layer/Layer.d.ts +1 -1
- package/lib/js/layer/Layer.js +2 -2
- package/lib/js/layer/OpenStreetMap.d.ts +4 -0
- package/lib/js/layer/OpenStreetMap.js +19 -0
- package/lib/js/layer/Vector.d.ts +3 -0
- package/lib/js/layer/Vector.js +3 -3
- package/lib/js/layer/index.d.ts +12 -11
- package/lib/js/layer/index.js +12 -11
- package/lib/js/math/Mat4.js +18 -17
- package/lib/js/mercator.js +2 -1
- package/lib/js/quadTree/EPSG4326QuadTreeStrategy.js +4 -5
- package/lib/js/quadTree/EarthQuadTreeStrategy.d.ts +3 -0
- package/lib/js/quadTree/EarthQuadTreeStrategy.js +40 -5
- package/lib/js/quadTree/EntityCollectionNode.d.ts +2 -2
- package/lib/js/quadTree/EntityCollectionNode.js +13 -14
- package/lib/js/quadTree/MarsQuadTreeStrategy.d.ts +5 -0
- package/lib/js/quadTree/MarsQuadTreeStrategy.js +31 -5
- package/lib/js/quadTree/Node.d.ts +2 -1
- package/lib/js/quadTree/Node.js +38 -28
- package/lib/js/quadTree/QuadTreeStrategy.d.ts +3 -0
- package/lib/js/quadTree/QuadTreeStrategy.js +17 -0
- package/lib/js/quadTree/Wgs84QuadTreeStrategy.js +3 -3
- package/lib/js/renderer/Renderer.js +1 -0
- package/lib/js/scene/Axes.js +4 -4
- package/lib/js/scene/Planet.js +6 -4
- package/lib/js/segment/Segment.d.ts +12 -9
- package/lib/js/segment/Segment.js +47 -24
- package/lib/js/segment/SegmentLonLat.d.ts +1 -5
- package/lib/js/segment/SegmentLonLat.js +8 -100
- package/lib/js/segment/SegmentLonLatWgs84.js +5 -3
- package/lib/js/shaders/billboard.js +4 -4
- package/lib/js/shaders/drawnode.js +16 -19
- package/lib/js/shaders/geoObject.js +10 -11
- package/lib/js/shaders/ray.js +7 -3
- package/lib/js/terrain/BilTerrain.d.ts +1 -1
- package/lib/js/terrain/BilTerrain.js +7 -6
- package/lib/js/terrain/EmptyTerrain.d.ts +7 -0
- package/lib/js/terrain/EmptyTerrain.js +7 -0
- package/lib/js/terrain/GlobusRgbTerrain.d.ts +6 -0
- package/lib/js/terrain/GlobusRgbTerrain.js +25 -0
- package/lib/js/terrain/GlobusTerrain.d.ts +5 -5
- package/lib/js/terrain/GlobusTerrain.js +35 -30
- package/lib/js/terrain/RgbTerrain.d.ts +22 -0
- package/lib/js/terrain/RgbTerrain.js +415 -0
- package/lib/js/terrain/index.d.ts +3 -2
- package/lib/js/terrain/index.js +3 -2
- package/lib/js/ui/Color.d.ts +22 -0
- package/lib/js/ui/Color.js +58 -0
- package/lib/js/utils/GeoImageCreator.js +1 -1
- package/lib/js/utils/NormalMapCreator.js +1 -1
- package/lib/js/utils/VectorTileCreator.js +3 -3
- package/lib/js/utils/objParser.js +3 -3
- package/lib/js/utils/shared.d.ts +3 -9
- package/lib/js/utils/shared.js +24 -9
- package/package.json +26 -18
- package/lib/js/terrain/MapboxTerrain.js +0 -298
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as utils from "../utils/shared";
|
|
2
2
|
import { Quat, Vec3 } from "../math/index";
|
|
3
|
+
import { Object3d } from "../Object3d";
|
|
3
4
|
/**
|
|
4
5
|
* @class
|
|
5
6
|
* @param {Object} options - Geo object parameters:
|
|
@@ -21,15 +22,26 @@ class GeoObject {
|
|
|
21
22
|
this._pitch = options.pitch || 0.0;
|
|
22
23
|
this._yaw = options.yaw || 0.0;
|
|
23
24
|
this._roll = options.roll || 0.0;
|
|
24
|
-
this._scale = options.scale
|
|
25
|
+
this._scale = utils.createVector3(options.scale, new Vec3(1, 1, 1));
|
|
25
26
|
this._color = utils.createColorRGBA(options.color);
|
|
26
27
|
this._direction = new Vec3(0, 1, 0);
|
|
27
28
|
this._handler = null;
|
|
28
29
|
this._handlerIndex = -1;
|
|
29
30
|
this._tagData = null;
|
|
30
31
|
this._tagDataIndex = -1;
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
let object3d = options.object3d;
|
|
33
|
+
if ((!options.object3d || options.object3d?.vertices.length === 0)) {
|
|
34
|
+
object3d = new Object3d();
|
|
35
|
+
}
|
|
36
|
+
if (options.objSrc) {
|
|
37
|
+
this.setObjectSrc(options.objSrc);
|
|
38
|
+
this._objectSrc = options.objSrc;
|
|
39
|
+
}
|
|
40
|
+
this._object3d = object3d;
|
|
41
|
+
if (options.textureSrc) {
|
|
42
|
+
this.setTextureSrc(options.textureSrc);
|
|
43
|
+
}
|
|
44
|
+
this._visibility = (options.visibility != undefined ? options.visibility : true);
|
|
33
45
|
this._qNorthFrame = new Quat();
|
|
34
46
|
}
|
|
35
47
|
get tag() {
|
|
@@ -151,6 +163,25 @@ class GeoObject {
|
|
|
151
163
|
this._yaw = yaw;
|
|
152
164
|
this.updateDirection();
|
|
153
165
|
}
|
|
166
|
+
setObject(object) {
|
|
167
|
+
this._object3d = object;
|
|
168
|
+
}
|
|
169
|
+
setObjectSrc(src) {
|
|
170
|
+
this._objectSrc = src;
|
|
171
|
+
this._handler && this._handler.setObjectSrc(src, this.tag);
|
|
172
|
+
}
|
|
173
|
+
setTextureSrc(src) {
|
|
174
|
+
this._textureSrc = src;
|
|
175
|
+
this._object3d && (this._object3d.src = src);
|
|
176
|
+
this._handler && this._handler.setTextureTag(src, this.tag);
|
|
177
|
+
}
|
|
178
|
+
setColorHTML(color) {
|
|
179
|
+
this.setColor4v(utils.htmlColorToRgba(color));
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
*
|
|
183
|
+
* @param {number} pitch - Pitch in radians
|
|
184
|
+
*/
|
|
154
185
|
setPitch(pitch) {
|
|
155
186
|
this._pitch = pitch;
|
|
156
187
|
this._handler && this._handler.setPitchRollArr(this._tagData, this._tagDataIndex, pitch, this._roll);
|
|
@@ -159,8 +190,17 @@ class GeoObject {
|
|
|
159
190
|
this._roll = roll;
|
|
160
191
|
this._handler && this._handler.setPitchRollArr(this._tagData, this._tagDataIndex, this._pitch, roll);
|
|
161
192
|
}
|
|
193
|
+
setPitchYawRoll(pitch, yaw, roll) {
|
|
194
|
+
this.setPitch(pitch);
|
|
195
|
+
this.setYaw(yaw);
|
|
196
|
+
this.setRoll(roll);
|
|
197
|
+
}
|
|
162
198
|
setScale(scale) {
|
|
163
|
-
this._scale = scale;
|
|
199
|
+
this._scale.x = this._scale.y = this._scale.z = scale;
|
|
200
|
+
this._handler && this._handler.setScaleArr(this._tagData, this._tagDataIndex, this._scale);
|
|
201
|
+
}
|
|
202
|
+
setScale3v(scale) {
|
|
203
|
+
this._scale.copy(scale);
|
|
164
204
|
this._handler && this._handler.setScaleArr(this._tagData, this._tagDataIndex, scale);
|
|
165
205
|
}
|
|
166
206
|
getScale() {
|
|
@@ -5,6 +5,7 @@ import { Planet } from "../scene/Planet";
|
|
|
5
5
|
import { Vec3 } from "../math/Vec3";
|
|
6
6
|
import { Vec4 } from "../math/Vec4";
|
|
7
7
|
import { WebGLBufferExt, WebGLTextureExt } from "../webgl/Handler";
|
|
8
|
+
import { Object3d } from "../Object3d";
|
|
8
9
|
declare class InstanceData {
|
|
9
10
|
isFree: boolean;
|
|
10
11
|
_geoObjectHandler: GeoObjectHandler;
|
|
@@ -12,6 +13,7 @@ declare class InstanceData {
|
|
|
12
13
|
numInstances: number;
|
|
13
14
|
_texture: WebGLTextureExt | null;
|
|
14
15
|
_textureSrc: string | null;
|
|
16
|
+
_objectSrc?: string;
|
|
15
17
|
_pitchRollArr: number[] | TypedArray;
|
|
16
18
|
_sizeArr: number[] | TypedArray;
|
|
17
19
|
_vertexArr: number[] | TypedArray;
|
|
@@ -74,6 +76,9 @@ declare class GeoObjectHandler {
|
|
|
74
76
|
constructor(entityCollection: EntityCollection);
|
|
75
77
|
initProgram(): void;
|
|
76
78
|
setRenderNode(renderNode: Planet): void;
|
|
79
|
+
setTextureTag(src: string, tag: string): void;
|
|
80
|
+
setObjectSrc(src: string, tag: string): void;
|
|
81
|
+
_updateInstanceData(object: Object3d, tag: string): void;
|
|
77
82
|
protected _addGeoObjectToArray(geoObject: GeoObject): void;
|
|
78
83
|
_displayPASS(): void;
|
|
79
84
|
drawPicking(): void;
|
|
@@ -85,7 +90,7 @@ declare class GeoObjectHandler {
|
|
|
85
90
|
setRgbaArr(tagData: InstanceData, tagDataIndex: number, rgba: Vec4): void;
|
|
86
91
|
setPickingColorArr(tagData: InstanceData, tagDataIndex: number, color: Vec3): void;
|
|
87
92
|
setPitchRollArr(tagData: InstanceData, tagDataIndex: number, pitch: number, roll: number): void;
|
|
88
|
-
setScaleArr(tagData: InstanceData, tagDataIndex: number, scale:
|
|
93
|
+
setScaleArr(tagData: InstanceData, tagDataIndex: number, scale: Vec3): void;
|
|
89
94
|
protected _updateTag(dataTag: InstanceData): void;
|
|
90
95
|
update(): void;
|
|
91
96
|
_removeAll(): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as shaders from "../shaders/geoObject";
|
|
2
2
|
import { concatArrays, loadImage, makeArrayTyped, spliceArray } from "../utils/shared";
|
|
3
|
+
import { Object3d } from "../Object3d";
|
|
3
4
|
const VERTEX_BUFFER = 0;
|
|
4
5
|
const POSITION_BUFFER = 1;
|
|
5
6
|
const RGBA_BUFFER = 2;
|
|
@@ -151,10 +152,10 @@ class InstanceData {
|
|
|
151
152
|
h.setStreamArrayBuffer(this._visibleBuffer, this._visibleArr);
|
|
152
153
|
}
|
|
153
154
|
createSizeBuffer() {
|
|
154
|
-
let h = this._geoObjectHandler._planet.renderer.handler, numItems = this._sizeArr.length;
|
|
155
|
+
let h = this._geoObjectHandler._planet.renderer.handler, numItems = this._sizeArr.length / 3;
|
|
155
156
|
if (!this._sizeBuffer || this._sizeBuffer.numItems !== numItems) {
|
|
156
157
|
h.gl.deleteBuffer(this._sizeBuffer);
|
|
157
|
-
this._sizeBuffer = h.createStreamArrayBuffer(
|
|
158
|
+
this._sizeBuffer = h.createStreamArrayBuffer(3, numItems);
|
|
158
159
|
}
|
|
159
160
|
this._sizeArr = makeArrayTyped(this._sizeArr);
|
|
160
161
|
h.setStreamArrayBuffer(this._sizeBuffer, this._sizeArr);
|
|
@@ -267,6 +268,51 @@ class GeoObjectHandler {
|
|
|
267
268
|
}
|
|
268
269
|
this.update();
|
|
269
270
|
}
|
|
271
|
+
setTextureTag(src, tag) {
|
|
272
|
+
const tagData = this._instanceDataMap.get(tag);
|
|
273
|
+
if (tagData) {
|
|
274
|
+
tagData._textureSrc = src;
|
|
275
|
+
this._instanceDataMap.set(tag, tagData);
|
|
276
|
+
this._loadDataTagTexture(tagData);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
setObjectSrc(src, tag) {
|
|
280
|
+
const tagData = this._instanceDataMap.get(tag);
|
|
281
|
+
if (src) {
|
|
282
|
+
if (tagData && tagData._objectSrc !== src) {
|
|
283
|
+
tagData._objectSrc = src;
|
|
284
|
+
Object3d.loadObj(src).then((object3d) => {
|
|
285
|
+
this._updateInstanceData(object3d[0], tag);
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
_updateInstanceData(object, tag) {
|
|
291
|
+
const tagData = this._instanceDataMap.get(tag);
|
|
292
|
+
if (tagData) {
|
|
293
|
+
if (object.vertices.length !== tagData._vertexArr.length) {
|
|
294
|
+
tagData._vertexArr = object.vertices;
|
|
295
|
+
tagData._changedBuffers[VERTEX_BUFFER] = true;
|
|
296
|
+
tagData._changedBuffers[DIRECTION_BUFFER] = true;
|
|
297
|
+
}
|
|
298
|
+
if (object.normals.length !== tagData._normalsArr.length) {
|
|
299
|
+
tagData._normalsArr = object.normals;
|
|
300
|
+
tagData._changedBuffers[NORMALS_BUFFER] = true;
|
|
301
|
+
}
|
|
302
|
+
if (object.indices.length !== tagData._indicesArr.length) {
|
|
303
|
+
tagData._indicesArr = object.indices;
|
|
304
|
+
tagData._changedBuffers[INDEX_BUFFER] = true;
|
|
305
|
+
}
|
|
306
|
+
if (object.texCoords.length !== tagData._texCoordArr.length) {
|
|
307
|
+
tagData._texCoordArr = object.texCoords;
|
|
308
|
+
tagData._changedBuffers[TEXCOORD_BUFFER] = true;
|
|
309
|
+
}
|
|
310
|
+
tagData._textureSrc = object.src;
|
|
311
|
+
this._loadDataTagTexture(tagData);
|
|
312
|
+
this._updateTag(tagData);
|
|
313
|
+
this._instanceDataMapValues = Array.from(this._instanceDataMap.values());
|
|
314
|
+
}
|
|
315
|
+
}
|
|
270
316
|
_addGeoObjectToArray(geoObject) {
|
|
271
317
|
const tag = geoObject.tag;
|
|
272
318
|
let tagData = this._instanceDataMap.get(tag);
|
|
@@ -312,12 +358,17 @@ class GeoObjectHandler {
|
|
|
312
358
|
x = geoObject.getPitch();
|
|
313
359
|
y = geoObject.getRoll();
|
|
314
360
|
tagData._pitchRollArr = concatArrays(tagData._pitchRollArr, setParametersToArray([], 0, itemSize, itemSize, x, y));
|
|
315
|
-
itemSize =
|
|
316
|
-
|
|
361
|
+
itemSize = 3;
|
|
362
|
+
let scale = geoObject.getScale();
|
|
363
|
+
x = scale.x;
|
|
364
|
+
y = scale.y;
|
|
365
|
+
z = scale.z;
|
|
366
|
+
tagData._sizeArr = concatArrays(tagData._sizeArr, setParametersToArray([], 0, itemSize, itemSize, x, y, z));
|
|
317
367
|
}
|
|
318
368
|
_displayPASS() {
|
|
319
369
|
let r = this._planet.renderer, sh = r.handler.programs.geo_object, p = sh._program, u = p.uniforms, a = p.attributes, gl = r.handler.gl, ec = this._entityCollection;
|
|
320
370
|
sh.activate();
|
|
371
|
+
//gl.disable(gl.CULL_FACE);
|
|
321
372
|
//
|
|
322
373
|
// Could be in VAO
|
|
323
374
|
//
|
|
@@ -451,7 +502,7 @@ class GeoObjectHandler {
|
|
|
451
502
|
this._updateTag(tagData);
|
|
452
503
|
}
|
|
453
504
|
setScaleArr(tagData, tagDataIndex, scale) {
|
|
454
|
-
setParametersToArray(tagData._sizeArr, tagDataIndex,
|
|
505
|
+
setParametersToArray(tagData._sizeArr, tagDataIndex, 3, 3, scale.x, scale.y, scale.z);
|
|
455
506
|
tagData._changedBuffers[SIZE_BUFFER] = true;
|
|
456
507
|
this._updateTag(tagData);
|
|
457
508
|
}
|
|
@@ -502,6 +553,7 @@ class GeoObjectHandler {
|
|
|
502
553
|
geoObject.updateDirection();
|
|
503
554
|
geoObject._tagData.refresh();
|
|
504
555
|
this._updateTag(geoObject._tagData);
|
|
556
|
+
geoObject.setObjectSrc(geoObject._objectSrc);
|
|
505
557
|
}
|
|
506
558
|
}
|
|
507
559
|
remove(geoObject) {
|
|
@@ -541,8 +593,8 @@ class GeoObjectHandler {
|
|
|
541
593
|
tagData._positionLowArr = spliceArray(tagData._positionLowArr, tdi * 3, 3);
|
|
542
594
|
tagData._directionArr = spliceArray(tagData._directionArr, tdi * 3, 3);
|
|
543
595
|
tagData._pickingColorArr = spliceArray(tagData._pickingColorArr, tdi * 3, 3);
|
|
596
|
+
tagData._sizeArr = spliceArray(tagData._sizeArr, tdi * 3, 3);
|
|
544
597
|
tagData._pitchRollArr = spliceArray(tagData._pitchRollArr, tdi * 2, 2);
|
|
545
|
-
tagData._sizeArr = spliceArray(tagData._sizeArr, tdi, 1);
|
|
546
598
|
tagData._visibleArr = spliceArray(tagData._visibleArr, tdi, 1);
|
|
547
599
|
geoObject._handlerIndex = -1;
|
|
548
600
|
geoObject._handler = null;
|
|
@@ -4,7 +4,13 @@ import { GeometryHandler } from "./GeometryHandler";
|
|
|
4
4
|
import { NumberArray4, Vec4 } from "../math/Vec4";
|
|
5
5
|
import { NumberArray2 } from "../math/Vec2";
|
|
6
6
|
import { NumberArray3 } from "../math/Vec3";
|
|
7
|
-
declare
|
|
7
|
+
export declare enum GeometryTypeEnum {
|
|
8
|
+
POINT = 1,
|
|
9
|
+
LINESTRING = 2,
|
|
10
|
+
POLYGON = 3,
|
|
11
|
+
MULTIPOLYGON = 4,
|
|
12
|
+
MULTILINESTRING = 5
|
|
13
|
+
}
|
|
8
14
|
export type CoordinatesType = NumberArray2 | NumberArray3;
|
|
9
15
|
export type IPointCoordinates = CoordinatesType;
|
|
10
16
|
export type ILineStringCoordinates = CoordinatesType[];
|
|
@@ -12,11 +18,18 @@ export type IPolygonCoordinates = CoordinatesType[][];
|
|
|
12
18
|
export type IMultiLineStringCoordinates = ILineStringCoordinates[];
|
|
13
19
|
export type IMultiPolygonCoordinates = IPolygonCoordinates[];
|
|
14
20
|
export type IGeometryCoordinates = IPointCoordinates | IPolygonCoordinates | IMultiPolygonCoordinates | ILineStringCoordinates | IMultiLineStringCoordinates;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
export type GeometryTypeToCoordinates = {
|
|
22
|
+
POINT: IPointCoordinates;
|
|
23
|
+
LINESTRING: ILineStringCoordinates;
|
|
24
|
+
POLYGON: IPolygonCoordinates;
|
|
25
|
+
MULTIPOLYGON: IMultiPolygonCoordinates;
|
|
26
|
+
MULTILINESTRING: IMultiLineStringCoordinates;
|
|
27
|
+
};
|
|
28
|
+
interface IGeometry<T extends keyof typeof GeometryTypeEnum = keyof typeof GeometryTypeEnum> {
|
|
29
|
+
type: T;
|
|
30
|
+
coordinates: GeometryTypeToCoordinates[T];
|
|
18
31
|
}
|
|
19
|
-
interface IGeometryStyle {
|
|
32
|
+
export interface IGeometryStyle {
|
|
20
33
|
fillColor?: string | NumberArray4 | Vec4;
|
|
21
34
|
lineColor?: string | NumberArray4 | Vec4;
|
|
22
35
|
strokeColor?: string | NumberArray4 | Vec4;
|
|
@@ -30,9 +43,9 @@ interface IGeometryStyleInternal {
|
|
|
30
43
|
lineWidth: number;
|
|
31
44
|
strokeWidth: number;
|
|
32
45
|
}
|
|
33
|
-
export interface IGeometryParams {
|
|
34
|
-
type?:
|
|
35
|
-
coordinates?:
|
|
46
|
+
export interface IGeometryParams<T extends keyof typeof GeometryTypeEnum = keyof typeof GeometryTypeEnum> {
|
|
47
|
+
type?: T;
|
|
48
|
+
coordinates?: GeometryTypeToCoordinates[T];
|
|
36
49
|
style?: IGeometryStyle;
|
|
37
50
|
visibility?: boolean;
|
|
38
51
|
}
|
|
@@ -65,7 +78,7 @@ declare class Geometry {
|
|
|
65
78
|
_lineIndexesHandlerIndex: number;
|
|
66
79
|
_lineThicknessHandlerIndex: number;
|
|
67
80
|
_lineColorsHandlerIndex: number;
|
|
68
|
-
protected _type:
|
|
81
|
+
protected _type: GeometryTypeEnum;
|
|
69
82
|
_coordinates: IGeometryCoordinates;
|
|
70
83
|
protected _extent: Extent;
|
|
71
84
|
_style: IGeometryStyleInternal;
|
|
@@ -74,7 +87,7 @@ declare class Geometry {
|
|
|
74
87
|
constructor(options?: IGeometryParams);
|
|
75
88
|
get id(): number;
|
|
76
89
|
get type(): number;
|
|
77
|
-
static getType(typeStr:
|
|
90
|
+
static getType(typeStr: keyof typeof GeometryTypeEnum): GeometryTypeEnum;
|
|
78
91
|
/**
|
|
79
92
|
* Returns geometry extent.
|
|
80
93
|
@static
|
|
@@ -108,4 +121,4 @@ declare class Geometry {
|
|
|
108
121
|
getExtent(): Extent;
|
|
109
122
|
getType(): number;
|
|
110
123
|
}
|
|
111
|
-
export { Geometry
|
|
124
|
+
export { Geometry };
|
|
@@ -2,6 +2,14 @@ import * as utils from "../utils/shared";
|
|
|
2
2
|
import { Extent } from "../Extent";
|
|
3
3
|
import { LonLat } from "../LonLat";
|
|
4
4
|
import { Vec4 } from "../math/Vec4";
|
|
5
|
+
export var GeometryTypeEnum;
|
|
6
|
+
(function (GeometryTypeEnum) {
|
|
7
|
+
GeometryTypeEnum[GeometryTypeEnum["POINT"] = 1] = "POINT";
|
|
8
|
+
GeometryTypeEnum[GeometryTypeEnum["LINESTRING"] = 2] = "LINESTRING";
|
|
9
|
+
GeometryTypeEnum[GeometryTypeEnum["POLYGON"] = 3] = "POLYGON";
|
|
10
|
+
GeometryTypeEnum[GeometryTypeEnum["MULTIPOLYGON"] = 4] = "MULTIPOLYGON";
|
|
11
|
+
GeometryTypeEnum[GeometryTypeEnum["MULTILINESTRING"] = 5] = "MULTILINESTRING";
|
|
12
|
+
})(GeometryTypeEnum || (GeometryTypeEnum = {}));
|
|
5
13
|
const GeometryType = {
|
|
6
14
|
POINT: 1,
|
|
7
15
|
LINESTRING: 2,
|
|
@@ -33,10 +41,10 @@ class Geometry {
|
|
|
33
41
|
this._lineIndexesHandlerIndex = -1;
|
|
34
42
|
this._lineThicknessHandlerIndex = -1;
|
|
35
43
|
this._lineColorsHandlerIndex = -1;
|
|
36
|
-
this._type = (options.type && Geometry.getType(options.type)) ||
|
|
37
|
-
this._coordinates = [];
|
|
44
|
+
this._type = (options.type && Geometry.getType(options.type)) || GeometryTypeEnum.POINT;
|
|
45
|
+
this._coordinates = options.coordinates || [];
|
|
38
46
|
this._extent = Geometry.getExtent({
|
|
39
|
-
type: options.type || "
|
|
47
|
+
type: options.type || "POINT",
|
|
40
48
|
coordinates: options.coordinates || []
|
|
41
49
|
}, this._coordinates);
|
|
42
50
|
options.style = options.style || {};
|
|
@@ -70,7 +78,7 @@ class Geometry {
|
|
|
70
78
|
static getExtent(geometryObj, outCoordinates) {
|
|
71
79
|
let res = new Extent(new LonLat(180.0, 90.0), new LonLat(-180.0, -90.0));
|
|
72
80
|
let t = Geometry.getType(geometryObj.type);
|
|
73
|
-
if (t ===
|
|
81
|
+
if (t === GeometryTypeEnum.POINT) {
|
|
74
82
|
let lon = geometryObj.coordinates[0], lat = geometryObj.coordinates[1];
|
|
75
83
|
res.southWest.lon = lon;
|
|
76
84
|
res.southWest.lat = lat;
|
|
@@ -78,7 +86,7 @@ class Geometry {
|
|
|
78
86
|
res.northEast.lat = lat;
|
|
79
87
|
outCoordinates && (outCoordinates[0] = lon) && (outCoordinates[1] = lat);
|
|
80
88
|
}
|
|
81
|
-
else if (t ===
|
|
89
|
+
else if (t === GeometryTypeEnum.LINESTRING) {
|
|
82
90
|
let c = geometryObj.coordinates;
|
|
83
91
|
for (let i = 0; i < c.length; i++) {
|
|
84
92
|
let lon = c[i][0], lat = c[i][1];
|
|
@@ -93,7 +101,7 @@ class Geometry {
|
|
|
93
101
|
outCoordinates && (outCoordinates[i] = [lon, lat]);
|
|
94
102
|
}
|
|
95
103
|
}
|
|
96
|
-
else if (t ===
|
|
104
|
+
else if (t === GeometryTypeEnum.POLYGON) {
|
|
97
105
|
let c = geometryObj.coordinates;
|
|
98
106
|
for (let i = 0; i < c.length; i++) {
|
|
99
107
|
let ci = c[i];
|
|
@@ -113,7 +121,7 @@ class Geometry {
|
|
|
113
121
|
}
|
|
114
122
|
}
|
|
115
123
|
}
|
|
116
|
-
else if (t ===
|
|
124
|
+
else if (t === GeometryTypeEnum.MULTIPOLYGON) {
|
|
117
125
|
let p = geometryObj.coordinates;
|
|
118
126
|
for (let i = 0; i < p.length; i++) {
|
|
119
127
|
let pi = p[i];
|
|
@@ -137,7 +145,7 @@ class Geometry {
|
|
|
137
145
|
}
|
|
138
146
|
}
|
|
139
147
|
}
|
|
140
|
-
else if (t ===
|
|
148
|
+
else if (t === GeometryTypeEnum.MULTILINESTRING) {
|
|
141
149
|
let c = geometryObj.coordinates;
|
|
142
150
|
for (let i = 0; i < c.length; i++) {
|
|
143
151
|
let ci = c[i];
|
|
@@ -280,4 +288,4 @@ class Geometry {
|
|
|
280
288
|
}
|
|
281
289
|
}
|
|
282
290
|
Geometry.__counter__ = 0;
|
|
283
|
-
export { Geometry
|
|
291
|
+
export { Geometry };
|
|
@@ -2,7 +2,7 @@ import * as mercator from "../mercator";
|
|
|
2
2
|
import * as quadTree from "../quadTree/quadTree";
|
|
3
3
|
import { doubleToTwoFloatsV2 } from "../math/coder";
|
|
4
4
|
import { Vec2 } from "../math/Vec2";
|
|
5
|
-
import {
|
|
5
|
+
import { GeometryTypeEnum } from "./Geometry";
|
|
6
6
|
import { earcut, flatten } from "../utils/earcut";
|
|
7
7
|
const POLYVERTICES_BUFFER = 0;
|
|
8
8
|
const POLYINDEXES_BUFFER = 1;
|
|
@@ -203,7 +203,7 @@ class GeometryHandler {
|
|
|
203
203
|
geometry._lineVerticesHighMerc = [];
|
|
204
204
|
geometry._lineVerticesLowMerc = [];
|
|
205
205
|
if (geometry._coordinates[0].length) {
|
|
206
|
-
if (geometry.type ===
|
|
206
|
+
if (geometry.type === GeometryTypeEnum.POLYGON) {
|
|
207
207
|
let coordinates = geometry._coordinates;
|
|
208
208
|
let ci = [];
|
|
209
209
|
for (let j = 0; j < coordinates.length; j++) {
|
|
@@ -249,7 +249,7 @@ class GeometryHandler {
|
|
|
249
249
|
geometry._lineColorsLength = this._lineColors.length - geometry._lineColorsHandlerIndex;
|
|
250
250
|
geometry._lineThicknessLength = this._lineThickness.length - geometry._lineThicknessHandlerIndex;
|
|
251
251
|
}
|
|
252
|
-
else if (geometry.type ===
|
|
252
|
+
else if (geometry.type === GeometryTypeEnum.MULTIPOLYGON) {
|
|
253
253
|
let coordinates = geometry._coordinates;
|
|
254
254
|
let vertices = [], indexes = [];
|
|
255
255
|
// Creates polygon stroke data
|
|
@@ -303,7 +303,7 @@ class GeometryHandler {
|
|
|
303
303
|
geometry._lineColorsLength = this._lineColors.length - geometry._lineColorsHandlerIndex;
|
|
304
304
|
geometry._lineThicknessLength = this._lineThickness.length - geometry._lineThicknessHandlerIndex;
|
|
305
305
|
}
|
|
306
|
-
else if (geometry.type ===
|
|
306
|
+
else if (geometry.type === GeometryTypeEnum.LINESTRING) {
|
|
307
307
|
let coordinates = geometry._coordinates;
|
|
308
308
|
let ci = new Array(coordinates.length);
|
|
309
309
|
for (let j = 0; j < coordinates.length; j++) {
|
|
@@ -322,7 +322,7 @@ class GeometryHandler {
|
|
|
322
322
|
geometry._lineColorsLength = this._lineColors.length - geometry._lineColorsHandlerIndex;
|
|
323
323
|
geometry._lineThicknessLength = this._lineThickness.length - geometry._lineThicknessHandlerIndex;
|
|
324
324
|
}
|
|
325
|
-
else if (geometry.type ===
|
|
325
|
+
else if (geometry.type === GeometryTypeEnum.MULTILINESTRING) {
|
|
326
326
|
let coordinates = geometry._coordinates;
|
|
327
327
|
let ci = [];
|
|
328
328
|
for (let j = 0; j < coordinates.length; j++) {
|
package/lib/js/entity/Label.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface ILabelParams extends IBaseBillboardParams {
|
|
|
6
6
|
text?: string;
|
|
7
7
|
face?: string;
|
|
8
8
|
size?: number;
|
|
9
|
+
opacity?: number;
|
|
9
10
|
outline?: number;
|
|
10
11
|
outlineColor?: string | NumberArray4 | Vec4;
|
|
11
12
|
align?: string;
|
|
@@ -91,6 +92,12 @@ declare class Label extends BaseBillboard {
|
|
|
91
92
|
* It can't be bigger than maximum labelHandler _maxLetters value.
|
|
92
93
|
*/
|
|
93
94
|
setText(text: string): void;
|
|
95
|
+
/**
|
|
96
|
+
* Change text direction.
|
|
97
|
+
* @public
|
|
98
|
+
* @param {boolean} isRTL - Text string.
|
|
99
|
+
*/
|
|
100
|
+
setRtl(isRTL: boolean): void;
|
|
94
101
|
/**
|
|
95
102
|
* Gets current text string.
|
|
96
103
|
* @public
|
package/lib/js/entity/Label.js
CHANGED
|
@@ -63,6 +63,17 @@ class Label extends BaseBillboard {
|
|
|
63
63
|
this._handler.setText(this._handlerIndex, text, this._fontIndex, this._align, this._isRTL);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Change text direction.
|
|
68
|
+
* @public
|
|
69
|
+
* @param {boolean} isRTL - Text string.
|
|
70
|
+
*/
|
|
71
|
+
setRtl(isRTL) {
|
|
72
|
+
this._isRTL = isRTL;
|
|
73
|
+
if (this._isReady && this._handler) {
|
|
74
|
+
this._handler.setText(this._handlerIndex, this._text, this._fontIndex, this._align, this._isRTL);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
66
77
|
/**
|
|
67
78
|
* Gets current text string.
|
|
68
79
|
* @public
|
|
@@ -9,12 +9,13 @@ import { RenderNode } from "../scene/RenderNode";
|
|
|
9
9
|
import { WebGLBufferExt } from "../webgl/Handler";
|
|
10
10
|
import { TypedArray } from "../utils/shared";
|
|
11
11
|
import { Ellipsoid } from "../ellipsoid/Ellipsoid";
|
|
12
|
-
type Geodetic = LonLat | NumberArray2 | NumberArray3;
|
|
13
|
-
type Cartesian = Vec3 | NumberArray3;
|
|
14
|
-
type SegmentPath3vExt = Cartesian[];
|
|
15
|
-
type SegmentPathLonLatExt = Geodetic[];
|
|
16
|
-
type SegmentPathColor = NumberArray4[];
|
|
17
|
-
type
|
|
12
|
+
export type Geodetic = LonLat | NumberArray2 | NumberArray3;
|
|
13
|
+
export type Cartesian = Vec3 | NumberArray3;
|
|
14
|
+
export type SegmentPath3vExt = Cartesian[];
|
|
15
|
+
export type SegmentPathLonLatExt = Geodetic[];
|
|
16
|
+
export type SegmentPathColor = NumberArray4[];
|
|
17
|
+
export type SegmentPath3v = Vec3[];
|
|
18
|
+
export type SegmentPathLonLat = LonLat[];
|
|
18
19
|
export interface IPolylineParams {
|
|
19
20
|
altitude?: number;
|
|
20
21
|
thickness?: number;
|
|
@@ -138,6 +139,7 @@ declare class Polyline {
|
|
|
138
139
|
* @static
|
|
139
140
|
*/
|
|
140
141
|
static appendPoint3v(path3v: SegmentPath3vExt[], point3v: Vec3, pathColors: SegmentPathColor[], color: NumberArray4, isClosed: boolean, outVerticesHigh: number[], outVerticesLow: number[], outColors: number[], outOrders: number[], outIndexes: number[], ellipsoid: Ellipsoid | null, outTransformedPathLonLat: SegmentPathLonLatExt[], outTransformedPathMerc: LonLat[][], outExtent: Extent): void;
|
|
142
|
+
static setPathColors(pathLonLat: SegmentPathLonLatExt[], pathColors: SegmentPathColor[], defaultColor: NumberArray4, outColors: number[]): void;
|
|
141
143
|
/**
|
|
142
144
|
* Appends to the line array new geodetic coordinates line data.
|
|
143
145
|
* @static
|
|
@@ -224,6 +226,12 @@ declare class Polyline {
|
|
|
224
226
|
* @param {number} opacity - Opacity.
|
|
225
227
|
*/
|
|
226
228
|
setOpacity(opacity: number): void;
|
|
229
|
+
/**
|
|
230
|
+
* Sets Polyline thickness in screen pixels.
|
|
231
|
+
* @public
|
|
232
|
+
* @param {number} thickness - Thickness.
|
|
233
|
+
*/
|
|
234
|
+
setAltitude(altitude: number): void;
|
|
227
235
|
/**
|
|
228
236
|
* Sets Polyline thickness in screen pixels.
|
|
229
237
|
* @public
|
|
@@ -284,7 +292,7 @@ declare class Polyline {
|
|
|
284
292
|
* @todo
|
|
285
293
|
* @param {NumberArray4[][]} pathColors
|
|
286
294
|
*/
|
|
287
|
-
setPathColors(pathColors:
|
|
295
|
+
setPathColors(pathColors: SegmentPathColor[]): void;
|
|
288
296
|
/**
|
|
289
297
|
* Sets polyline color
|
|
290
298
|
* @param {string} htmlColor- HTML color
|
|
@@ -376,6 +376,44 @@ class Polyline {
|
|
|
376
376
|
outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
|
|
377
377
|
outOrders.push(1, -1, 2, -2);
|
|
378
378
|
}
|
|
379
|
+
static setPathColors(pathLonLat, pathColors, defaultColor, outColors) {
|
|
380
|
+
for (let j = 0, len = pathLonLat.length; j < len; j++) {
|
|
381
|
+
var path = pathLonLat[j], pathColors_j = pathColors[j];
|
|
382
|
+
if (path.length === 0) {
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
let color = defaultColor;
|
|
386
|
+
if (pathColors_j && pathColors_j[0]) {
|
|
387
|
+
color = pathColors_j[0];
|
|
388
|
+
}
|
|
389
|
+
let r = color[R], g = color[G], b = color[B], a = color[A] != undefined ? color[A] : 1.0;
|
|
390
|
+
if (j > 0) {
|
|
391
|
+
outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
|
|
392
|
+
}
|
|
393
|
+
for (let i = 0, len = path.length; i < len; i++) {
|
|
394
|
+
var cur = path[i];
|
|
395
|
+
if (cur instanceof Array) {
|
|
396
|
+
cur = new LonLat(cur[0], cur[1], cur[2]);
|
|
397
|
+
}
|
|
398
|
+
if (pathColors_j && pathColors_j[i]) {
|
|
399
|
+
color = pathColors_j[i];
|
|
400
|
+
}
|
|
401
|
+
r = color[R];
|
|
402
|
+
g = color[G];
|
|
403
|
+
b = color[B];
|
|
404
|
+
a = color[A] != undefined ? color[A] : 1.0;
|
|
405
|
+
outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
|
|
406
|
+
}
|
|
407
|
+
if (pathColors_j && pathColors_j[path.length - 1]) {
|
|
408
|
+
color = pathColors_j[path.length - 1];
|
|
409
|
+
}
|
|
410
|
+
r = color[R];
|
|
411
|
+
g = color[G];
|
|
412
|
+
b = color[B];
|
|
413
|
+
a = color[A] != undefined ? color[A] : 1.0;
|
|
414
|
+
outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
379
417
|
/**
|
|
380
418
|
* Appends to the line array new geodetic coordinates line data.
|
|
381
419
|
* @static
|
|
@@ -389,10 +427,10 @@ class Polyline {
|
|
|
389
427
|
}
|
|
390
428
|
if (outIndexes.length > 0) {
|
|
391
429
|
index = outIndexes[outIndexes.length - 5] + 9;
|
|
392
|
-
outIndexes.push(index
|
|
430
|
+
outIndexes.push(index);
|
|
393
431
|
}
|
|
394
432
|
else {
|
|
395
|
-
outIndexes.push(0
|
|
433
|
+
outIndexes.push(0);
|
|
396
434
|
}
|
|
397
435
|
for (let j = 0, len = pathLonLat.length; j < len; j++) {
|
|
398
436
|
var path = pathLonLat[j], pathColors_j = pathColors[j];
|
|
@@ -1150,6 +1188,14 @@ class Polyline {
|
|
|
1150
1188
|
setOpacity(opacity) {
|
|
1151
1189
|
this._opacity = opacity;
|
|
1152
1190
|
}
|
|
1191
|
+
/**
|
|
1192
|
+
* Sets Polyline thickness in screen pixels.
|
|
1193
|
+
* @public
|
|
1194
|
+
* @param {number} thickness - Thickness.
|
|
1195
|
+
*/
|
|
1196
|
+
setAltitude(altitude) {
|
|
1197
|
+
this.altitude = altitude;
|
|
1198
|
+
}
|
|
1153
1199
|
/**
|
|
1154
1200
|
* Sets Polyline thickness in screen pixels.
|
|
1155
1201
|
* @public
|
|
@@ -1296,10 +1342,12 @@ class Polyline {
|
|
|
1296
1342
|
* @param {NumberArray4[][]} pathColors
|
|
1297
1343
|
*/
|
|
1298
1344
|
setPathColors(pathColors) {
|
|
1299
|
-
if (
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1345
|
+
if (pathColors) {
|
|
1346
|
+
this._colors = [];
|
|
1347
|
+
this._pathColors = [].concat(pathColors);
|
|
1348
|
+
Polyline.setPathColors(this._pathLonLat, pathColors, this._defaultColor, this._colors);
|
|
1349
|
+
// Mark the colors buffer as changed
|
|
1350
|
+
this._changedBuffers[COLORS_BUFFER] = true;
|
|
1303
1351
|
}
|
|
1304
1352
|
}
|
|
1305
1353
|
/**
|
package/lib/js/entity/Strip.d.ts
CHANGED
|
@@ -80,6 +80,18 @@ declare class Strip {
|
|
|
80
80
|
* @public
|
|
81
81
|
*/
|
|
82
82
|
clear(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Sets RGBA color. Each channel from 0.0 to 1.0.
|
|
85
|
+
* @public
|
|
86
|
+
* @param {Vec4} color - RGBA vector.
|
|
87
|
+
*/
|
|
88
|
+
setColor4v(color: Vec4): void;
|
|
89
|
+
/**
|
|
90
|
+
* Sets strip color.
|
|
91
|
+
* @public
|
|
92
|
+
* @param {string} color - HTML style color.
|
|
93
|
+
*/
|
|
94
|
+
setColorHTML(color: string): void;
|
|
83
95
|
setColor(r: number, g: number, b: number, a?: number): void;
|
|
84
96
|
/**
|
|
85
97
|
* Set strip opacity.
|
package/lib/js/entity/Strip.js
CHANGED
|
@@ -88,6 +88,22 @@ class Strip {
|
|
|
88
88
|
this._indexes = [];
|
|
89
89
|
this._deleteBuffers();
|
|
90
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Sets RGBA color. Each channel from 0.0 to 1.0.
|
|
93
|
+
* @public
|
|
94
|
+
* @param {Vec4} color - RGBA vector.
|
|
95
|
+
*/
|
|
96
|
+
setColor4v(color) {
|
|
97
|
+
this.setColor(color.x, color.y, color.z, color.w);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Sets strip color.
|
|
101
|
+
* @public
|
|
102
|
+
* @param {string} color - HTML style color.
|
|
103
|
+
*/
|
|
104
|
+
setColorHTML(color) {
|
|
105
|
+
this.setColor4v(utils.htmlColorToRgba(color));
|
|
106
|
+
}
|
|
91
107
|
setColor(r, g, b, a) {
|
|
92
108
|
a = a || this.color[3];
|
|
93
109
|
this.color[0] = r;
|
|
@@ -37,7 +37,7 @@ class StripHandler {
|
|
|
37
37
|
mat4 viewMatrixRTE = viewMatrix;
|
|
38
38
|
viewMatrixRTE[3] = vec4(0.0, 0.0, 0.0, 1.0);
|
|
39
39
|
|
|
40
|
-
gl_Position = projectionMatrix * viewMatrixRTE * vec4(highDiff + lowDiff, 1.0);
|
|
40
|
+
gl_Position = projectionMatrix * viewMatrixRTE * vec4(highDiff * step(1.0, length(highDiff)) + lowDiff, 1.0);
|
|
41
41
|
}`,
|
|
42
42
|
fragmentShader: `precision highp float;
|
|
43
43
|
uniform vec4 uColor;
|