@openglobus/og 0.19.4 → 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} +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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BaseGeoImage } from "../layer/BaseGeoImage";
|
|
2
|
+
import { Framebuffer } from '../webgl/Framebuffer';
|
|
3
|
+
import { LonLat } from '../LonLat';
|
|
4
|
+
import { Planet } from "../scene/Planet";
|
|
5
|
+
import { WebGLBufferExt, WebGLTextureExt } from "../webgl/Handler";
|
|
6
|
+
export declare class GeoImageCreator {
|
|
7
|
+
MAX_FRAMES: number;
|
|
8
|
+
protected _gridSize: number;
|
|
9
|
+
protected _planet: Planet;
|
|
10
|
+
_framebuffer: Framebuffer | null;
|
|
11
|
+
protected _framebufferMercProj: Framebuffer | null;
|
|
12
|
+
_texCoordsBuffer: WebGLBufferExt | null;
|
|
13
|
+
_indexBuffer: WebGLBufferExt | null;
|
|
14
|
+
protected _currentFrame: number;
|
|
15
|
+
protected _queue: BaseGeoImage[];
|
|
16
|
+
protected _animate: BaseGeoImage[];
|
|
17
|
+
protected _quadTexCoordsBuffer: WebGLBufferExt | null;
|
|
18
|
+
protected _quadVertexBuffer: WebGLTextureExt | null;
|
|
19
|
+
constructor(planet: Planet, maxFrames?: number);
|
|
20
|
+
init(): void;
|
|
21
|
+
/**
|
|
22
|
+
* Creates geoImage corners coordinates grid buffer.
|
|
23
|
+
* @public
|
|
24
|
+
* @param{Array.<LonLat>} c - GeoImage corners coordinates.
|
|
25
|
+
* @param{boolean} [toMerc=false] - Transform to web mercator.
|
|
26
|
+
* @return{WebGLBuffer} Grid coordinates buffer.
|
|
27
|
+
*/
|
|
28
|
+
createGridBuffer(c: LonLat[], toMerc?: boolean): [WebGLBufferExt, WebGLBufferExt];
|
|
29
|
+
frame(): void;
|
|
30
|
+
add(geoImage: BaseGeoImage): void;
|
|
31
|
+
remove(geoImage: BaseGeoImage): void;
|
|
32
|
+
protected _initBuffers(): void;
|
|
33
|
+
protected _initShaders(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { QueueArray } from '../QueueArray';
|
|
2
|
+
export type HTMLImageElementExt = HTMLImageElement & {
|
|
3
|
+
__nodeIndex?: number;
|
|
4
|
+
atlasWidth?: number;
|
|
5
|
+
atlasHeight?: number;
|
|
6
|
+
};
|
|
7
|
+
export type ImagesCacheManagerCallback = (image: HTMLImageElementExt) => void;
|
|
8
|
+
interface IImagesCacheRequest {
|
|
9
|
+
"src": string;
|
|
10
|
+
"success": ImagesCacheManagerCallback;
|
|
11
|
+
}
|
|
12
|
+
declare class ImagesCacheManager {
|
|
13
|
+
imagesCache: Record<string, HTMLImageElementExt>;
|
|
14
|
+
protected _counter: number;
|
|
15
|
+
protected _pendingsQueue: QueueArray<IImagesCacheRequest>;
|
|
16
|
+
protected _imageIndexCounter: number;
|
|
17
|
+
constructor();
|
|
18
|
+
load(src: string, success: ImagesCacheManagerCallback): void;
|
|
19
|
+
protected _exec(req: IImagesCacheRequest): void;
|
|
20
|
+
protected _dequeueRequest(): void;
|
|
21
|
+
}
|
|
22
|
+
export { ImagesCacheManager };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { EventsHandler } from '../Events';
|
|
2
|
+
import { Planet } from "../scene/Planet";
|
|
3
|
+
import { Segment } from "../segment/Segment";
|
|
4
|
+
type LoaderEventsList = ["loadend", "layerloadend"];
|
|
5
|
+
export interface IResponse {
|
|
6
|
+
status: string;
|
|
7
|
+
data?: any;
|
|
8
|
+
msg?: string;
|
|
9
|
+
}
|
|
10
|
+
type IResponseCallback = (response: IResponse) => void;
|
|
11
|
+
interface Obj<T> {
|
|
12
|
+
__id: number;
|
|
13
|
+
isIdle: boolean;
|
|
14
|
+
isEqual: (obj: T) => boolean;
|
|
15
|
+
events: EventsHandler<any>;
|
|
16
|
+
_planet: Planet | null;
|
|
17
|
+
}
|
|
18
|
+
type QueryParams<T> = {
|
|
19
|
+
sender?: T;
|
|
20
|
+
src: string;
|
|
21
|
+
type: string;
|
|
22
|
+
filter?: (val: QueryParams<T>) => boolean;
|
|
23
|
+
options?: any;
|
|
24
|
+
segment?: Segment;
|
|
25
|
+
};
|
|
26
|
+
type QueueData<T> = {
|
|
27
|
+
params: QueryParams<T>;
|
|
28
|
+
callback: IResponseCallback;
|
|
29
|
+
};
|
|
30
|
+
type RequestCounter<T> = {
|
|
31
|
+
sender: T;
|
|
32
|
+
counter: number;
|
|
33
|
+
__requestCounterFrame__: number;
|
|
34
|
+
};
|
|
35
|
+
export declare class Loader<T extends Obj<T>> {
|
|
36
|
+
MAX_REQUESTS: number;
|
|
37
|
+
events: EventsHandler<LoaderEventsList>;
|
|
38
|
+
protected _loading: number;
|
|
39
|
+
protected _queue: QueueData<T>[];
|
|
40
|
+
protected _senderRequestCounter: RequestCounter<T>[];
|
|
41
|
+
protected _promises: {
|
|
42
|
+
[key: string]: (r: Response) => Promise<any>;
|
|
43
|
+
};
|
|
44
|
+
constructor(maxRequests?: number);
|
|
45
|
+
load(params: QueryParams<T>, callback: IResponseCallback): void;
|
|
46
|
+
fetch(params: QueryParams<T>): Promise<{
|
|
47
|
+
status: string;
|
|
48
|
+
data: any;
|
|
49
|
+
} | {
|
|
50
|
+
status: string;
|
|
51
|
+
msg: string;
|
|
52
|
+
}>;
|
|
53
|
+
getRequestCounter(sender: T): number;
|
|
54
|
+
isIdle(sender: T): boolean;
|
|
55
|
+
protected _checkLoadend(request: RequestCounter<T>, sender: T): void;
|
|
56
|
+
protected _handleResponse(q: QueueData<T>, response: IResponse): void;
|
|
57
|
+
protected _exec(): Promise<void> | undefined;
|
|
58
|
+
abort(sender: T): void;
|
|
59
|
+
abortAll(): void;
|
|
60
|
+
get loading(): number;
|
|
61
|
+
get queue(): QueueData<T>[];
|
|
62
|
+
}
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Framebuffer } from "../webgl/Framebuffer";
|
|
2
|
+
import { Lock, Key } from "../Lock";
|
|
3
|
+
import { Planet } from "../scene/Planet";
|
|
4
|
+
import { QueueArray } from "../QueueArray";
|
|
5
|
+
import { Segment } from "../segment/Segment";
|
|
6
|
+
import { WebGLBufferExt, WebGLTextureExt, Handler } from "../webgl/Handler";
|
|
7
|
+
interface INormalMapCreatorParams {
|
|
8
|
+
minTableSize?: number;
|
|
9
|
+
maxTableSize?: number;
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare class NormalMapCreator {
|
|
14
|
+
protected _minTabelSize: number;
|
|
15
|
+
protected _maxTableSize: number;
|
|
16
|
+
protected _planet: Planet;
|
|
17
|
+
protected _handler: Handler | null;
|
|
18
|
+
protected _verticesBufferArray: WebGLBufferExt[];
|
|
19
|
+
protected _indexBufferArray: WebGLBufferExt[];
|
|
20
|
+
protected _positionBuffer: WebGLBufferExt | null;
|
|
21
|
+
protected _framebuffer: Framebuffer | null;
|
|
22
|
+
protected _normalMapVerticesTexture: WebGLTextureExt | null;
|
|
23
|
+
protected _width: number;
|
|
24
|
+
protected _height: number;
|
|
25
|
+
protected _queue: QueueArray<Segment>;
|
|
26
|
+
protected _lock: Lock;
|
|
27
|
+
constructor(planet: Planet, options?: INormalMapCreatorParams);
|
|
28
|
+
get width(): number;
|
|
29
|
+
get height(): number;
|
|
30
|
+
init(): void;
|
|
31
|
+
protected _drawNormalMapBlur(segment: Segment): boolean;
|
|
32
|
+
protected _drawNormalMapNoBlur(segment: Segment): boolean;
|
|
33
|
+
protected _drawNormalMap(segment: Segment): boolean;
|
|
34
|
+
drawSingle(segment: Segment): void;
|
|
35
|
+
frame(): void;
|
|
36
|
+
get queueSize(): number;
|
|
37
|
+
queue(segment: Segment): void;
|
|
38
|
+
unshift(segment: Segment): void;
|
|
39
|
+
remove(segment: Segment): void;
|
|
40
|
+
clear(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Set activity off
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
lock(key: Key): void;
|
|
46
|
+
/**
|
|
47
|
+
* Set activity on
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
free(key: Key): void;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseWorker } from "./BaseWorker";
|
|
2
|
+
import { Segment } from "../segment/Segment";
|
|
3
|
+
import { Geoid } from "../terrain/Geoid";
|
|
4
|
+
export interface IPlainSegmentWorkerData {
|
|
5
|
+
plainVertices: Float64Array | null;
|
|
6
|
+
plainVerticesHigh: Float32Array | null;
|
|
7
|
+
plainVerticesLow: Float32Array | null;
|
|
8
|
+
plainNormals: Float32Array | null;
|
|
9
|
+
plainRadius: number;
|
|
10
|
+
normalMapNormals: Float32Array | null;
|
|
11
|
+
normalMapVertices: Float64Array | null;
|
|
12
|
+
normalMapVerticesHigh: Float32Array | null;
|
|
13
|
+
normalMapVerticesLow: Float32Array | null;
|
|
14
|
+
}
|
|
15
|
+
type MessageEventExt = MessageEvent & {
|
|
16
|
+
data: IPlainSegmentWorkerData;
|
|
17
|
+
};
|
|
18
|
+
declare class PlainSegmentWorker extends BaseWorker<Segment> {
|
|
19
|
+
constructor(numWorkers?: number);
|
|
20
|
+
protected _onMessage(e: MessageEventExt): void;
|
|
21
|
+
setGeoid(geoid: Geoid): void;
|
|
22
|
+
make(segment: Segment): void;
|
|
23
|
+
}
|
|
24
|
+
export { PlainSegmentWorker };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BaseWorker } from "./BaseWorker";
|
|
2
|
+
import { Segment } from "../segment/Segment";
|
|
3
|
+
import { NumberArray6 } from "../bv/Sphere";
|
|
4
|
+
interface TerrainInfo {
|
|
5
|
+
segment: Segment;
|
|
6
|
+
elevations: Float32Array;
|
|
7
|
+
}
|
|
8
|
+
export interface ITerrainWorkerData {
|
|
9
|
+
id: number;
|
|
10
|
+
normalMapNormals: Float32Array | null;
|
|
11
|
+
normalMapVertices: Float64Array | null;
|
|
12
|
+
normalMapVerticesHigh: Float32Array | null;
|
|
13
|
+
normalMapVerticesLow: Float32Array | null;
|
|
14
|
+
terrainVertices: Float64Array | null;
|
|
15
|
+
terrainVerticesHigh: Float32Array | null;
|
|
16
|
+
terrainVerticesLow: Float32Array | null;
|
|
17
|
+
noDataVertices: Uint8Array | null;
|
|
18
|
+
bounds: NumberArray6;
|
|
19
|
+
}
|
|
20
|
+
type MessageEventExt = MessageEvent & {
|
|
21
|
+
data: ITerrainWorkerData;
|
|
22
|
+
};
|
|
23
|
+
declare class TerrainWorker extends BaseWorker<TerrainInfo> {
|
|
24
|
+
constructor(numWorkers?: number);
|
|
25
|
+
protected _onMessage(e: MessageEventExt): void;
|
|
26
|
+
make(info: TerrainInfo): void;
|
|
27
|
+
}
|
|
28
|
+
export { TerrainWorker };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { ImageCanvas } from "../ImageCanvas";
|
|
2
|
+
import { Rectangle } from "../Rectangle";
|
|
3
|
+
import { ImagesCacheManager, HTMLImageElementExt, ImagesCacheManagerCallback } from "./ImagesCacheManager";
|
|
4
|
+
import { Handler, WebGLTextureExt } from "../webgl/Handler";
|
|
5
|
+
/**
|
|
6
|
+
* Texture atlas stores images in one texture. Each image has its own
|
|
7
|
+
* atlas texture coordinates.
|
|
8
|
+
* @class
|
|
9
|
+
* @param {number} [width=1024] - Texture atlas width, if it hasn't 1024 default.
|
|
10
|
+
* @param {number} [height=1024] - Texture atlas height, if it hasn't 1024 default.
|
|
11
|
+
*/
|
|
12
|
+
declare class TextureAtlas {
|
|
13
|
+
/**
|
|
14
|
+
* Atlas nodes where input images store. It can be accessed by image.__nodeIndex.
|
|
15
|
+
* @public
|
|
16
|
+
* @type {Map<number, TextureAtlasNode>}
|
|
17
|
+
*/
|
|
18
|
+
nodes: Map<number, TextureAtlasNode>;
|
|
19
|
+
/**
|
|
20
|
+
* Created gl texture.
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
texture: WebGLTextureExt | null;
|
|
24
|
+
/**
|
|
25
|
+
* Atlas canvas.
|
|
26
|
+
* @public
|
|
27
|
+
* @type {ImageCanvas}
|
|
28
|
+
*/
|
|
29
|
+
canvas: ImageCanvas;
|
|
30
|
+
borderSize: number;
|
|
31
|
+
protected _handler: Handler | null;
|
|
32
|
+
protected _images: HTMLImageElementExt[];
|
|
33
|
+
protected _btree: TextureAtlasNode | null;
|
|
34
|
+
protected _imagesCacheManager: ImagesCacheManager;
|
|
35
|
+
constructor(width?: number, height?: number);
|
|
36
|
+
/**
|
|
37
|
+
* Returns atlas javascript image object.
|
|
38
|
+
* @public
|
|
39
|
+
* @returns {HTMLImageElement} -
|
|
40
|
+
*/
|
|
41
|
+
getImage(): HTMLImageElement;
|
|
42
|
+
/**
|
|
43
|
+
* Returns canvas object.
|
|
44
|
+
* @public
|
|
45
|
+
* @returns {HTMLCanvasElement} -
|
|
46
|
+
*/
|
|
47
|
+
getCanvas(): HTMLCanvasElement;
|
|
48
|
+
/**
|
|
49
|
+
* Clear atlas with black.
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
clearCanvas(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Sets openglobus gl handler that creates gl texture.
|
|
55
|
+
* @public
|
|
56
|
+
* @param {Handler} handler - WebGL handler.
|
|
57
|
+
*/
|
|
58
|
+
assignHandler(handler: Handler): void;
|
|
59
|
+
/**
|
|
60
|
+
* Returns image diagonal size.
|
|
61
|
+
* @param {HTMLImageElementExt} image - Image object.
|
|
62
|
+
* @returns {number} -
|
|
63
|
+
*/
|
|
64
|
+
getDiagonal(image: HTMLImageElementExt): number;
|
|
65
|
+
/**
|
|
66
|
+
* Adds image to the atlas and returns created node with texture coordinates of the stored image.
|
|
67
|
+
* @public
|
|
68
|
+
* @param {HTMLImageElementExt} image - Input javascript image object.
|
|
69
|
+
* @param {boolean} [fastInsert] - If it's true atlas doesn't restore all images again
|
|
70
|
+
* and store image in the current atlas scheme.
|
|
71
|
+
* @returns {TextureAtlasNode | undefined} -
|
|
72
|
+
*/
|
|
73
|
+
addImage(image: HTMLImageElementExt, fastInsert?: boolean): TextureAtlasNode | undefined;
|
|
74
|
+
protected _completeNode(nodes: Map<number, TextureAtlasNode>, node?: TextureAtlasNode | null): void;
|
|
75
|
+
/**
|
|
76
|
+
* Main atlas making function.
|
|
77
|
+
* @protected
|
|
78
|
+
* @param {boolean} [fastInsert] - If it's true atlas doesn't restore all images again
|
|
79
|
+
* and store image in the current atlas scheme.
|
|
80
|
+
*/
|
|
81
|
+
protected _makeAtlas(fastInsert?: boolean): void;
|
|
82
|
+
get(key: number): TextureAtlasNode | undefined;
|
|
83
|
+
set(key: number, value: TextureAtlasNode): void;
|
|
84
|
+
/**
|
|
85
|
+
* Creates atlas gl texture.
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
createTexture(img?: HTMLImageElement | null, internalFormat?: number): void;
|
|
89
|
+
/**
|
|
90
|
+
* Asynchronous function that loads and creates image to the image cache, and call success callback when it's done.
|
|
91
|
+
* @public
|
|
92
|
+
* @param {string} src - Image object src string.
|
|
93
|
+
* @param {ImagesCacheManagerCallback} success - The callback that handles the image loads done.
|
|
94
|
+
*/
|
|
95
|
+
loadImage(src: string, success: ImagesCacheManagerCallback): void;
|
|
96
|
+
getImageTexCoordinates(img: HTMLImageElementExt): number[] | undefined;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Atlas binary tree node.
|
|
100
|
+
* @class
|
|
101
|
+
* @param {Rectangle} rect - Node image rectangle.
|
|
102
|
+
* @param {number[]} texCoords - Node image rectangle.
|
|
103
|
+
*/
|
|
104
|
+
declare class TextureAtlasNode {
|
|
105
|
+
childNodes: TextureAtlasNode[] | null;
|
|
106
|
+
image: HTMLImageElementExt | null;
|
|
107
|
+
rect: Rectangle;
|
|
108
|
+
texCoords: number[];
|
|
109
|
+
atlas: TextureAtlas | null;
|
|
110
|
+
constructor(rect?: Rectangle, texCoords?: number[]);
|
|
111
|
+
insert(img: HTMLImageElementExt): TextureAtlasNode | undefined;
|
|
112
|
+
}
|
|
113
|
+
export { TextureAtlas, TextureAtlasNode };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Framebuffer } from '../webgl/Framebuffer';
|
|
2
|
+
import { Handler } from "../webgl/Handler";
|
|
3
|
+
import { Material } from "../layer/Material";
|
|
4
|
+
import { Planet } from "../scene/Planet";
|
|
5
|
+
export declare class VectorTileCreator {
|
|
6
|
+
protected _width: number;
|
|
7
|
+
protected _height: number;
|
|
8
|
+
protected _planet: Planet;
|
|
9
|
+
protected _framebuffer: Framebuffer | null;
|
|
10
|
+
protected _queue: Material[];
|
|
11
|
+
protected _handler: Handler | null;
|
|
12
|
+
constructor(planet: Planet, width?: number, height?: number);
|
|
13
|
+
init(): void;
|
|
14
|
+
frame(): void;
|
|
15
|
+
add(material: Material): void;
|
|
16
|
+
remove(material: Material): void;
|
|
17
|
+
get queueSize(): number;
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface IObjGeometryData {
|
|
2
|
+
vertices: number[];
|
|
3
|
+
textures: number[];
|
|
4
|
+
normals: number[];
|
|
5
|
+
}
|
|
6
|
+
interface IObjGeometry {
|
|
7
|
+
object: string;
|
|
8
|
+
groups: string[];
|
|
9
|
+
material: string;
|
|
10
|
+
data: IObjGeometryData;
|
|
11
|
+
}
|
|
12
|
+
interface IObjData {
|
|
13
|
+
geometries: IObjGeometry[];
|
|
14
|
+
materialLibs: string[];
|
|
15
|
+
}
|
|
16
|
+
export declare function objParser(text: string): {
|
|
17
|
+
geometries: IObjGeometry[];
|
|
18
|
+
materialLibs: string[];
|
|
19
|
+
};
|
|
20
|
+
export declare function transformLeftToRightCoordinateSystem(objData: IObjData): {
|
|
21
|
+
geometries: IObjGeometry[];
|
|
22
|
+
materialLibs: string[];
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module og/utils/shared
|
|
3
|
+
*/
|
|
4
|
+
import { Extent } from "../Extent";
|
|
5
|
+
import { LonLat } from "../LonLat";
|
|
6
|
+
import { Vec2 } from "../math/Vec2";
|
|
7
|
+
import { NumberArray2 } from "../math/Vec2";
|
|
8
|
+
import { NumberArray3, Vec3 } from "../math/Vec3";
|
|
9
|
+
import { NumberArray4, Vec4 } from "../math/Vec4";
|
|
10
|
+
export declare function getDefault(param?: any, def?: any): boolean;
|
|
11
|
+
export declare function isEmpty(v: any): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Returns true if the object pointer is undefined.
|
|
14
|
+
* @function
|
|
15
|
+
* @param {Object} obj - Object pointer.
|
|
16
|
+
* @returns {boolean} Returns true if object is undefined.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isUndef(obj?: any): boolean;
|
|
19
|
+
export declare function isUndefExt(obj: any, defVal: any): any;
|
|
20
|
+
export declare function stamp(obj: any): number;
|
|
21
|
+
export declare function isString(s: any): boolean;
|
|
22
|
+
export declare function rgbToStringHTML(rgb: NumberArray3 | Vec3): string;
|
|
23
|
+
/**
|
|
24
|
+
* Convert html color string to the RGBA number vector.
|
|
25
|
+
* @param {string} htmlColor - HTML string("#C6C6C6" or "#EF5" or "rgb(8,8,8)" or "rgba(8,8,8)") color.
|
|
26
|
+
* @param {number} [opacity] - Opacity for the output vector.
|
|
27
|
+
* @returns {Vec4} -
|
|
28
|
+
*/
|
|
29
|
+
export declare function htmlColorToRgba(htmlColor: string, opacity?: number): Vec4;
|
|
30
|
+
export declare function htmlColorToFloat32Array(htmlColor: string, opacity?: number): Float32Array;
|
|
31
|
+
/**
|
|
32
|
+
* Convert html color string to the RGB number vector.
|
|
33
|
+
* @param {string} htmlColor - HTML string("#C6C6C6" or "#EF5" or "rgb(8,8,8)" or "rgba(8,8,8)") color.
|
|
34
|
+
* @returns {Vec3} -
|
|
35
|
+
*/
|
|
36
|
+
export declare function htmlColorToRgb(htmlColor: string): Vec3;
|
|
37
|
+
/**
|
|
38
|
+
* Replace template substrings between '{' and '}' tokens.
|
|
39
|
+
* @param {string} template - String with templates in "{" and "}"
|
|
40
|
+
* @param {Object} params - Template named object with subsrtings.
|
|
41
|
+
* @returns {string} -
|
|
42
|
+
*
|
|
43
|
+
* @example <caption>Example from og.terrain that replaces tile indexes in url:</caption>
|
|
44
|
+
* var substrings = {
|
|
45
|
+
* "x": 12,
|
|
46
|
+
* "y": 15,
|
|
47
|
+
* "z": 8
|
|
48
|
+
* }
|
|
49
|
+
* og.utils.stringTemplate("http://earth3.openglobus.org/{z}/{y}/{x}.ddm", substrings);
|
|
50
|
+
* //returns http://earth3.openglobus.org/8/15/12.ddm
|
|
51
|
+
*/
|
|
52
|
+
export declare function stringTemplate(template: string, params?: any): string;
|
|
53
|
+
export declare function getHTML(template: string, params?: any): string;
|
|
54
|
+
export declare function parseHTML(htmlStr: string): HTMLElement[];
|
|
55
|
+
export declare function print2d(id: string, text: string, x: number, y: number): void;
|
|
56
|
+
export declare function isNumber(value: any): boolean;
|
|
57
|
+
export declare function defaultString(str?: string, def?: string): string;
|
|
58
|
+
export declare function createVector3(v?: number | Vec3 | Vec2 | NumberArray3 | NumberArray2 | null, def?: Vec3): Vec3;
|
|
59
|
+
export declare function createVector4(v?: Vec4 | NumberArray4 | null, def?: Vec4): Vec4;
|
|
60
|
+
export declare function createColorRGBA(c?: string | NumberArray4 | Vec4 | null, def?: Vec4): Vec4;
|
|
61
|
+
export declare function createColorRGB(c?: string | NumberArray3 | Vec3 | null, def?: Vec3): Vec3;
|
|
62
|
+
export declare function createExtent(e?: Extent | [[number, number], [number, number]] | null, def?: Extent): Extent;
|
|
63
|
+
export declare function createLonLat(l?: LonLat | NumberArray2 | NumberArray3, def?: LonLat): LonLat;
|
|
64
|
+
export declare function binarySearchFast(arr: number[] | TypedArray, x: number): number;
|
|
65
|
+
/**
|
|
66
|
+
* Finds an item in a sorted array.
|
|
67
|
+
* @param {any[]} ar The sorted array to search.
|
|
68
|
+
* @param {any} el The item to find in the array.
|
|
69
|
+
* @param {Function} compare_fn comparator The function to use to compare the item to
|
|
70
|
+
* elements in the array.
|
|
71
|
+
* @returns {number} a negative number if 'a' is less than 'b'; 0 if 'a' is equal to 'b'; 'a' positive number of 'a' is greater than 'b'.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* // Create a comparator function to search through an array of numbers.
|
|
75
|
+
* function comparator(a, b) {
|
|
76
|
+
* return a - b;
|
|
77
|
+
* };
|
|
78
|
+
* var numbers = [0, 2, 4, 6, 8];
|
|
79
|
+
* var index = og.utils.binarySearch(numbers, 6, comparator); // 3
|
|
80
|
+
*/
|
|
81
|
+
export declare function binarySearch(ar: any[], el: any, compare_fn: Function): number;
|
|
82
|
+
/**
|
|
83
|
+
* @todo: replace any with generic
|
|
84
|
+
* Binary insertion that uses binarySearch algorithm.
|
|
85
|
+
* @param {any[]} ar - The sorted array to insert.
|
|
86
|
+
* @param {any} el - The item to insert.
|
|
87
|
+
* @param {Function} compare_fn - comparator The function to use to compare the item to
|
|
88
|
+
* elements in the array.
|
|
89
|
+
* @returns {number} Array index position in which item inserted in.
|
|
90
|
+
*/
|
|
91
|
+
export declare function binaryInsert(ar: any[], el: any, compare_fn: Function): number;
|
|
92
|
+
/**
|
|
93
|
+
* Returns two segment lines intersection coordinate.
|
|
94
|
+
* @static
|
|
95
|
+
* @param {Vec2} start1 - First line first coordinate.
|
|
96
|
+
* @param {Vec2} end1 - First line second coordinate.
|
|
97
|
+
* @param {Vec2} start2 - Second line first coordinate.
|
|
98
|
+
* @param {Vec2} end2 - Second line second coordinate.
|
|
99
|
+
* @param {boolean} [isSegment] - Lines are segments.
|
|
100
|
+
* @return {Vec2} - Intersection coordinate.
|
|
101
|
+
*/
|
|
102
|
+
export declare function getLinesIntersection2v(start1: Vec2, end1: Vec2, start2: Vec2, end2: Vec2, isSegment: boolean): Vec2 | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Returns two segment lines intersection coordinate.
|
|
105
|
+
* @static
|
|
106
|
+
* @param {Vec2} start1 - First line first coordinate.
|
|
107
|
+
* @param {Vec2} end1 - First line second coordinate.
|
|
108
|
+
* @param {Vec2} start2 - Second line first coordinate.
|
|
109
|
+
* @param {Vec2} end2 - Second line second coordinate.
|
|
110
|
+
* @param {boolean} [isSegment=false] - Lines are segments.
|
|
111
|
+
* @return {Vec2} - Intersection coordinate.
|
|
112
|
+
*/
|
|
113
|
+
export declare function getLinesIntersectionLonLat(start1: LonLat, end1: LonLat, start2: LonLat, end2: LonLat, isSegment?: boolean): LonLat | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* Converts XML to JSON
|
|
116
|
+
* @static
|
|
117
|
+
* @param {Object} xml - Xml object
|
|
118
|
+
* @return {Object} - Json converted object.
|
|
119
|
+
*/
|
|
120
|
+
export declare function xmlToJson(xml: any): any;
|
|
121
|
+
export declare const castType: {
|
|
122
|
+
string: (v: any) => any;
|
|
123
|
+
date: (v: any) => any;
|
|
124
|
+
datetime: (v: any) => any;
|
|
125
|
+
time: (v: any) => any;
|
|
126
|
+
integer: (v: any) => any;
|
|
127
|
+
float: (v: any) => any;
|
|
128
|
+
boolean: (str: any) => any;
|
|
129
|
+
};
|
|
130
|
+
export declare function base64toBlob(base64Data: string, contentType?: string): Blob;
|
|
131
|
+
export declare function base64StringToBlog(string: string): Blob;
|
|
132
|
+
/**
|
|
133
|
+
* Callback throttling
|
|
134
|
+
* @param {any} func
|
|
135
|
+
* @param {Number} limit
|
|
136
|
+
* @param {boolean} [skip]
|
|
137
|
+
*/
|
|
138
|
+
export declare function throttle(func: Function, limit: number, skip?: boolean): () => void;
|
|
139
|
+
/**
|
|
140
|
+
*
|
|
141
|
+
* y2-----Q12--------------Q22---
|
|
142
|
+
* | | | |
|
|
143
|
+
* | | | |
|
|
144
|
+
* y-------|-----P----------|----
|
|
145
|
+
* | | | |
|
|
146
|
+
* | | | |
|
|
147
|
+
* | | | |
|
|
148
|
+
* | | | |
|
|
149
|
+
* | | | |
|
|
150
|
+
* y1-----Q11----|---------Q21---
|
|
151
|
+
* | | |
|
|
152
|
+
* | | |
|
|
153
|
+
* x1 x x2
|
|
154
|
+
*
|
|
155
|
+
*
|
|
156
|
+
* @param {Number} x -
|
|
157
|
+
* @param {Number} y -
|
|
158
|
+
* @param {Number} fQ11 -
|
|
159
|
+
* @param {Number} fQ21 -
|
|
160
|
+
* @param {Number} fQ12 -
|
|
161
|
+
* @param {Number} fQ22 -
|
|
162
|
+
* @param {Number} [x1=0.0] -
|
|
163
|
+
* @param {Number} [x2=1.0] -
|
|
164
|
+
* @param {Number} [y1=0.0] -
|
|
165
|
+
* @param {Number} [y2=1.0] -
|
|
166
|
+
*/
|
|
167
|
+
export declare function blerp(x: number, y: number, fQ11: number, fQ21: number, fQ12: number, fQ22: number, x1?: number, x2?: number, y1?: number, y2?: number): number;
|
|
168
|
+
export declare function blerp2(x: number, y: number, fQ11: number, fQ21: number, fQ12: number, fQ22: number): number;
|
|
169
|
+
export declare function extractElevationTiles(rgbaData: number[] | TypedArray, outCurrenElevations: number[] | TypedArray, outChildrenElevations: number[][][] | TypedArray[][]): void;
|
|
170
|
+
export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
|
|
171
|
+
/**
|
|
172
|
+
* Concatenates two the same type arrays
|
|
173
|
+
* @param {TypedArray} a
|
|
174
|
+
* @param {TypedArray | number[]} b
|
|
175
|
+
*/
|
|
176
|
+
export declare function concatTypedArrays(a: TypedArray, b: TypedArray | number[]): TypedArray;
|
|
177
|
+
/**
|
|
178
|
+
* Concatenates two the same arrays
|
|
179
|
+
* @param {TypedArray | number[]} [a=[]] - First array
|
|
180
|
+
* @param {TypedArray | number[]} [b=[]] - Second array
|
|
181
|
+
* @return {TypedArray | number[]} -
|
|
182
|
+
*/
|
|
183
|
+
export declare function concatArrays(a?: TypedArray | number[], b?: TypedArray | number[]): TypedArray | number[];
|
|
184
|
+
/**
|
|
185
|
+
* Convert simple array to typed
|
|
186
|
+
* @param arr {number[]}
|
|
187
|
+
* @param ctor {Float32Array}
|
|
188
|
+
* @returns {TypedArray}
|
|
189
|
+
*/
|
|
190
|
+
export declare function makeArrayTyped(arr: TypedArray | number[], ctor?: Function): any;
|
|
191
|
+
/**
|
|
192
|
+
* Convert typed array to array
|
|
193
|
+
* @param arr {TypedArray | number[]}
|
|
194
|
+
* @returns {number[]}
|
|
195
|
+
*/
|
|
196
|
+
export declare function makeArray(arr: TypedArray | number[]): number[];
|
|
197
|
+
/**
|
|
198
|
+
*
|
|
199
|
+
* @param {TypedArray | Array} arr
|
|
200
|
+
* @param {Number} starting
|
|
201
|
+
* @param {Number} deleteCount
|
|
202
|
+
* @param {{ result: number[] }} [out]
|
|
203
|
+
*/
|
|
204
|
+
export declare function spliceArray(arr: TypedArray | number[], starting: number, deleteCount: number, out?: {
|
|
205
|
+
result: number[];
|
|
206
|
+
} | {
|
|
207
|
+
result: TypedArray;
|
|
208
|
+
}): TypedArray | number[];
|
|
209
|
+
/**
|
|
210
|
+
*
|
|
211
|
+
* @param {TypedArray} arr
|
|
212
|
+
* @param {Number} starting
|
|
213
|
+
* @param {Number} deleteCount
|
|
214
|
+
* @param {{ result: TypedArray }} [out]
|
|
215
|
+
*/
|
|
216
|
+
export declare function spliceTypedArray<T extends TypedArray>(arr: T, starting: number, deleteCount: number, out?: {
|
|
217
|
+
result: T;
|
|
218
|
+
}): T;
|
|
219
|
+
/**
|
|
220
|
+
* Returns 64-bit triangle coordinate array from inside of the source triangle array.
|
|
221
|
+
* @static
|
|
222
|
+
* @param {TypedArray | number[]} sourceArr - Source array
|
|
223
|
+
* @param {number} gridSize - Source array square matrix size
|
|
224
|
+
* @param {number} i0 - First row index source array matrix
|
|
225
|
+
* @param {number} j0 - First column index
|
|
226
|
+
* @param {number} size - Square matrix result size.
|
|
227
|
+
* @return {Float64Array} Triangle coordinates array from the source array.
|
|
228
|
+
* @TODO: optimization
|
|
229
|
+
*/
|
|
230
|
+
export declare function getMatrixSubArray64(sourceArr: TypedArray | number[], gridSize: number, i0: number, j0: number, size: number): Float64Array;
|
|
231
|
+
/**
|
|
232
|
+
* Returns 32-bit triangle coordinate array from inside of the source triangle array.
|
|
233
|
+
* @static
|
|
234
|
+
* @param {TypedArray | number[]} sourceArr - Source array
|
|
235
|
+
* @param {number} gridSize - Source array square matrix size
|
|
236
|
+
* @param {number} i0 - First row index source array matrix
|
|
237
|
+
* @param {number} j0 - First column index
|
|
238
|
+
* @param {number} size - Square matrix result size.
|
|
239
|
+
* @return {Float32Array} Triangle coordinates array from the source array.
|
|
240
|
+
*/
|
|
241
|
+
export declare function getMatrixSubArray32(sourceArr: TypedArray | number[], gridSize: number, i0: number, j0: number, size: number): Float32Array;
|
|
242
|
+
/**
|
|
243
|
+
* Returns two float32 triangle coordinate arrays from inside of the source triangle array.
|
|
244
|
+
* @TODO: optimization
|
|
245
|
+
*/
|
|
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;
|
|
247
|
+
export declare function cloneArray(items: any[]): any[];
|
|
248
|
+
/**
|
|
249
|
+
* Promise for load images
|
|
250
|
+
* @function
|
|
251
|
+
* @param {string} url - link to image.
|
|
252
|
+
* @returns {Promise<Image>} Returns promise.
|
|
253
|
+
*/
|
|
254
|
+
export declare function loadImage(url: string): Promise<HTMLImageElement>;
|
|
255
|
+
/**
|
|
256
|
+
* Gets image is loaded
|
|
257
|
+
* @param {HTMLImageElement} image
|
|
258
|
+
* @returns {boolean} Returns true is the image is loaded
|
|
259
|
+
*/
|
|
260
|
+
export declare function isImageLoaded(image: HTMLImageElement): boolean;
|
|
261
|
+
export declare function distanceFormat(v: number): string;
|
|
262
|
+
export declare function distanceFormatExt(v: number): [string, string];
|
|
263
|
+
export declare function getUrlParam(paramName: string): number | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const ELL = 0;
|
|
2
|
+
export declare const MSL = 1;
|
|
3
|
+
export declare const GND = 2;
|
|
4
|
+
export declare const heightMode: Record<string, number>;
|
|
5
|
+
export declare const m = 0;
|
|
6
|
+
export declare const km = 1;
|
|
7
|
+
export declare const ft = 2;
|
|
8
|
+
export declare const s = 3;
|
|
9
|
+
export declare const h = 4;
|
|
10
|
+
export declare const ms = 5;
|
|
11
|
+
export declare const kmh = 6;
|
|
12
|
+
export declare const fts = 7;
|
|
13
|
+
export declare const _tenth: number[];
|
|
14
|
+
export declare function convert(from: number, to: number, val: number): number;
|
|
15
|
+
export declare function convertExt(isNotNaN: boolean, unitFrom: number, unitTo: number, val: number, fixed?: number): string;
|
|
16
|
+
export declare function toString(u: number): string;
|