@openglobus/og 0.12.1 → 0.13.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 +0 -2
- package/dist/@openglobus/og.css +1 -0
- package/dist/@openglobus/og.esm.js +21 -0
- package/dist/@openglobus/og.esm.js.map +1 -0
- package/dist/@openglobus/og.umd.js +21 -0
- package/dist/@openglobus/og.umd.js.map +1 -0
- package/package.json +8 -8
- package/src/og/Extent.js +3 -3
- package/src/og/Globe.js +277 -275
- package/src/og/ImageCanvas.js +3 -3
- package/src/og/LonLat.js +9 -9
- package/src/og/QueueArray.js +2 -2
- package/src/og/Rectangle.js +5 -5
- package/src/og/bv/Box.js +1 -1
- package/src/og/bv/Sphere.js +2 -2
- package/src/og/camera/Camera.js +1 -1
- package/src/og/camera/PlanetCamera.js +649 -646
- package/src/og/control/LayerSwitcher.js +1 -1
- package/src/og/control/MouseNavigation.js +22 -13
- package/src/og/control/MouseWheelZoomControl.js +2 -2
- package/src/og/control/ScaleControl.js +1 -1
- package/src/og/control/TouchNavigation.js +319 -319
- package/src/og/control/ZoomControl.js +132 -132
- package/src/og/control/visibleExtent/Segment.js +12 -12
- package/src/og/ellipsoid/Ellipsoid.js +577 -567
- package/src/og/entity/BillboardHandler.js +878 -1051
- package/src/og/entity/Entity.js +1 -1
- package/src/og/entity/EntityCollection.js +847 -857
- package/src/og/entity/GeoObjectHandler.js +37 -18
- package/src/og/entity/LabelHandler.js +888 -1040
- package/src/og/entity/LabelWorker.js +0 -6
- package/src/og/entity/PointCloud.js +495 -495
- package/src/og/entity/Polyline.js +2218 -2222
- package/src/og/entity/RayHandler.js +1 -1
- package/src/og/layer/CanvasTiles.js +6 -3
- package/src/og/layer/GeoImage.js +1 -1
- package/src/og/layer/KML.js +24 -17
- package/src/og/layer/Layer.js +806 -751
- package/src/og/layer/Vector.js +997 -1010
- package/src/og/layer/XYZ.js +359 -357
- package/src/og/math/Line2.js +4 -4
- package/src/og/math/Quat.js +2 -2
- package/src/og/math/Ray.js +2 -2
- package/src/og/math/Vec2.js +524 -524
- package/src/og/math/Vec3.js +900 -900
- package/src/og/math/Vec4.js +261 -261
- package/src/og/math.js +397 -398
- package/src/og/quadTree/EntityCollectionNode.js +389 -387
- package/src/og/renderer/Renderer.js +14 -20
- package/src/og/renderer/RendererEvents.js +1034 -1045
- package/src/og/scene/Planet.js +26 -23
- package/src/og/scene/RenderNode.js +347 -354
- package/src/og/segment/Segment.js +3 -1
- package/src/og/segment/SegmentLonLat.js +1 -4
- package/src/og/shaders/billboard.js +220 -204
- package/src/og/shaders/drawnode.js +603 -603
- package/src/og/shaders/geoObject.js +15 -6
- package/src/og/shaders/label.js +596 -456
- package/src/og/shaders/polyline.js +365 -361
- package/src/og/terrain/MapboxTerrain.js +1 -1
- package/src/og/utils/FontAtlas.js +209 -200
- package/src/og/utils/GeoImageCreator.js +4 -5
- package/src/og/utils/TextureAtlas.js +4 -4
- package/src/og/utils/VectorTileCreator.js +414 -414
- package/src/og/utils/shared.js +1 -1
- package/src/og/webgl/Handler.js +28 -60
- package/src/og/webgl/Multisample.js +260 -260
- package/src/og/webgl/Program.js +411 -396
- package/types/Clock.d.ts +94 -0
- package/types/Deferred.d.ts +6 -0
- package/types/Events.d.ts +77 -0
- package/types/Extent.d.ts +166 -0
- package/types/Globe.d.ts +85 -0
- package/types/ImageCanvas.d.ts +123 -0
- package/types/Lock.d.ts +12 -0
- package/types/LonLat.d.ts +108 -0
- package/types/Popup.d.ts +42 -0
- package/types/QueueArray.d.ts +19 -0
- package/types/Rectangle.d.ts +80 -0
- package/types/Stack.d.ts +19 -0
- package/types/ajax.d.ts +24 -0
- package/types/arial.d.ts +48 -0
- package/types/astro/astro.d.ts +38 -0
- package/types/astro/earth.d.ts +7 -0
- package/types/astro/jd.d.ts +254 -0
- package/types/bv/Box.d.ts +30 -0
- package/types/bv/Sphere.d.ts +38 -0
- package/types/bv/index.d.ts +3 -0
- package/types/camera/Camera.d.ts +312 -0
- package/types/camera/Frustum.d.ts +133 -0
- package/types/camera/PlanetCamera.d.ts +219 -0
- package/types/camera/index.d.ts +3 -0
- package/types/cons.d.ts +40 -0
- package/types/control/CompassButton.d.ts +17 -0
- package/types/control/Control.d.ts +104 -0
- package/types/control/DebugInfo.d.ts +15 -0
- package/types/control/EarthCoordinates.d.ts +47 -0
- package/types/control/EarthNavigation.d.ts +43 -0
- package/types/control/GeoImageDragControl.d.ts +6 -0
- package/types/control/KeyboardNavigation.d.ts +21 -0
- package/types/control/LayerSwitcher.d.ts +21 -0
- package/types/control/Lighting.d.ts +16 -0
- package/types/control/MouseNavigation.d.ts +48 -0
- package/types/control/MouseWheelZoomControl.d.ts +45 -0
- package/types/control/ScaleControl.d.ts +22 -0
- package/types/control/ShowFps.d.ts +11 -0
- package/types/control/SimpleNavigation.d.ts +25 -0
- package/types/control/Sun.d.ts +50 -0
- package/types/control/ToggleWireframe.d.ts +12 -0
- package/types/control/TouchNavigation.d.ts +48 -0
- package/types/control/ZoomControl.d.ts +27 -0
- package/types/control/index.d.ts +18 -0
- package/types/ellipsoid/Ellipsoid.d.ts +153 -0
- package/types/ellipsoid/index.d.ts +3 -0
- package/types/ellipsoid/wgs84.d.ts +6 -0
- package/types/entity/BaseBillboard.d.ts +215 -0
- package/types/entity/Billboard.d.ts +94 -0
- package/types/entity/BillboardHandler.d.ts +75 -0
- package/types/entity/Entity.d.ts +348 -0
- package/types/entity/EntityCollection.d.ts +309 -0
- package/types/entity/GeoObject.d.ts +111 -0
- package/types/entity/GeoObjectHandler.d.ts +81 -0
- package/types/entity/Geometry.d.ts +74 -0
- package/types/entity/GeometryHandler.d.ts +76 -0
- package/types/entity/Label.d.ts +189 -0
- package/types/entity/LabelHandler.d.ts +29 -0
- package/types/entity/LabelWorker.d.ts +11 -0
- package/types/entity/PointCloud.d.ts +174 -0
- package/types/entity/PointCloudHandler.d.ts +38 -0
- package/types/entity/Polyline.d.ts +306 -0
- package/types/entity/PolylineHandler.d.ts +18 -0
- package/types/entity/Ray.d.ts +124 -0
- package/types/entity/RayHandler.d.ts +67 -0
- package/types/entity/ShapeHandler.d.ts +22 -0
- package/types/entity/Strip.d.ts +119 -0
- package/types/entity/StripHandler.d.ts +38 -0
- package/types/entity/index.d.ts +8 -0
- package/types/index.core.d.ts +65 -0
- package/types/index.d.ts +45 -0
- package/types/index.webgl.d.ts +7 -0
- package/types/input/KeyboardHandler.d.ts +10 -0
- package/types/input/MouseHandler.d.ts +5 -0
- package/types/input/TouchHandler.d.ts +5 -0
- package/types/input/input.d.ts +34 -0
- package/types/layer/BaseGeoImage.d.ts +94 -0
- package/types/layer/CanvasTiles.d.ts +67 -0
- package/types/layer/GeoImage.d.ts +52 -0
- package/types/layer/GeoTexture2d.d.ts +8 -0
- package/types/layer/GeoVideo.d.ts +55 -0
- package/types/layer/KML.d.ts +68 -0
- package/types/layer/Layer.d.ts +315 -0
- package/types/layer/Material.d.ts +45 -0
- package/types/layer/Vector.d.ts +201 -0
- package/types/layer/WMS.d.ts +61 -0
- package/types/layer/XYZ.d.ts +119 -0
- package/types/layer/index.d.ts +10 -0
- package/types/light/LightSource.d.ts +178 -0
- package/types/math/Line2.d.ts +11 -0
- package/types/math/Line3.d.ts +10 -0
- package/types/math/Mat3.d.ts +65 -0
- package/types/math/Mat4.d.ts +176 -0
- package/types/math/Plane.d.ts +18 -0
- package/types/math/Quat.d.ts +379 -0
- package/types/math/Ray.d.ts +82 -0
- package/types/math/Vec2.d.ts +309 -0
- package/types/math/Vec3.d.ts +467 -0
- package/types/math/Vec4.d.ts +162 -0
- package/types/math/coder.d.ts +43 -0
- package/types/math/index.d.ts +11 -0
- package/types/math.d.ts +261 -0
- package/types/mercator.d.ts +92 -0
- package/types/proj/EPSG3857.d.ts +6 -0
- package/types/proj/EPSG4326.d.ts +6 -0
- package/types/proj/Proj.d.ts +42 -0
- package/types/quadTree/EntityCollectionNode.d.ts +34 -0
- package/types/quadTree/Node.d.ts +60 -0
- package/types/quadTree/quadTree.d.ts +40 -0
- package/types/renderer/Renderer.d.ts +290 -0
- package/types/renderer/RendererEvents.d.ts +237 -0
- package/types/res/images.d.ts +3 -0
- package/types/scene/Axes.d.ts +11 -0
- package/types/scene/BaseNode.d.ts +60 -0
- package/types/scene/Planet.d.ts +576 -0
- package/types/scene/RenderNode.d.ts +142 -0
- package/types/scene/SkyBox.d.ts +10 -0
- package/types/scene/index.d.ts +4 -0
- package/types/segment/Segment.d.ts +275 -0
- package/types/segment/SegmentLonLat.d.ts +17 -0
- package/types/segment/Slice.d.ts +10 -0
- package/types/segment/segmentHelper.d.ts +13 -0
- package/types/shaders/billboard.d.ts +3 -0
- package/types/shaders/depth.d.ts +2 -0
- package/types/shaders/drawnode.d.ts +7 -0
- package/types/shaders/geoObject.d.ts +3 -0
- package/types/shaders/label.d.ts +4 -0
- package/types/shaders/pointCloud.d.ts +2 -0
- package/types/shaders/polyline.d.ts +3 -0
- package/types/shaders/ray.d.ts +2 -0
- package/types/shaders/screenFrame.d.ts +2 -0
- package/types/shaders/shape.d.ts +4 -0
- package/types/shaders/skybox.d.ts +2 -0
- package/types/shaders/toneMapping.d.ts +2 -0
- package/types/shapes/BaseShape.d.ts +250 -0
- package/types/shapes/Sphere.d.ts +41 -0
- package/types/terrain/BilTerrain.d.ts +7 -0
- package/types/terrain/EmptyTerrain.d.ts +73 -0
- package/types/terrain/Geoid.d.ts +26 -0
- package/types/terrain/GlobusTerrain.d.ts +116 -0
- package/types/terrain/MapboxTerrain.d.ts +7 -0
- package/types/terrain/index.d.ts +5 -0
- package/types/utils/FontAtlas.d.ts +16 -0
- package/types/utils/GeoImageCreator.d.ts +30 -0
- package/types/utils/ImagesCacheManager.d.ts +10 -0
- package/types/utils/Loader.d.ts +25 -0
- package/types/utils/NormalMapCreator.d.ts +39 -0
- package/types/utils/PlainSegmentWorker.d.ts +10 -0
- package/types/utils/TerrainWorker.d.ts +9 -0
- package/types/utils/TextureAtlas.d.ts +111 -0
- package/types/utils/VectorTileCreator.d.ts +16 -0
- package/types/utils/colorTable.d.ts +143 -0
- package/types/utils/earcut.d.ts +6 -0
- package/types/utils/shared.d.ts +231 -0
- package/types/webgl/Framebuffer.d.ts +135 -0
- package/types/webgl/Handler.d.ts +392 -0
- package/types/webgl/Multisample.d.ts +89 -0
- package/types/webgl/Program.d.ts +163 -0
- package/types/webgl/ProgramController.d.ts +89 -0
- package/types/webgl/callbacks.d.ts +1 -0
- package/types/webgl/index.d.ts +6 -0
- package/types/webgl/types.d.ts +2 -0
|
@@ -374,7 +374,7 @@ class RayHandler {
|
|
|
374
374
|
var gl = h.gl,
|
|
375
375
|
ec = this._entityCollection;
|
|
376
376
|
|
|
377
|
-
gl.polygonOffset(ec.polygonOffsetFactor, ec.polygonOffsetUnits);
|
|
377
|
+
//gl.polygonOffset(ec.polygonOffsetFactor, ec.polygonOffsetUnits);
|
|
378
378
|
|
|
379
379
|
gl.uniform1f(shu.uOpacity, ec._fadingOpacity);
|
|
380
380
|
|
|
@@ -227,12 +227,15 @@ class CanvasTiles extends Layer {
|
|
|
227
227
|
applyMaterial(material) {
|
|
228
228
|
if (material.isReady) {
|
|
229
229
|
return [0, 0, 1, 1];
|
|
230
|
-
} else {
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
} else {
|
|
231
|
+
|
|
233
232
|
var segment = material.segment;
|
|
234
233
|
var pn = segment.node,
|
|
235
234
|
notEmpty = false;
|
|
235
|
+
|
|
236
|
+
if (segment.passReady && !material.isLoading) {
|
|
237
|
+
this.loadMaterial(material);
|
|
238
|
+
}
|
|
236
239
|
|
|
237
240
|
var mId = this._id;
|
|
238
241
|
var psegm = material;
|
package/src/og/layer/GeoImage.js
CHANGED
package/src/og/layer/KML.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
"use strict";
|
|
6
|
+
import { Billboard } from "../entity/Billboard.js";
|
|
6
7
|
import { Entity } from "../entity/Entity.js";
|
|
7
8
|
import { Extent } from "../Extent.js";
|
|
8
9
|
import { LonLat } from "../LonLat.js";
|
|
@@ -36,23 +37,25 @@ export class KML extends Vector {
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
|
-
* @
|
|
40
|
+
* @public
|
|
40
41
|
*/
|
|
41
42
|
_extractCoordonatesFromKml(xmlDoc) {
|
|
42
43
|
const raw = Array.from(xmlDoc.getElementsByTagName("coordinates"));
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
const rawText = raw.map(item => item.textContent.trim());
|
|
45
|
+
const coordinates = rawText.map(item =>
|
|
46
|
+
item
|
|
47
|
+
.replace(/\n/g, " ")
|
|
48
|
+
.replace(/\t/g, " ")
|
|
49
|
+
.replace(/ +/g," ")
|
|
50
|
+
.split(" ")
|
|
51
|
+
.map((co) => co.split(",").map(parseFloat))
|
|
49
52
|
);
|
|
50
53
|
return coordinates;
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
/**
|
|
54
57
|
* Creates billboards or polylines from array of lonlat.
|
|
55
|
-
* @
|
|
58
|
+
* @public
|
|
56
59
|
* @param {Array} coordonates
|
|
57
60
|
* @param {string} color
|
|
58
61
|
* @returns {Array<Entity>}
|
|
@@ -90,7 +93,7 @@ export class KML extends Vector {
|
|
|
90
93
|
}
|
|
91
94
|
|
|
92
95
|
/**
|
|
93
|
-
* @
|
|
96
|
+
* @public
|
|
94
97
|
* @returns {Document}
|
|
95
98
|
*/
|
|
96
99
|
_getXmlContent(file) {
|
|
@@ -103,7 +106,7 @@ export class KML extends Vector {
|
|
|
103
106
|
}
|
|
104
107
|
|
|
105
108
|
/**
|
|
106
|
-
* @
|
|
109
|
+
* @public
|
|
107
110
|
*/
|
|
108
111
|
_expandExtents(extent1, extent2) {
|
|
109
112
|
if (!extent1) return extent2;
|
|
@@ -121,15 +124,17 @@ export class KML extends Vector {
|
|
|
121
124
|
/**
|
|
122
125
|
* @public
|
|
123
126
|
* @param {File[]} kmls
|
|
127
|
+
* @param {string} [color]
|
|
128
|
+
* @param {Billboard} [billboard]
|
|
124
129
|
* @returns {Promise<{entities: Entity[], extent: Extent}>}
|
|
125
130
|
*/
|
|
126
|
-
async addKmlFromFiles(kmls) {
|
|
131
|
+
async addKmlFromFiles(kmls, color = null, billboard = null) {
|
|
127
132
|
const kmlObjs = await Promise.all(kmls.map(this._getXmlContent));
|
|
128
133
|
const coordonates = kmlObjs.map(this._extractCoordonatesFromKml);
|
|
129
134
|
const { entities, extent } = this._convertCoordonatesIntoEntities(
|
|
130
135
|
coordonates,
|
|
131
|
-
this._color,
|
|
132
|
-
this._billboard
|
|
136
|
+
color || this._color,
|
|
137
|
+
billboard || this._billboard
|
|
133
138
|
);
|
|
134
139
|
this._extent = this._expandExtents(this._extent, extent);
|
|
135
140
|
entities.forEach(this.add.bind(this));
|
|
@@ -146,7 +151,7 @@ export class KML extends Vector {
|
|
|
146
151
|
}
|
|
147
152
|
|
|
148
153
|
/**
|
|
149
|
-
* @
|
|
154
|
+
* @public
|
|
150
155
|
*/
|
|
151
156
|
_getKmlFromUrl(url) {
|
|
152
157
|
return new Promise((resolve, reject) => {
|
|
@@ -168,15 +173,17 @@ export class KML extends Vector {
|
|
|
168
173
|
/**
|
|
169
174
|
* @public
|
|
170
175
|
* @param {string} url - Url of the KML to display. './myFile.kml' or 'http://mySite/myFile.kml' for example.
|
|
176
|
+
* @param {string} [color]
|
|
177
|
+
* @param {Billboard} [billboard]
|
|
171
178
|
* @returns {Promise<{entities: Entity[], extent: Extent}>}
|
|
172
179
|
*/
|
|
173
|
-
async addKmlFromUrl(url) {
|
|
180
|
+
async addKmlFromUrl(url, color = null, billboard = null) {
|
|
174
181
|
const kml = await this._getKmlFromUrl(url);
|
|
175
182
|
const coordonates = this._extractCoordonatesFromKml(kml);
|
|
176
183
|
const { entities, extent } = this._convertCoordonatesIntoEntities(
|
|
177
184
|
[coordonates],
|
|
178
|
-
this._color,
|
|
179
|
-
this._billboard
|
|
185
|
+
color || this._color,
|
|
186
|
+
billboard || this._billboard
|
|
180
187
|
);
|
|
181
188
|
this._extent = this._expandExtents(this._extent, extent);
|
|
182
189
|
entities.forEach(this.add.bind(this));
|