@openglobus/og 0.19.4 → 0.20.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 +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} +5 -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 +8 -1
- package/lib/js/Object3d.js +12 -2
- 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/visibleExtent/drawnode.js +1 -1
- package/lib/js/entity/GeoObject.d.ts +12 -3
- package/lib/js/entity/GeoObject.js +34 -2
- package/lib/js/entity/GeoObjectHandler.d.ts +5 -0
- package/lib/js/entity/GeoObjectHandler.js +47 -0
- 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/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 +4 -5
- 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/shared.d.ts +1 -8
- package/lib/js/utils/shared.js +17 -8
- package/package.json +2 -1
- package/lib/js/terrain/MapboxTerrain.js +0 -305
package/lib/js/terrain/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BilTerrain } from './BilTerrain';
|
|
2
2
|
import { EmptyTerrain } from './EmptyTerrain';
|
|
3
3
|
import { GlobusTerrain } from './GlobusTerrain';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { RgbTerrain } from './RgbTerrain';
|
|
5
|
+
import { GlobusRgbTerrain } from './GlobusRgbTerrain';
|
|
6
|
+
export { EmptyTerrain, GlobusTerrain, RgbTerrain, BilTerrain, GlobusRgbTerrain };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EventsHandler } from "../Events";
|
|
2
|
+
import { IViewParams, View, ViewEventsList } from './View';
|
|
3
|
+
interface IColorParams extends IViewParams {
|
|
4
|
+
label?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
}
|
|
7
|
+
type ColorEventsList = ["input"];
|
|
8
|
+
declare class Color extends View<null> {
|
|
9
|
+
events: EventsHandler<ColorEventsList> & EventsHandler<ViewEventsList>;
|
|
10
|
+
protected _value: string;
|
|
11
|
+
protected $label: HTMLElement | null;
|
|
12
|
+
protected $input: HTMLInputElement | null;
|
|
13
|
+
constructor(options?: IColorParams);
|
|
14
|
+
render(params: any): this;
|
|
15
|
+
set value(val: string);
|
|
16
|
+
get value(): string;
|
|
17
|
+
protected _initEvents(): void;
|
|
18
|
+
protected _clearEvents(): void;
|
|
19
|
+
protected _onInput: (e: Event) => void;
|
|
20
|
+
remove(): void;
|
|
21
|
+
}
|
|
22
|
+
export { Color };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { View } from './View';
|
|
2
|
+
import { stringTemplate } from '../utils/shared';
|
|
3
|
+
const COLOR_EVENTS = ["input"];
|
|
4
|
+
const TEMPLATE = `<div class="og-color">
|
|
5
|
+
<label for="{id}" class="og-color-label">{label}</label>
|
|
6
|
+
<input type="color" name="{id}" value="{value}"/>
|
|
7
|
+
</div>`;
|
|
8
|
+
let __labelCounter__ = 0;
|
|
9
|
+
class Color extends View {
|
|
10
|
+
constructor(options = {}) {
|
|
11
|
+
super({
|
|
12
|
+
template: stringTemplate(TEMPLATE, {
|
|
13
|
+
id: `color-${__labelCounter__++}`,
|
|
14
|
+
label: options.label || ""
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
this._onInput = (e) => {
|
|
18
|
+
//@ts-ignore
|
|
19
|
+
this.value = e.target.value;
|
|
20
|
+
};
|
|
21
|
+
//@ts-ignore
|
|
22
|
+
this.events = this.events.registerNames(COLOR_EVENTS);
|
|
23
|
+
this._value = options.value || "blue";
|
|
24
|
+
this.$label = null;
|
|
25
|
+
this.$input = null;
|
|
26
|
+
}
|
|
27
|
+
render(params) {
|
|
28
|
+
super.render(params);
|
|
29
|
+
this.$label = this.select(".og-color-label");
|
|
30
|
+
if (this.$label.innerHTML === "") {
|
|
31
|
+
this.$label.style.display = "none";
|
|
32
|
+
}
|
|
33
|
+
this.$input = this.select("input");
|
|
34
|
+
this._initEvents();
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
set value(val) {
|
|
38
|
+
if (val !== this._value) {
|
|
39
|
+
this._value = val;
|
|
40
|
+
this.$input.value = this._value;
|
|
41
|
+
this.events.dispatch(this.events.input, this._value, this);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
get value() {
|
|
45
|
+
return this._value;
|
|
46
|
+
}
|
|
47
|
+
_initEvents() {
|
|
48
|
+
this.$input.addEventListener("input", this._onInput);
|
|
49
|
+
}
|
|
50
|
+
_clearEvents() {
|
|
51
|
+
this.$input.removeEventListener("input", this._onInput);
|
|
52
|
+
}
|
|
53
|
+
remove() {
|
|
54
|
+
this._clearEvents();
|
|
55
|
+
super.remove();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export { Color };
|
|
@@ -145,7 +145,7 @@ export class GeoImageCreator {
|
|
|
145
145
|
v_texCoords = texCoords;
|
|
146
146
|
vec2 highDiff = cornersHigh - extentParamsHigh.xy;
|
|
147
147
|
vec2 lowDiff = cornersLow - extentParamsLow.xy;
|
|
148
|
-
gl_Position = vec4((-1.0 + (highDiff + lowDiff) * extentParamsHigh.zw) * vec2(1.0, -1.0), 0.0, 1.0);
|
|
148
|
+
gl_Position = vec4((-1.0 + (highDiff * step(1.0, length(highDiff)) + lowDiff) * extentParamsHigh.zw) * vec2(1.0, -1.0), 0.0, 1.0);
|
|
149
149
|
}`,
|
|
150
150
|
fragmentShader: `precision highp float;
|
|
151
151
|
uniform sampler2D sourceTexture;
|
|
@@ -108,7 +108,7 @@ export class NormalMapCreator {
|
|
|
108
108
|
this._normalMapVerticesTexture = this._handler.createEmptyTexture_l(this._width, this._height);
|
|
109
109
|
//create vertices hasharray for different grid size segments from 2^4(16) to 2^7(128)
|
|
110
110
|
for (let p = this._minTabelSize; p <= this._maxTableSize; p++) {
|
|
111
|
-
const gs = Math.pow(2, p);
|
|
111
|
+
const gs = (1 << p); //Math.pow(2, p);
|
|
112
112
|
const gs2 = gs / 2;
|
|
113
113
|
let vertices = new Float32Array((gs + 1) * (gs + 1) * 2);
|
|
114
114
|
for (let i = 0; i <= gs; i++) {
|
|
@@ -55,8 +55,8 @@ export class VectorTileCreator {
|
|
|
55
55
|
|
|
56
56
|
vec2 proj(vec2 coordHigh, vec2 coordLow) {
|
|
57
57
|
vec2 highDiff = coordHigh - extentParamsHigh.xy;
|
|
58
|
-
vec2 lowDiff = coordLow - extentParamsLow.xy;
|
|
59
|
-
return vec2(-1.0 + (highDiff + lowDiff) * extentParamsHigh.zw) * vec2(1.0, -1.0);
|
|
58
|
+
vec2 lowDiff = coordLow - extentParamsLow.xy;
|
|
59
|
+
return vec2(-1.0 + (highDiff * step(1.0, length(highDiff)) + lowDiff) * extentParamsHigh.zw) * vec2(1.0, -1.0);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
void main(){
|
|
@@ -149,7 +149,7 @@ export class VectorTileCreator {
|
|
|
149
149
|
vec2 proj(vec2 coordHigh, vec2 coordLow) {
|
|
150
150
|
vec2 highDiff = coordHigh - extentParamsHigh.xy;
|
|
151
151
|
vec2 lowDiff = coordLow - extentParamsLow.xy;
|
|
152
|
-
return vec2(-1.0 + (highDiff + lowDiff) * extentParamsHigh.zw) * vec2(1.0, -1.0);
|
|
152
|
+
return vec2(-1.0 + (highDiff * step(1.0, length(highDiff)) + lowDiff) * extentParamsHigh.zw) * vec2(1.0, -1.0);
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
void main() {
|
package/lib/js/utils/shared.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare function isUndef(obj?: any): boolean;
|
|
|
19
19
|
export declare function isUndefExt(obj: any, defVal: any): any;
|
|
20
20
|
export declare function stamp(obj: any): number;
|
|
21
21
|
export declare function isString(s: any): boolean;
|
|
22
|
+
export declare function rgbToStringHTML(rgb: NumberArray3 | Vec3): string;
|
|
22
23
|
/**
|
|
23
24
|
* Convert html color string to the RGBA number vector.
|
|
24
25
|
* @param {string} htmlColor - HTML string("#C6C6C6" or "#EF5" or "rgb(8,8,8)" or "rgba(8,8,8)") color.
|
|
@@ -240,14 +241,6 @@ export declare function getMatrixSubArray64(sourceArr: TypedArray | number[], gr
|
|
|
240
241
|
export declare function getMatrixSubArray32(sourceArr: TypedArray | number[], gridSize: number, i0: number, j0: number, size: number): Float32Array;
|
|
241
242
|
/**
|
|
242
243
|
* Returns two float32 triangle coordinate arrays from inside of the source triangle array.
|
|
243
|
-
* @static
|
|
244
|
-
* @param {Array.<number>} sourceArr - Source array
|
|
245
|
-
* @param {number} gridSize - Source array square matrix size
|
|
246
|
-
* @param {number} i0 - First row index source array matrix
|
|
247
|
-
* @param {number} j0 - First column index
|
|
248
|
-
* @param {number} size - Square matrix result size.
|
|
249
|
-
* @param {object} outBounds - Output bounds.
|
|
250
|
-
* @return{Array.<number>} Triangle coordinates array from the source array.
|
|
251
244
|
* @TODO: optimization
|
|
252
245
|
*/
|
|
253
246
|
export declare function getMatrixSubArrayBoundsExt(sourceArr: TypedArray | number[], sourceArrHigh: TypedArray | number[], sourceArrLow: TypedArray | number[], noDataVertices: TypedArray | number[] | undefined, gridSize: number, i0: number, j0: number, size: number, outArr: TypedArray | number[], outArrHigh: TypedArray | number[], outArrLow: TypedArray | number[], outBounds: any, outNoDataVertices: TypedArray | number[]): void;
|
package/lib/js/utils/shared.js
CHANGED
|
@@ -36,6 +36,23 @@ export function stamp(obj) {
|
|
|
36
36
|
export function isString(s) {
|
|
37
37
|
return typeof s === "string" || s instanceof String;
|
|
38
38
|
}
|
|
39
|
+
function d2h(val) {
|
|
40
|
+
return val.toString(16).padStart(2, '0');
|
|
41
|
+
}
|
|
42
|
+
export function rgbToStringHTML(rgb) {
|
|
43
|
+
let r, g, b;
|
|
44
|
+
if (rgb instanceof Array) {
|
|
45
|
+
r = d2h(rgb[0]);
|
|
46
|
+
g = d2h(rgb[1]);
|
|
47
|
+
b = d2h(rgb[2]);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
r = d2h(rgb.x);
|
|
51
|
+
g = d2h(rgb.y);
|
|
52
|
+
b = d2h(rgb.z);
|
|
53
|
+
}
|
|
54
|
+
return `#${r}${g}${b}`;
|
|
55
|
+
}
|
|
39
56
|
/**
|
|
40
57
|
* Convert html color string to the RGBA number vector.
|
|
41
58
|
* @param {string} htmlColor - HTML string("#C6C6C6" or "#EF5" or "rgb(8,8,8)" or "rgba(8,8,8)") color.
|
|
@@ -803,14 +820,6 @@ export function getMatrixSubArray32(sourceArr, gridSize, i0, j0, size) {
|
|
|
803
820
|
}
|
|
804
821
|
/**
|
|
805
822
|
* Returns two float32 triangle coordinate arrays from inside of the source triangle array.
|
|
806
|
-
* @static
|
|
807
|
-
* @param {Array.<number>} sourceArr - Source array
|
|
808
|
-
* @param {number} gridSize - Source array square matrix size
|
|
809
|
-
* @param {number} i0 - First row index source array matrix
|
|
810
|
-
* @param {number} j0 - First column index
|
|
811
|
-
* @param {number} size - Square matrix result size.
|
|
812
|
-
* @param {object} outBounds - Output bounds.
|
|
813
|
-
* @return{Array.<number>} Triangle coordinates array from the source array.
|
|
814
823
|
* @TODO: optimization
|
|
815
824
|
*/
|
|
816
825
|
export function getMatrixSubArrayBoundsExt(sourceArr, sourceArrHigh, sourceArrLow, noDataVertices, gridSize, i0, j0, size, outArr, outArrHigh, outArrLow, outBounds, outNoDataVertices) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openglobus/og",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"description": "[openglobus](https://www.openglobus.org/) is a javascript/typescript library designed to display interactive 3d maps and planets with map tiles, imagery and vector data, markers, and 3D objects. It uses the WebGL technology, open source, and completely free.",
|
|
5
5
|
"directories": {
|
|
6
6
|
"example": "./sandbox"
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"style": "./css/og.css",
|
|
11
11
|
"scripts": {
|
|
12
12
|
"docs": "jsdoc -r ./src/ -c ./jsdoc.conf.json -d ./docs",
|
|
13
|
+
"serve_docs": "cd docs; ws -p 8088",
|
|
13
14
|
"serve": "ws -p 8080",
|
|
14
15
|
"build": "rollup -c --bundleConfigAsCjs",
|
|
15
16
|
"clean": "rm -rf ./lib ./docs",
|
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
import * as mercator from "../mercator";
|
|
2
|
-
import { getTileExtent } from "../mercator";
|
|
3
|
-
import { GlobusTerrain } from "./GlobusTerrain";
|
|
4
|
-
import { isPowerOfTwo } from "../math";
|
|
5
|
-
import { Layer } from "../layer/Layer";
|
|
6
|
-
import { binarySearchFast } from "../utils/shared";
|
|
7
|
-
/**
|
|
8
|
-
* The key doesn't work; just an example!
|
|
9
|
-
*/
|
|
10
|
-
const KEY = "pk.eyJ1IjoiZm94bXVsZGVyODMiLCJhIjoiY2pqYmR3dG5oM2Z1bzNrczJqYm5pODhuNSJ9.Y4DRmEPhb-XSlCR9CAXACQ";
|
|
11
|
-
const rgb2Height = (r, g, b) => {
|
|
12
|
-
return -10000 + 0.1 * (r * 256 * 256 + g * 256 + b);
|
|
13
|
-
};
|
|
14
|
-
class MapboxTerrain extends GlobusTerrain {
|
|
15
|
-
constructor(name, options = {}) {
|
|
16
|
-
super(name || "MapboxTerrain", {
|
|
17
|
-
equalizeVertices: options.equalizeVertices != undefined ? options.equalizeVertices : true,
|
|
18
|
-
maxZoom: options.maxZoom || 17,
|
|
19
|
-
noDataValues: options.noDataValues || [-65537, -10000],
|
|
20
|
-
plainGridSize: options.plainGridSize || 128,
|
|
21
|
-
url: options.url != undefined
|
|
22
|
-
? options.url
|
|
23
|
-
: `//api.mapbox.com/v4/mapbox.terrain-rgb/{z}/{x}/{y}.pngraw?access_token=${options.key || KEY}`,
|
|
24
|
-
gridSizeByZoom: options.gridSizeByZoom || [
|
|
25
|
-
64, 32, 16, 8, 8, 8, 8, 16, 16, 16, 16, 16, 32, 16, 32, 16, 32, 16, 32, 16, 8, 4
|
|
26
|
-
],
|
|
27
|
-
...options
|
|
28
|
-
});
|
|
29
|
-
this.equalizeNormals = options.equalizeNormals || false;
|
|
30
|
-
this._dataType = "imageBitmap";
|
|
31
|
-
this._imageSize = options.imageSize || 256;
|
|
32
|
-
this._ctx = this._createTemporalCanvas(this._imageSize);
|
|
33
|
-
this._imageDataCache = {};
|
|
34
|
-
}
|
|
35
|
-
static checkNoDataValue(noDataValues, value) {
|
|
36
|
-
if (value > 50000) {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
return binarySearchFast(noDataValues, value) !== -1;
|
|
40
|
-
}
|
|
41
|
-
isBlur(segment) {
|
|
42
|
-
return segment.tileZoom >= 16;
|
|
43
|
-
}
|
|
44
|
-
_createTemporalCanvas(size) {
|
|
45
|
-
let canvas = document.createElement("canvas");
|
|
46
|
-
canvas.width = size;
|
|
47
|
-
canvas.height = size;
|
|
48
|
-
return canvas.getContext("2d", {
|
|
49
|
-
willReadFrequently: true
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
_createHeights(data, tileIndex, tileX, tileY, tileZoom, extent, preventChildren) {
|
|
53
|
-
this._ctx.clearRect(0, 0, this._imageSize, this._imageSize);
|
|
54
|
-
this._ctx.drawImage(data, 0, 0);
|
|
55
|
-
let rgbaData = this._ctx.getImageData(0, 0, this._imageSize, this._imageSize).data;
|
|
56
|
-
const SIZE = data.width;
|
|
57
|
-
//
|
|
58
|
-
//Non-power of two images
|
|
59
|
-
//
|
|
60
|
-
if (!isPowerOfTwo(this._imageSize) && SIZE === this._imageSize) {
|
|
61
|
-
let outCurrenElevations = new Float32Array(SIZE * SIZE);
|
|
62
|
-
extractElevationTilesMapboxNonPowerOfTwo(rgbaData, outCurrenElevations, this._heightFactor);
|
|
63
|
-
return outCurrenElevations;
|
|
64
|
-
}
|
|
65
|
-
if (this._imageSize === this.plainGridSize) {
|
|
66
|
-
let elevationsSize = (this.plainGridSize + 1) * (this.plainGridSize + 1);
|
|
67
|
-
let outCurrenElevations = new Float32Array(elevationsSize);
|
|
68
|
-
for (let k = 0, len = this._imageSize * this._imageSize; k < len; k++) {
|
|
69
|
-
let j = k % this._imageSize, i = Math.floor(k / this._imageSize);
|
|
70
|
-
let fromInd4 = k * 4;
|
|
71
|
-
let h = this._heightFactor * rgb2Height(rgbaData[fromInd4], rgbaData[fromInd4 + 1], rgbaData[fromInd4 + 2]);
|
|
72
|
-
outCurrenElevations[i * (this._imageSize + 1) + j] = h;
|
|
73
|
-
}
|
|
74
|
-
for (let i = 0, len = this._imageSize; i < len; i++) {
|
|
75
|
-
let j = this._imageSize - 1;
|
|
76
|
-
let fromInd4 = (i * this._imageSize + j) * 4;
|
|
77
|
-
let h = this._heightFactor * rgb2Height(rgbaData[fromInd4], rgbaData[fromInd4 + 1], rgbaData[fromInd4 + 2]);
|
|
78
|
-
outCurrenElevations[i * (this._imageSize + 1) + this._imageSize] = h;
|
|
79
|
-
}
|
|
80
|
-
for (let j = 0, len = this._imageSize; j < len; j++) {
|
|
81
|
-
let i = this._imageSize - 1;
|
|
82
|
-
let fromInd4 = (i * this._imageSize + j) * 4;
|
|
83
|
-
let h = this._heightFactor * rgb2Height(rgbaData[fromInd4], rgbaData[fromInd4 + 1], rgbaData[fromInd4 + 2]);
|
|
84
|
-
outCurrenElevations[this._imageSize * (this._imageSize + 1) + j] = h;
|
|
85
|
-
}
|
|
86
|
-
let h = this._heightFactor * rgb2Height(rgbaData[rgbaData.length - 4], rgbaData[rgbaData.length - 3], rgbaData[rgbaData.length - 2]);
|
|
87
|
-
outCurrenElevations[outCurrenElevations.length - 1] = h;
|
|
88
|
-
return outCurrenElevations;
|
|
89
|
-
}
|
|
90
|
-
//
|
|
91
|
-
// Power of two images
|
|
92
|
-
//
|
|
93
|
-
let elevationsSize = (this.plainGridSize + 1) * (this.plainGridSize + 1);
|
|
94
|
-
let d = SIZE / this.plainGridSize;
|
|
95
|
-
let outCurrenElevations = new Float32Array(elevationsSize);
|
|
96
|
-
let outChildrenElevations = new Array(d);
|
|
97
|
-
for (let i = 0; i < d; i++) {
|
|
98
|
-
outChildrenElevations[i] = [];
|
|
99
|
-
for (let j = 0; j < d; j++) {
|
|
100
|
-
outChildrenElevations[i][j] = new Float32Array(elevationsSize);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (preventChildren) {
|
|
104
|
-
extractElevationTilesMapboxNoChildren(rgbaData, this._heightFactor, this.noDataValues, outCurrenElevations);
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
extractElevationTilesMapbox(rgbaData, this._heightFactor, this.noDataValues, outCurrenElevations, outChildrenElevations);
|
|
108
|
-
}
|
|
109
|
-
this._elevationCache[tileIndex] = {
|
|
110
|
-
heights: outCurrenElevations,
|
|
111
|
-
extent: extent //segment.getExtent()
|
|
112
|
-
};
|
|
113
|
-
if (!preventChildren) {
|
|
114
|
-
for (let i = 0; i < d; i++) {
|
|
115
|
-
for (let j = 0; j < d; j++) {
|
|
116
|
-
let x = tileX * 2 + j, y = tileY * 2 + i, z = tileZoom + 1;
|
|
117
|
-
let tileIndex = Layer.getTileIndex(x, y, z);
|
|
118
|
-
this._elevationCache[tileIndex] = {
|
|
119
|
-
heights: outChildrenElevations[i][j],
|
|
120
|
-
extent: getTileExtent(x, y, z)
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return outCurrenElevations;
|
|
126
|
-
}
|
|
127
|
-
getHeightAsync(lonLat, callback, zoom) {
|
|
128
|
-
if (!lonLat || lonLat.lat > mercator.MAX_LAT || lonLat.lat < mercator.MIN_LAT) {
|
|
129
|
-
callback(0);
|
|
130
|
-
return true;
|
|
131
|
-
}
|
|
132
|
-
let z = zoom || this.maxZoom, size = mercator.POLE2 / Math.pow(2, z), merc = mercator.forward(lonLat), x = Math.floor((mercator.POLE + merc.lon) / size), y = Math.floor((mercator.POLE - merc.lat) / size);
|
|
133
|
-
let tileIndex = Layer.getTileIndex(x, y, z), extent = mercator.getTileExtent(x, y, z);
|
|
134
|
-
let sizeImgW = extent.getWidth() / (this._imageSize - 1), sizeImgH = extent.getHeight() / (this._imageSize - 1);
|
|
135
|
-
let i = this._imageSize - Math.ceil((merc.lat - extent.southWest.lat) / sizeImgH) - 1, j = Math.floor((merc.lon - extent.southWest.lon) / sizeImgW);
|
|
136
|
-
let index = (i * this._imageSize + j) * 4;
|
|
137
|
-
if (this._imageDataCache[tileIndex]) {
|
|
138
|
-
let data = this._imageDataCache[tileIndex];
|
|
139
|
-
callback(this._heightFactor * rgb2Height(data[index], data[index + 1], data[index + 2]));
|
|
140
|
-
return true;
|
|
141
|
-
}
|
|
142
|
-
if (!this._fetchCache[tileIndex]) {
|
|
143
|
-
let url = this._buildURL(x, y, z);
|
|
144
|
-
this._fetchCache[tileIndex] = this._loader.fetch({
|
|
145
|
-
src: url,
|
|
146
|
-
type: this._dataType
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
this._fetchCache[tileIndex].then((response) => {
|
|
150
|
-
if (response.status === "ready") {
|
|
151
|
-
this._ctx.clearRect(0, 0, this._imageSize, this._imageSize);
|
|
152
|
-
this._ctx.drawImage(response.data, 0, 0);
|
|
153
|
-
let data = this._ctx.getImageData(0, 0, 256, 256).data;
|
|
154
|
-
this._imageDataCache[tileIndex] = data;
|
|
155
|
-
callback(this._heightFactor * rgb2Height(data[index], data[index + 1], data[index + 2]));
|
|
156
|
-
}
|
|
157
|
-
else if (response.status === "error") {
|
|
158
|
-
callback(0);
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
//@ts-ignore
|
|
162
|
-
this._fetchCache[tileIndex] = null;
|
|
163
|
-
delete this._fetchCache[tileIndex];
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
return false;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
function extractElevationTilesMapboxNonPowerOfTwo(rgbaData, outCurrenElevations, heightFactor = 1) {
|
|
170
|
-
for (let i = 0, len = outCurrenElevations.length; i < len; i++) {
|
|
171
|
-
let i4 = i * 4;
|
|
172
|
-
outCurrenElevations[i] = heightFactor * rgb2Height(rgbaData[i4], rgbaData[i4 + 1], rgbaData[i4 + 2]);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
function extractElevationTilesMapbox(rgbaData, heightFactor, noDataValues, outCurrenElevations, outChildrenElevations) {
|
|
176
|
-
let destSize = Math.sqrt(outCurrenElevations.length) - 1;
|
|
177
|
-
let destSizeOne = destSize + 1;
|
|
178
|
-
let sourceSize = Math.sqrt(rgbaData.length / 4);
|
|
179
|
-
let dt = sourceSize / destSize;
|
|
180
|
-
let rightHeight = 0, bottomHeight = 0, sourceSize4 = 0;
|
|
181
|
-
for (let k = 0, currIndex = 0, sourceDataLength = rgbaData.length / 4; k < sourceDataLength; k++) {
|
|
182
|
-
let k4 = k * 4;
|
|
183
|
-
let height = heightFactor * rgb2Height(rgbaData[k4], rgbaData[k4 + 1], rgbaData[k4 + 2]);
|
|
184
|
-
let isNoDataCurrent = MapboxTerrain.checkNoDataValue(noDataValues, height), isNoDataRight = false, isNoDataBottom = false;
|
|
185
|
-
let i = Math.floor(k / sourceSize), j = k % sourceSize;
|
|
186
|
-
let tileX = Math.floor(j / destSize), tileY = Math.floor(i / destSize);
|
|
187
|
-
let destArr = outChildrenElevations[tileY][tileX];
|
|
188
|
-
let ii = i % destSize, jj = j % destSize;
|
|
189
|
-
let destIndex = (ii + tileY) * destSizeOne + jj + tileX;
|
|
190
|
-
destArr[destIndex] = height;
|
|
191
|
-
if ((i + tileY) % dt === 0 && (j + tileX) % dt === 0) {
|
|
192
|
-
outCurrenElevations[currIndex++] = height;
|
|
193
|
-
}
|
|
194
|
-
if ((j + 1) % destSize === 0 && j !== sourceSize - 1) {
|
|
195
|
-
//current tile
|
|
196
|
-
rightHeight = heightFactor * rgb2Height(rgbaData[k4 + 4], rgbaData[k4 + 5], rgbaData[k4 + 6]);
|
|
197
|
-
isNoDataRight = MapboxTerrain.checkNoDataValue(noDataValues, rightHeight);
|
|
198
|
-
let middleHeight = height;
|
|
199
|
-
if (!(isNoDataCurrent || isNoDataRight)) {
|
|
200
|
-
middleHeight = (height + rightHeight) * 0.5;
|
|
201
|
-
}
|
|
202
|
-
destIndex = (ii + tileY) * destSizeOne + jj + 1;
|
|
203
|
-
destArr[destIndex] = middleHeight;
|
|
204
|
-
if ((i + tileY) % dt === 0) {
|
|
205
|
-
outCurrenElevations[currIndex++] = middleHeight;
|
|
206
|
-
}
|
|
207
|
-
//next right tile
|
|
208
|
-
let rightindex = (ii + tileY) * destSizeOne + ((jj + 1) % destSize);
|
|
209
|
-
outChildrenElevations[tileY][tileX + 1][rightindex] = middleHeight;
|
|
210
|
-
}
|
|
211
|
-
if ((i + 1) % destSize === 0 && i !== sourceSize - 1) {
|
|
212
|
-
//current tile
|
|
213
|
-
sourceSize4 = sourceSize * 4;
|
|
214
|
-
bottomHeight = heightFactor * rgb2Height(rgbaData[k4 + sourceSize4], rgbaData[k4 + sourceSize4 + 1], rgbaData[k4 + sourceSize4 + 2]);
|
|
215
|
-
isNoDataBottom = MapboxTerrain.checkNoDataValue(noDataValues, bottomHeight);
|
|
216
|
-
let middleHeight = (height + bottomHeight) * 0.5;
|
|
217
|
-
if (!(isNoDataCurrent || isNoDataBottom)) {
|
|
218
|
-
middleHeight = (height + bottomHeight) * 0.5;
|
|
219
|
-
}
|
|
220
|
-
destIndex = (ii + 1) * destSizeOne + jj + tileX;
|
|
221
|
-
destArr[destIndex] = middleHeight;
|
|
222
|
-
if ((j + tileX) % dt === 0) {
|
|
223
|
-
outCurrenElevations[currIndex++] = middleHeight;
|
|
224
|
-
}
|
|
225
|
-
//next bottom tile
|
|
226
|
-
let bottomindex = ((ii + 1) % destSize) * destSizeOne + jj + tileX;
|
|
227
|
-
outChildrenElevations[tileY + 1][tileX][bottomindex] = middleHeight;
|
|
228
|
-
}
|
|
229
|
-
if ((j + 1) % destSize === 0 && j !== sourceSize - 1 &&
|
|
230
|
-
(i + 1) % destSize === 0 && i !== sourceSize - 1) {
|
|
231
|
-
//current tile
|
|
232
|
-
let rightBottomHeight = heightFactor * rgb2Height(rgbaData[k4 + sourceSize4 + 4], rgbaData[k4 + sourceSize4 + 5], rgbaData[k4 + sourceSize4 + 6]);
|
|
233
|
-
let isNoDataRightBottom = MapboxTerrain.checkNoDataValue(noDataValues, rightBottomHeight);
|
|
234
|
-
let middleHeight = height;
|
|
235
|
-
if (!(isNoDataCurrent || isNoDataRight || isNoDataBottom || isNoDataRightBottom)) {
|
|
236
|
-
middleHeight = (height + rightHeight + bottomHeight + rightBottomHeight) * 0.25;
|
|
237
|
-
}
|
|
238
|
-
destIndex = (ii + 1) * destSizeOne + (jj + 1);
|
|
239
|
-
destArr[destIndex] = middleHeight;
|
|
240
|
-
outCurrenElevations[currIndex++] = middleHeight;
|
|
241
|
-
//next right tile
|
|
242
|
-
let rightindex = (ii + 1) * destSizeOne;
|
|
243
|
-
outChildrenElevations[tileY][tileX + 1][rightindex] = middleHeight;
|
|
244
|
-
//next bottom tile
|
|
245
|
-
let bottomindex = destSize;
|
|
246
|
-
outChildrenElevations[tileY + 1][tileX][bottomindex] = middleHeight;
|
|
247
|
-
//next right bottom tile
|
|
248
|
-
let rightBottomindex = 0;
|
|
249
|
-
outChildrenElevations[tileY + 1][tileX + 1][rightBottomindex] = middleHeight;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
function extractElevationTilesMapboxNoChildren(rgbaData, heightFactor, noDataValues, outCurrenElevations) {
|
|
254
|
-
let destSize = Math.sqrt(outCurrenElevations.length) - 1;
|
|
255
|
-
let sourceSize = Math.sqrt(rgbaData.length / 4);
|
|
256
|
-
let dt = sourceSize / destSize;
|
|
257
|
-
let rightHeight = 0, bottomHeight = 0, sourceSize4 = 0;
|
|
258
|
-
for (let k = 0, currIndex = 0, sourceDataLength = rgbaData.length / 4; k < sourceDataLength; k++) {
|
|
259
|
-
let k4 = k * 4;
|
|
260
|
-
let height = heightFactor * rgb2Height(rgbaData[k4], rgbaData[k4 + 1], rgbaData[k4 + 2]);
|
|
261
|
-
let isNoDataCurrent = MapboxTerrain.checkNoDataValue(noDataValues, height), isNoDataRight = false, isNoDataBottom = false;
|
|
262
|
-
let i = Math.floor(k / sourceSize), j = k % sourceSize;
|
|
263
|
-
let tileX = Math.floor(j / destSize), tileY = Math.floor(i / destSize);
|
|
264
|
-
if ((i + tileY) % dt === 0 && (j + tileX) % dt === 0) {
|
|
265
|
-
outCurrenElevations[currIndex++] = height;
|
|
266
|
-
}
|
|
267
|
-
if ((j + 1) % destSize === 0 && j !== sourceSize - 1) {
|
|
268
|
-
//current tile
|
|
269
|
-
rightHeight = heightFactor * rgb2Height(rgbaData[k4 + 4], rgbaData[k4 + 5], rgbaData[k4 + 6]);
|
|
270
|
-
isNoDataRight = MapboxTerrain.checkNoDataValue(noDataValues, rightHeight);
|
|
271
|
-
let middleHeight = height;
|
|
272
|
-
if (!(isNoDataCurrent || isNoDataRight)) {
|
|
273
|
-
middleHeight = (height + rightHeight) * 0.5;
|
|
274
|
-
}
|
|
275
|
-
if ((i + tileY) % dt === 0) {
|
|
276
|
-
outCurrenElevations[currIndex++] = middleHeight;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
if ((i + 1) % destSize === 0 && i !== sourceSize - 1) {
|
|
280
|
-
//current tile
|
|
281
|
-
sourceSize4 = sourceSize * 4;
|
|
282
|
-
bottomHeight = heightFactor * rgb2Height(rgbaData[k4 + sourceSize4], rgbaData[k4 + sourceSize4 + 1], rgbaData[k4 + sourceSize4 + 2]);
|
|
283
|
-
isNoDataBottom = MapboxTerrain.checkNoDataValue(noDataValues, bottomHeight);
|
|
284
|
-
let middleHeight = (height + bottomHeight) * 0.5;
|
|
285
|
-
if (!(isNoDataCurrent || isNoDataBottom)) {
|
|
286
|
-
middleHeight = (height + bottomHeight) * 0.5;
|
|
287
|
-
}
|
|
288
|
-
if ((j + tileX) % dt === 0) {
|
|
289
|
-
outCurrenElevations[currIndex++] = middleHeight;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
if ((j + 1) % destSize === 0 && j !== sourceSize - 1 &&
|
|
293
|
-
(i + 1) % destSize === 0 && i !== sourceSize - 1) {
|
|
294
|
-
//current tile
|
|
295
|
-
let rightBottomHeight = heightFactor * rgb2Height(rgbaData[k4 + sourceSize4 + 4], rgbaData[k4 + sourceSize4 + 5], rgbaData[k4 + sourceSize4 + 6]);
|
|
296
|
-
let isNoDataRightBottom = MapboxTerrain.checkNoDataValue(noDataValues, rightBottomHeight);
|
|
297
|
-
let middleHeight = height;
|
|
298
|
-
if (!(isNoDataCurrent || isNoDataRight || isNoDataBottom || isNoDataRightBottom)) {
|
|
299
|
-
middleHeight = (height + rightHeight + bottomHeight + rightBottomHeight) * 0.25;
|
|
300
|
-
}
|
|
301
|
-
outCurrenElevations[currIndex++] = middleHeight;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
export { MapboxTerrain };
|