@openglobus/og 0.22.2 → 0.23.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.
Files changed (167) hide show
  1. package/css/og.css +137 -1
  2. package/lib/@openglobus/js/Object3d.d.ts +20 -10
  3. package/lib/@openglobus/js/camera/Camera.d.ts +9 -0
  4. package/lib/@openglobus/js/camera/Frustum.d.ts +3 -0
  5. package/lib/@openglobus/js/control/CameraLock.d.ts +38 -0
  6. package/lib/@openglobus/js/control/SimpleNavigation.d.ts +27 -10
  7. package/lib/@openglobus/js/control/geoObjectEditor/ArrowEntity.d.ts +15 -0
  8. package/lib/@openglobus/js/control/geoObjectEditor/AxisTrackEntity.d.ts +9 -0
  9. package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditor.d.ts +13 -0
  10. package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +69 -0
  11. package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +78 -9
  12. package/lib/@openglobus/js/control/geoObjectEditor/MoveAxisEntity.d.ts +17 -0
  13. package/lib/@openglobus/js/control/geoObjectEditor/MovePlaneEntity.d.ts +7 -0
  14. package/lib/@openglobus/js/control/geoObjectEditor/RotateEntity.d.ts +9 -0
  15. package/lib/@openglobus/js/control/geoObjectEditor/colors.d.ts +8 -0
  16. package/lib/@openglobus/js/control/index.d.ts +2 -0
  17. package/lib/@openglobus/js/entity/Entity.d.ts +278 -19
  18. package/lib/@openglobus/js/entity/EntityCollection.d.ts +8 -9
  19. package/lib/@openglobus/js/entity/GeoObject.d.ts +141 -36
  20. package/lib/@openglobus/js/entity/GeoObjectHandler.d.ts +39 -63
  21. package/lib/@openglobus/js/entity/InstanceData.d.ts +76 -0
  22. package/lib/@openglobus/js/entity/Polyline.d.ts +19 -6
  23. package/lib/@openglobus/js/entity/PolylineHandler.d.ts +7 -0
  24. package/lib/@openglobus/js/index.d.ts +2 -1
  25. package/lib/@openglobus/js/layer/Vector.d.ts +4 -0
  26. package/lib/@openglobus/js/light/LightSource.d.ts +1 -139
  27. package/lib/@openglobus/js/math/Quat.d.ts +46 -33
  28. package/lib/@openglobus/js/math/Ray.d.ts +10 -4
  29. package/lib/@openglobus/js/math/Vec3.d.ts +15 -0
  30. package/lib/@openglobus/js/math.d.ts +2 -2
  31. package/lib/@openglobus/js/quadTree/EntityCollectionNode.d.ts +2 -2
  32. package/lib/@openglobus/js/quadTree/Node.d.ts +1 -1
  33. package/lib/@openglobus/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +1 -1
  34. package/lib/@openglobus/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +1 -1
  35. package/lib/@openglobus/js/renderer/Renderer.d.ts +63 -44
  36. package/lib/@openglobus/js/renderer/RendererEvents.d.ts +1 -0
  37. package/lib/@openglobus/js/scene/Planet.d.ts +11 -7
  38. package/lib/@openglobus/js/scene/RenderNode.d.ts +10 -25
  39. package/lib/@openglobus/js/shaders/drawnode.d.ts +1 -0
  40. package/lib/@openglobus/js/shaders/geoObject.d.ts +1 -0
  41. package/lib/@openglobus/js/shaders/utils.d.ts +1 -1
  42. package/lib/@openglobus/js/ui/Checkbox.d.ts +31 -0
  43. package/lib/@openglobus/js/ui/Dialog.d.ts +3 -0
  44. package/lib/@openglobus/js/ui/Input.d.ts +32 -0
  45. package/lib/@openglobus/js/ui/View.d.ts +3 -1
  46. package/lib/@openglobus/js/utils/objParser.d.ts +44 -12
  47. package/lib/@openglobus/js/utils/shared.d.ts +22 -0
  48. package/lib/@openglobus/js/webgl/BaseFramebuffer.d.ts +0 -1
  49. package/lib/@openglobus/js/webgl/Framebuffer.d.ts +35 -8
  50. package/lib/@openglobus/js/webgl/Handler.d.ts +1 -0
  51. package/lib/@openglobus/og.css +1 -1
  52. package/lib/@openglobus/og.esm.js +1 -1
  53. package/lib/@openglobus/og.esm.js.map +1 -1
  54. package/lib/@openglobus/og.umd.js +1 -1
  55. package/lib/@openglobus/og.umd.js.map +1 -1
  56. package/lib/js/Object3d.d.ts +20 -10
  57. package/lib/js/Object3d.js +124 -48
  58. package/lib/js/camera/Camera.d.ts +9 -0
  59. package/lib/js/camera/Camera.js +27 -1
  60. package/lib/js/camera/Frustum.d.ts +3 -0
  61. package/lib/js/camera/Frustum.js +7 -0
  62. package/lib/js/control/Atmosphere.js +10 -6
  63. package/lib/js/control/CameraLock.d.ts +38 -0
  64. package/lib/js/control/CameraLock.js +216 -0
  65. package/lib/js/control/Control.js +1 -1
  66. package/lib/js/control/DebugInfo.js +13 -3
  67. package/lib/js/control/KeyboardNavigation.js +1 -1
  68. package/lib/js/control/ScaleControl.js +9 -3
  69. package/lib/js/control/SimpleNavigation.d.ts +27 -10
  70. package/lib/js/control/SimpleNavigation.js +148 -49
  71. package/lib/js/control/Sun.js +1 -1
  72. package/lib/js/control/elevationProfile/ElevationProfileScene.js +4 -4
  73. package/lib/js/control/geoObjectEditor/ArrowEntity.d.ts +15 -0
  74. package/lib/js/control/geoObjectEditor/ArrowEntity.js +59 -0
  75. package/lib/js/control/geoObjectEditor/AxisTrackEntity.d.ts +9 -0
  76. package/lib/js/control/geoObjectEditor/AxisTrackEntity.js +93 -0
  77. package/lib/js/control/geoObjectEditor/GeoObjectEditor.d.ts +13 -0
  78. package/lib/js/control/geoObjectEditor/GeoObjectEditor.js +30 -0
  79. package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +69 -0
  80. package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.js +502 -0
  81. package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +78 -9
  82. package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.js +487 -43
  83. package/lib/js/control/geoObjectEditor/MoveAxisEntity.d.ts +17 -0
  84. package/lib/js/control/geoObjectEditor/MoveAxisEntity.js +106 -0
  85. package/lib/js/control/geoObjectEditor/MovePlaneEntity.d.ts +7 -0
  86. package/lib/js/control/geoObjectEditor/MovePlaneEntity.js +34 -0
  87. package/lib/js/control/geoObjectEditor/RotateEntity.d.ts +9 -0
  88. package/lib/js/control/geoObjectEditor/RotateEntity.js +105 -0
  89. package/lib/js/control/geoObjectEditor/colors.d.ts +8 -0
  90. package/lib/js/control/geoObjectEditor/colors.js +8 -0
  91. package/lib/js/control/index.d.ts +2 -0
  92. package/lib/js/control/index.js +2 -0
  93. package/lib/js/control/timeline/TimelineControl.js +2 -0
  94. package/lib/js/entity/Entity.d.ts +278 -19
  95. package/lib/js/entity/Entity.js +483 -63
  96. package/lib/js/entity/EntityCollection.d.ts +8 -9
  97. package/lib/js/entity/EntityCollection.js +48 -45
  98. package/lib/js/entity/GeoObject.d.ts +141 -36
  99. package/lib/js/entity/GeoObject.js +153 -90
  100. package/lib/js/entity/GeoObjectHandler.d.ts +39 -63
  101. package/lib/js/entity/GeoObjectHandler.js +198 -295
  102. package/lib/js/entity/InstanceData.d.ts +76 -0
  103. package/lib/js/entity/InstanceData.js +344 -0
  104. package/lib/js/entity/Polyline.d.ts +19 -6
  105. package/lib/js/entity/Polyline.js +76 -36
  106. package/lib/js/entity/PolylineHandler.d.ts +7 -0
  107. package/lib/js/entity/PolylineHandler.js +26 -1
  108. package/lib/js/index.d.ts +2 -1
  109. package/lib/js/index.js +2 -1
  110. package/lib/js/layer/Bing.js +2 -2
  111. package/lib/js/layer/Vector.d.ts +4 -0
  112. package/lib/js/layer/Vector.js +16 -0
  113. package/lib/js/light/LightSource.d.ts +1 -139
  114. package/lib/js/light/LightSource.js +21 -227
  115. package/lib/js/math/Quat.d.ts +46 -33
  116. package/lib/js/math/Quat.js +91 -90
  117. package/lib/js/math/Ray.d.ts +10 -4
  118. package/lib/js/math/Ray.js +20 -4
  119. package/lib/js/math/Vec3.d.ts +15 -0
  120. package/lib/js/math/Vec3.js +30 -1
  121. package/lib/js/math.d.ts +2 -2
  122. package/lib/js/math.js +3 -3
  123. package/lib/js/quadTree/EntityCollectionNode.d.ts +2 -2
  124. package/lib/js/quadTree/EntityCollectionNode.js +8 -8
  125. package/lib/js/quadTree/Node.d.ts +1 -1
  126. package/lib/js/quadTree/Node.js +2 -2
  127. package/lib/js/quadTree/QuadTreeStrategy.js +1 -1
  128. package/lib/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +1 -1
  129. package/lib/js/quadTree/earth/EarthEntityCollectionNodeLonLat.js +2 -2
  130. package/lib/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +1 -1
  131. package/lib/js/quadTree/equi/EquiEntityCollectionNodeLonLat.js +2 -2
  132. package/lib/js/renderer/Renderer.d.ts +63 -44
  133. package/lib/js/renderer/Renderer.js +260 -263
  134. package/lib/js/renderer/RendererEvents.d.ts +1 -0
  135. package/lib/js/renderer/RendererEvents.js +2 -1
  136. package/lib/js/scene/Planet.d.ts +11 -7
  137. package/lib/js/scene/Planet.js +109 -87
  138. package/lib/js/scene/RenderNode.d.ts +10 -25
  139. package/lib/js/scene/RenderNode.js +70 -58
  140. package/lib/js/shaders/depth.js +2 -5
  141. package/lib/js/shaders/drawnode.d.ts +1 -0
  142. package/lib/js/shaders/drawnode.js +51 -52
  143. package/lib/js/shaders/geoObject.d.ts +1 -0
  144. package/lib/js/shaders/geoObject.js +154 -91
  145. package/lib/js/shaders/polyline.js +68 -51
  146. package/lib/js/shaders/utils.d.ts +1 -1
  147. package/lib/js/shaders/utils.js +11 -0
  148. package/lib/js/ui/Checkbox.d.ts +31 -0
  149. package/lib/js/ui/Checkbox.js +110 -0
  150. package/lib/js/ui/Color.js +2 -1
  151. package/lib/js/ui/Dialog.d.ts +3 -0
  152. package/lib/js/ui/Dialog.js +20 -0
  153. package/lib/js/ui/Input.d.ts +32 -0
  154. package/lib/js/ui/Input.js +107 -0
  155. package/lib/js/ui/View.d.ts +3 -1
  156. package/lib/js/ui/View.js +6 -0
  157. package/lib/js/utils/objParser.d.ts +44 -12
  158. package/lib/js/utils/objParser.js +241 -149
  159. package/lib/js/utils/shared.d.ts +22 -0
  160. package/lib/js/utils/shared.js +34 -0
  161. package/lib/js/webgl/BaseFramebuffer.d.ts +0 -1
  162. package/lib/js/webgl/Framebuffer.d.ts +35 -8
  163. package/lib/js/webgl/Framebuffer.js +136 -29
  164. package/lib/js/webgl/Handler.d.ts +1 -0
  165. package/lib/js/webgl/Handler.js +11 -1
  166. package/lib/js/webgl/Program.js +0 -8
  167. package/package.json +4 -2
@@ -1,7 +1,7 @@
1
1
  import { Extent } from "../Extent";
2
2
  import { LonLat } from "../LonLat";
3
3
  import { Vec3 } from "../math/Vec3";
4
- import { cloneArray, htmlColorToFloat32Array, htmlColorToRgba, makeArray, makeArrayTyped } from "../utils/shared";
4
+ import { cloneArray, createVector3, htmlColorToFloat32Array, htmlColorToRgba, makeArray, makeArrayTyped } from "../utils/shared";
5
5
  const VERTICES_BUFFER = 0;
6
6
  const INDEX_BUFFER = 1;
7
7
  const COLORS_BUFFER = 2;
@@ -27,6 +27,7 @@ const A = 3;
27
27
  class Polyline {
28
28
  constructor(options = {}) {
29
29
  this.__id = Polyline.__counter__++;
30
+ this.__doubleToTwoFloats = Vec3.doubleToTwoFloats;
30
31
  this.altitude = options.altitude || 0.0;
31
32
  this.thickness = options.thickness || 1.5;
32
33
  this._opacity = options.opacity != undefined ? options.opacity : 1.0;
@@ -59,6 +60,9 @@ class Polyline {
59
60
  this._buffersUpdateCallbacks[INDEX_BUFFER] = this._createIndexBuffer;
60
61
  this._buffersUpdateCallbacks[COLORS_BUFFER] = this._createColorsBuffer;
61
62
  this._changedBuffers = new Array(this._buffersUpdateCallbacks.length);
63
+ let c = createVector3(options.visibleSpherePosition).toArray();
64
+ let r = options.visibleSphereRadius || 0;
65
+ this._visibleSphere = new Float32Array([...c, r]);
62
66
  // create path
63
67
  if (options.pathLonLat) {
64
68
  this.setPathLonLat(options.pathLonLat);
@@ -70,9 +74,8 @@ class Polyline {
70
74
  }
71
75
  /**
72
76
  * Appends to the line array new cartesian coordinates line data.
73
- * @static
74
77
  */
75
- static appendLineData3v(path3v, pathColors, defaultColor, isClosed, outVerticesHigh, outVerticesLow, outOrders, outIndexes, ellipsoid, outTransformedPathLonLat, outPath3v, outTransformedPathMerc, outExtent, outColors) {
78
+ __appendLineData3v(path3v, pathColors, defaultColor, isClosed, outVerticesHigh, outVerticesLow, outOrders, outIndexes, ellipsoid, outTransformedPathLonLat, outPath3v, outTransformedPathMerc, outExtent, outColors) {
76
79
  var index = 0;
77
80
  var v_high = new Vec3(), v_low = new Vec3();
78
81
  if (outExtent) {
@@ -118,7 +121,7 @@ class Polyline {
118
121
  if (pathColors_j && pathColors_j[0]) {
119
122
  color = pathColors_j[0];
120
123
  }
121
- Vec3.doubleToTwoFloats(last, v_high, v_low);
124
+ this.__doubleToTwoFloats(last, v_high, v_low);
122
125
  outVerticesHigh.push(v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z);
123
126
  outVerticesLow.push(v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z);
124
127
  let r = color[R], g = color[G], b = color[B], a = color[A] != undefined ? color[A] : 1.0;
@@ -156,7 +159,7 @@ class Polyline {
156
159
  g = color[G];
157
160
  b = color[B];
158
161
  a = color[A] != undefined ? color[A] : 1.0;
159
- Vec3.doubleToTwoFloats(cur, v_high, v_low);
162
+ this.__doubleToTwoFloats(cur, v_high, v_low);
160
163
  outVerticesHigh.push(v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z);
161
164
  outVerticesLow.push(v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z);
162
165
  outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
@@ -195,7 +198,7 @@ class Polyline {
195
198
  g = color[G];
196
199
  b = color[B];
197
200
  a = color[A] != undefined ? color[A] : 1.0;
198
- Vec3.doubleToTwoFloats(first, v_high, v_low);
201
+ this.__doubleToTwoFloats(first, v_high, v_low);
199
202
  outVerticesHigh.push(v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z);
200
203
  outVerticesLow.push(v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z);
201
204
  outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
@@ -208,9 +211,8 @@ class Polyline {
208
211
  }
209
212
  /**
210
213
  * Appends to the line new cartesian coordinates point data.
211
- * @static
212
214
  */
213
- static appendPoint3v(path3v, point3v, pathColors, color, isClosed, outVerticesHigh, outVerticesLow, outColors, outOrders, outIndexes, ellipsoid, outTransformedPathLonLat, outTransformedPathMerc, outExtent) {
215
+ __appendPoint3v(path3v, point3v, pathColors, color, isClosed, outVerticesHigh, outVerticesLow, outColors, outOrders, outIndexes, ellipsoid, outTransformedPathLonLat, outTransformedPathMerc, outExtent) {
214
216
  var v_high = new Vec3(), v_low = new Vec3();
215
217
  var ii = outIndexes.length - 4, index = outIndexes[ii - 1] + 1;
216
218
  if (path3v.length === 0) {
@@ -258,7 +260,7 @@ class Polyline {
258
260
  }
259
261
  last = new Vec3(p0.x + p0.x - p1.x, p0.y + p0.y - p1.y, p0.z + p0.z - p1.z);
260
262
  }
261
- Vec3.doubleToTwoFloats(last, v_high, v_low);
263
+ this.__doubleToTwoFloats(last, v_high, v_low);
262
264
  let vi = outVerticesHigh.length - 3 * 12;
263
265
  outVerticesHigh[vi] = v_high.x;
264
266
  outVerticesHigh[vi + 1] = v_high.y;
@@ -310,7 +312,7 @@ class Polyline {
310
312
  outExtent.northEast.lat = lonLat.lat;
311
313
  }
312
314
  }
313
- Vec3.doubleToTwoFloats(point3v, v_high, v_low);
315
+ this.__doubleToTwoFloats(point3v, v_high, v_low);
314
316
  let vi = outVerticesHigh.length - 12;
315
317
  outVerticesHigh[vi] = v_high.x;
316
318
  outVerticesHigh[vi + 1] = v_high.y;
@@ -370,7 +372,7 @@ class Polyline {
370
372
  first = new Vec3(p0.x + p0.x - p1.x, p0.y + p0.y - p1.y, p0.z + p0.z - p1.z);
371
373
  outIndexes.push(index - 1, index - 1, index - 1, index - 1);
372
374
  }
373
- Vec3.doubleToTwoFloats(first, v_high, v_low);
375
+ this.__doubleToTwoFloats(first, v_high, v_low);
374
376
  outVerticesHigh.push(v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z);
375
377
  outVerticesLow.push(v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z);
376
378
  outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
@@ -418,7 +420,7 @@ class Polyline {
418
420
  * Appends to the line array new geodetic coordinates line data.
419
421
  * @static
420
422
  */
421
- static appendLineDataLonLat(pathLonLat, pathColors, defaultColor, isClosed, outVerticesHigh, outVerticesLow, outOrders, outIndexes, ellipsoid, outTransformedPathCartesian, outPathLonLat, outTransformedPathMerc, outExtent, outColors) {
423
+ __appendLineDataLonLat(pathLonLat, pathColors, defaultColor, isClosed, outVerticesHigh, outVerticesLow, outOrders, outIndexes, ellipsoid, outTransformedPathCartesian, outPathLonLat, outTransformedPathMerc, outExtent, outColors) {
422
424
  var index = 0;
423
425
  var v_high = new Vec3(), v_low = new Vec3();
424
426
  if (outExtent) {
@@ -476,7 +478,7 @@ class Polyline {
476
478
  if (pathColors_j && pathColors_j[0]) {
477
479
  color = pathColors_j[0];
478
480
  }
479
- Vec3.doubleToTwoFloats(last, v_high, v_low);
481
+ this.__doubleToTwoFloats(last, v_high, v_low);
480
482
  outVerticesHigh.push(v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z);
481
483
  outVerticesLow.push(v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z);
482
484
  let r = color[R], g = color[G], b = color[B], a = color[A] != undefined ? color[A] : 1.0;
@@ -500,7 +502,7 @@ class Polyline {
500
502
  outTransformedPathCartesian[j].push(cartesian);
501
503
  outPathLonLat[j].push(cur);
502
504
  outTransformedPathMerc[j].push(cur.forwardMercator());
503
- Vec3.doubleToTwoFloats(cartesian, v_high, v_low);
505
+ this.__doubleToTwoFloats(cartesian, v_high, v_low);
504
506
  outVerticesHigh.push(v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z);
505
507
  outVerticesLow.push(v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z);
506
508
  outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
@@ -559,7 +561,7 @@ class Polyline {
559
561
  g = color[G];
560
562
  b = color[B];
561
563
  a = color[A] != undefined ? color[A] : 1.0;
562
- Vec3.doubleToTwoFloats(first, v_high, v_low);
564
+ this.__doubleToTwoFloats(first, v_high, v_low);
563
565
  outVerticesHigh.push(v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z);
564
566
  outVerticesLow.push(v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z);
565
567
  outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
@@ -591,7 +593,7 @@ class Polyline {
591
593
  else {
592
594
  last = new Vec3(path[0].x + path[0].x - path[1].x, path[0].y + path[0].y - path[1].y, path[0].z + path[0].z - path[1].z);
593
595
  }
594
- Vec3.doubleToTwoFloats(last, v_high, v_low);
596
+ this.__doubleToTwoFloats(last, v_high, v_low);
595
597
  vh[k] = v_high.x;
596
598
  vl[k++] = v_low.x;
597
599
  vh[k] = v_high.y;
@@ -639,7 +641,7 @@ class Polyline {
639
641
  extent.northEast.lat = lonLat.lat;
640
642
  }
641
643
  }
642
- Vec3.doubleToTwoFloats(cur, v_high, v_low);
644
+ this.__doubleToTwoFloats(cur, v_high, v_low);
643
645
  vh[k] = v_high.x;
644
646
  vl[k++] = v_low.x;
645
647
  vh[k] = v_high.y;
@@ -673,7 +675,7 @@ class Polyline {
673
675
  var l1 = path.length - 1;
674
676
  first = new Vec3(path[l1].x + path[l1].x - path[l1 - 1].x, path[l1].y + path[l1].y - path[l1 - 1].y, path[l1].z + path[l1].z - path[l1 - 1].z);
675
677
  }
676
- Vec3.doubleToTwoFloats(first, v_high, v_low);
678
+ this.__doubleToTwoFloats(first, v_high, v_low);
677
679
  vh[k] = v_high.x;
678
680
  vl[k++] = v_low.x;
679
681
  vh[k] = v_high.y;
@@ -722,7 +724,7 @@ class Polyline {
722
724
  let p0 = ellipsoid.lonLatToCartesian(path[0]), p1 = ellipsoid.lonLatToCartesian(path[1]);
723
725
  last = new Vec3(p0.x + p0.x - p1.x, p0.y + p0.y - p1.y, p0.z + p0.z - p1.z);
724
726
  }
725
- Vec3.doubleToTwoFloats(last, v_high, v_low);
727
+ this.__doubleToTwoFloats(last, v_high, v_low);
726
728
  vh[k] = v_high.x;
727
729
  vl[k++] = v_low.x;
728
730
  vh[k] = v_high.y;
@@ -753,7 +755,7 @@ class Polyline {
753
755
  c[j][i] = cartesian;
754
756
  m[j][i] = cur.forwardMercator();
755
757
  l[j][i] = cur;
756
- Vec3.doubleToTwoFloats(cartesian, v_high, v_low);
758
+ this.__doubleToTwoFloats(cartesian, v_high, v_low);
757
759
  vh[k] = v_high.x;
758
760
  vl[k++] = v_low.x;
759
761
  vh[k] = v_high.y;
@@ -799,7 +801,7 @@ class Polyline {
799
801
  let p0 = ellipsoid.lonLatToCartesian(path[path.length - 1]), p1 = ellipsoid.lonLatToCartesian(path[path.length - 2]);
800
802
  first = new Vec3(p0.x + p0.x - p1.x, p0.y + p0.y - p1.y, p0.z + p0.z - p1.z);
801
803
  }
802
- Vec3.doubleToTwoFloats(first, v_high, v_low);
804
+ this.__doubleToTwoFloats(first, v_high, v_low);
803
805
  vh[k] = v_high.x;
804
806
  vl[k++] = v_low.x;
805
807
  vh[k] = v_high.y;
@@ -893,7 +895,7 @@ class Polyline {
893
895
  last = new Vec3(path[0].x + path[0].x - path[1].x, path[0].y + path[0].y - path[1].y, path[0].z + path[0].z - path[1].z);
894
896
  }
895
897
  k = kk;
896
- Vec3.doubleToTwoFloats(last, v_high, v_low);
898
+ this.__doubleToTwoFloats(last, v_high, v_low);
897
899
  vh[k] = v_high.x;
898
900
  vh[k + 1] = v_high.y;
899
901
  vh[k + 2] = v_high.z;
@@ -949,7 +951,7 @@ class Polyline {
949
951
  }
950
952
  }
951
953
  k = kk + index * 12 + 12;
952
- Vec3.doubleToTwoFloats(coordinates, v_high, v_low);
954
+ this.__doubleToTwoFloats(coordinates, v_high, v_low);
953
955
  vh[k] = v_high.x;
954
956
  vh[k + 1] = v_high.y;
955
957
  vh[k + 2] = v_high.z;
@@ -984,7 +986,7 @@ class Polyline {
984
986
  first = new Vec3(path[l1].x + path[l1].x - path[l1 - 1].x, path[l1].y + path[l1].y - path[l1 - 1].y, path[l1].z + path[l1].z - path[l1 - 1].z);
985
987
  }
986
988
  k = kk + path.length * 12 + 12;
987
- Vec3.doubleToTwoFloats(first, v_high, v_low);
989
+ this.__doubleToTwoFloats(first, v_high, v_low);
988
990
  vh[k] = v_high.x;
989
991
  vh[k + 1] = v_high.y;
990
992
  vh[k + 2] = v_high.z;
@@ -1091,7 +1093,7 @@ class Polyline {
1091
1093
  this._colors = makeArray(this._colors);
1092
1094
  this._orders = makeArray(this._orders);
1093
1095
  this._indexes = makeArray(this._indexes);
1094
- Polyline.appendPoint3v(this._path3v, point3v, this._pathColors, color || this._defaultColor, this._closedLine, this._verticesHigh, this._verticesLow, this._colors, this._orders, this._indexes, !skipEllipsoid ? this._renderNode.ellipsoid : null, this._pathLonLat, this._pathLonLatMerc, this._extent);
1096
+ this.__appendPoint3v(this._path3v, point3v, this._pathColors, color || this._defaultColor, this._closedLine, this._verticesHigh, this._verticesLow, this._colors, this._orders, this._indexes, !skipEllipsoid ? this._renderNode.ellipsoid : null, this._pathLonLat, this._pathLonLatMerc, this._extent);
1095
1097
  this._pathLengths[this._path3v.length] += 1;
1096
1098
  this._changedBuffers[VERTICES_BUFFER] = true;
1097
1099
  this._changedBuffers[COLORS_BUFFER] = true;
@@ -1188,6 +1190,14 @@ class Polyline {
1188
1190
  setOpacity(opacity) {
1189
1191
  this._opacity = opacity;
1190
1192
  }
1193
+ /**
1194
+ * Gets polyline opacity.
1195
+ * @public
1196
+ * @param {number} opacity - Opacity.
1197
+ */
1198
+ getOpacity() {
1199
+ return this._opacity;
1200
+ }
1191
1201
  /**
1192
1202
  * Sets Polyline thickness in screen pixels.
1193
1203
  * @public
@@ -1273,12 +1283,12 @@ class Polyline {
1273
1283
  }
1274
1284
  _createData3v(path3v) {
1275
1285
  this._clearData();
1276
- Polyline.appendLineData3v(path3v, this._pathColors, this._defaultColor, this._closedLine, this._verticesHigh, this._verticesLow, this._orders, this._indexes, this._renderNode.ellipsoid, this._pathLonLat, this._path3v, this._pathLonLatMerc, this._extent, this._colors);
1286
+ this.__appendLineData3v(path3v, this._pathColors, this._defaultColor, this._closedLine, this._verticesHigh, this._verticesLow, this._orders, this._indexes, this._renderNode.ellipsoid, this._pathLonLat, this._path3v, this._pathLonLatMerc, this._extent, this._colors);
1277
1287
  this._resizePathLengths(0);
1278
1288
  }
1279
1289
  _createDataLonLat(pathLonlat) {
1280
1290
  this._clearData();
1281
- Polyline.appendLineDataLonLat(pathLonlat, this._pathColors, this._defaultColor, this._closedLine, this._verticesHigh, this._verticesLow, this._orders, this._indexes, this._renderNode.ellipsoid, this._path3v, this._pathLonLat, this._pathLonLatMerc, this._extent, this._colors);
1291
+ this.__appendLineDataLonLat(pathLonlat, this._pathColors, this._defaultColor, this._closedLine, this._verticesHigh, this._verticesLow, this._orders, this._indexes, this._renderNode.ellipsoid, this._path3v, this._pathLonLat, this._pathLonLatMerc, this._extent, this._colors);
1282
1292
  this._resizePathLengths(0);
1283
1293
  }
1284
1294
  /**
@@ -1375,13 +1385,22 @@ class Polyline {
1375
1385
  }
1376
1386
  this._changedBuffers[COLORS_BUFFER] = true;
1377
1387
  }
1388
+ setPathLonLatFast(pathLonLat, pathColors) {
1389
+ this.setPathLonLat(pathLonLat, pathColors, true);
1390
+ }
1391
+ setPath3vFast(path3v, pathColors) {
1392
+ this.setPath3v(path3v, pathColors, true);
1393
+ }
1378
1394
  /**
1379
1395
  * Sets polyline geodetic coordinates.
1380
1396
  * @public
1381
1397
  * @param {SegmentPathLonLat[]} pathLonLat - Polyline path cartesian coordinates.
1382
1398
  * @param {Boolean} [forceEqual=false] - OPTIMIZATION FLAG: Makes assigning faster for size equal coordinates array.
1383
1399
  */
1384
- setPathLonLat(pathLonLat, forceEqual = false) {
1400
+ setPathLonLat(pathLonLat, pathColors, forceEqual = false) {
1401
+ if (pathColors) {
1402
+ this._pathColors = [].concat(pathColors);
1403
+ }
1385
1404
  if (this._renderNode && this._renderNode.ellipsoid) {
1386
1405
  if (forceEqual) {
1387
1406
  this._setEqualPathLonLat(pathLonLat);
@@ -1399,6 +1418,9 @@ class Polyline {
1399
1418
  this._pathLonLat = [].concat(pathLonLat);
1400
1419
  }
1401
1420
  }
1421
+ getSize(index = 0) {
1422
+ return this._path3v[index].length;
1423
+ }
1402
1424
  /**
1403
1425
  * Sets Polyline cartesian coordinates.
1404
1426
  * @public
@@ -1442,8 +1464,9 @@ class Polyline {
1442
1464
  gl.uniformMatrix4fv(shu.proj, false, r.activeCamera.getProjectionMatrix());
1443
1465
  gl.uniformMatrix4fv(shu.view, false, r.activeCamera.getViewMatrix());
1444
1466
  // gl.uniform4fv(shu.color, [this.color.x, this.color.y, this.color.z, this.color.w * this._handler._entityCollection._fadingOpacity]);
1445
- gl.uniform3fv(shu.eyePositionHigh, r.activeCamera.eyeHigh);
1446
- gl.uniform3fv(shu.eyePositionLow, r.activeCamera.eyeLow);
1467
+ gl.uniform3fv(shu.rtcEyePositionHigh, this._handler._rtcEyePositionHigh);
1468
+ gl.uniform3fv(shu.rtcEyePositionLow, this._handler._rtcEyePositionLow);
1469
+ gl.uniform4fv(shu.visibleSphere, this._visibleSphere);
1447
1470
  //gl.uniform2fv(shu.uFloatParams, [(rn as Planet)._planetRadius2 || 0.0, r.activeCamera!._tanViewAngle_hradOneByHeight]);
1448
1471
  gl.uniform2fv(shu.viewport, [r.handler.canvas.width, r.handler.canvas.height]);
1449
1472
  gl.uniform1f(shu.thickness, this.thickness * 0.5);
@@ -1474,9 +1497,10 @@ class Polyline {
1474
1497
  let sh = r.handler.programs.polyline_picking;
1475
1498
  let p = sh._program;
1476
1499
  let gl = r.handler.gl, sha = p.attributes, shu = p.uniforms;
1500
+ let ec = this._handler._entityCollection;
1477
1501
  sh.activate();
1478
1502
  gl.disable(gl.CULL_FACE);
1479
- gl.uniform1f(shu.depthOffset, this._handler._entityCollection.polygonOffsetUnits);
1503
+ gl.uniform1f(shu.depthOffset, ec.polygonOffsetUnits);
1480
1504
  gl.uniformMatrix4fv(shu.proj, false, r.activeCamera.getProjectionMatrix());
1481
1505
  gl.uniformMatrix4fv(shu.view, false, r.activeCamera.getViewMatrix());
1482
1506
  gl.uniform4fv(shu.color, [
@@ -1485,12 +1509,11 @@ class Polyline {
1485
1509
  this._pickingColor[2],
1486
1510
  1.0
1487
1511
  ]);
1488
- gl.uniform3fv(shu.eyePositionHigh, r.activeCamera.eyeHigh);
1489
- gl.uniform3fv(shu.eyePositionLow, r.activeCamera.eyeLow);
1490
- gl.uniform2fv(shu.uFloatParams, [rn._planetRadius2 || 0.0, r.activeCamera._tanViewAngle_hradOneByHeight]);
1491
- //@todo: replace to the handler property
1512
+ gl.uniform3fv(shu.rtcEyePositionHigh, this._handler._rtcEyePositionHigh);
1513
+ gl.uniform3fv(shu.rtcEyePositionLow, this._handler._rtcEyePositionLow);
1514
+ gl.uniform4fv(shu.visibleSphere, this._visibleSphere);
1492
1515
  gl.uniform2fv(shu.viewport, [r.handler.canvas.width, r.handler.canvas.height]);
1493
- gl.uniform1f(shu.thickness, this.thickness * 0.5);
1516
+ gl.uniform1f(shu.thickness, this.thickness * 0.5 * ec.pickingScale[0]);
1494
1517
  let v = this._verticesHighBuffer;
1495
1518
  gl.bindBuffer(gl.ARRAY_BUFFER, v);
1496
1519
  gl.vertexAttribPointer(sha.prevHigh, v.itemSize, gl.FLOAT, false, 12, 0);
@@ -1589,6 +1612,23 @@ class Polyline {
1589
1612
  this._colors = makeArrayTyped(this._colors);
1590
1613
  this._colorsBuffer = h.createArrayBuffer(new Float32Array(this._colors), 4, this._colors.length / 4);
1591
1614
  }
1615
+ setVisibleSphere(p, r) {
1616
+ if (this._handler) {
1617
+ this._visibleSphere[0] = p.x - this._handler._relativeCenter.x;
1618
+ this._visibleSphere[1] = p.y - this._handler._relativeCenter.y;
1619
+ this._visibleSphere[2] = p.z - this._handler._relativeCenter.z;
1620
+ }
1621
+ this._visibleSphere[3] = r;
1622
+ }
1623
+ updateRTCPosition() {
1624
+ if (this._handler && this._renderNode) {
1625
+ this._visibleSphere[0] = this._visibleSphere[0] - this._handler._relativeCenter.x;
1626
+ this._visibleSphere[1] = this._visibleSphere[1] - this._handler._relativeCenter.y;
1627
+ this._visibleSphere[2] = this._visibleSphere[2] - this._handler._relativeCenter.z;
1628
+ this._setEqualPath3v(this._path3v);
1629
+ }
1630
+ this._changedBuffers[VERTICES_BUFFER] = true;
1631
+ }
1592
1632
  }
1593
1633
  Polyline.__counter__ = 0;
1594
1634
  export { Polyline };
@@ -2,6 +2,7 @@ import { EntityCollection } from "./EntityCollection";
2
2
  import { Polyline } from "./Polyline";
3
3
  import { Renderer } from "../renderer/Renderer";
4
4
  import { RenderNode } from "../scene/RenderNode";
5
+ import { Vec3 } from "../math/Vec3";
5
6
  declare class PolylineHandler {
6
7
  static __counter__: number;
7
8
  protected __id: number;
@@ -9,6 +10,9 @@ declare class PolylineHandler {
9
10
  pickingEnabled: boolean;
10
11
  protected _renderer: Renderer | null;
11
12
  protected _polylines: Polyline[];
13
+ _relativeCenter: Vec3;
14
+ _rtcEyePositionHigh: Float32Array;
15
+ _rtcEyePositionLow: Float32Array;
12
16
  constructor(entityCollection: EntityCollection);
13
17
  protected _initProgram(): void;
14
18
  setRenderNode(renderNode: RenderNode): void;
@@ -18,5 +22,8 @@ declare class PolylineHandler {
18
22
  draw(): void;
19
23
  drawPicking(): void;
20
24
  clear(): void;
25
+ getRTCPosition(pos: Vec3, rtcPositionHigh: Vec3, rtcPositionLow: Vec3): void;
26
+ setRelativeCenter(c: Vec3): void;
27
+ protected _updateRTCEyePosition(): void;
21
28
  }
22
29
  export { PolylineHandler };
@@ -1,4 +1,5 @@
1
1
  import * as shaders from '../shaders/polyline';
2
+ import { Vec3 } from "../math/Vec3";
2
3
  class PolylineHandler {
3
4
  constructor(entityCollection) {
4
5
  this.__id = PolylineHandler.__counter__++;
@@ -6,6 +7,9 @@ class PolylineHandler {
6
7
  this._renderer = null;
7
8
  this._polylines = [];
8
9
  this.pickingEnabled = true;
10
+ this._relativeCenter = new Vec3();
11
+ this._rtcEyePositionHigh = new Float32Array([0, 0, 0]);
12
+ this._rtcEyePositionLow = new Float32Array([0, 0, 0]);
9
13
  }
10
14
  _initProgram() {
11
15
  if (this._renderer && this._renderer.handler) {
@@ -28,9 +32,12 @@ class PolylineHandler {
28
32
  if (polyline._handlerIndex === -1) {
29
33
  polyline._handler = this;
30
34
  polyline._handlerIndex = this._polylines.length;
35
+ polyline.__doubleToTwoFloats = this.getRTCPosition.bind(this);
31
36
  this._polylines.push(polyline);
32
- this._entityCollection && this._entityCollection.renderNode &&
37
+ if (this._entityCollection && this._entityCollection.renderNode) {
33
38
  polyline.setRenderNode(this._entityCollection.renderNode);
39
+ polyline.updateRTCPosition();
40
+ }
34
41
  }
35
42
  }
36
43
  remove(polyline) {
@@ -50,6 +57,7 @@ class PolylineHandler {
50
57
  }
51
58
  }
52
59
  draw() {
60
+ this._updateRTCEyePosition();
53
61
  let i = this._polylines.length;
54
62
  while (i--) {
55
63
  this._polylines[i].draw();
@@ -73,6 +81,23 @@ class PolylineHandler {
73
81
  this._polylines.length = 0;
74
82
  this._polylines = [];
75
83
  }
84
+ getRTCPosition(pos, rtcPositionHigh, rtcPositionLow) {
85
+ let rtcPosition = pos.sub(this._relativeCenter);
86
+ Vec3.doubleToTwoFloats(rtcPosition, rtcPositionHigh, rtcPositionLow);
87
+ }
88
+ setRelativeCenter(c) {
89
+ this._relativeCenter.copy(c);
90
+ for (let i = 0; i < this._polylines.length; i++) {
91
+ this._polylines[i].updateRTCPosition();
92
+ }
93
+ }
94
+ _updateRTCEyePosition() {
95
+ let r = this._renderer;
96
+ if (r.activeCamera.isFirstPass) {
97
+ let rtcEyePosition = r.activeCamera.eye.sub(this._relativeCenter);
98
+ Vec3.doubleToTwoFloat32Array(rtcEyePosition, this._rtcEyePositionHigh, this._rtcEyePositionLow);
99
+ }
100
+ }
76
101
  }
77
102
  PolylineHandler.__counter__ = 0;
78
103
  export { PolylineHandler };
package/lib/js/index.d.ts CHANGED
@@ -30,4 +30,5 @@ import { Control } from './control/Control';
30
30
  export * from './entity/index';
31
31
  export * from './layer/index';
32
32
  import { EmptyTerrain, GlobusTerrain, RgbTerrain, BilTerrain, GlobusRgbTerrain } from './terrain/index';
33
- export { bv, jd, math, mercator, utils, input, control, scene, quadTreeStrategyType, wgs84, moon, mars, terrain, layer, webgl, Framebuffer, EmptyTerrain, GlobusTerrain, RgbTerrain, GlobusRgbTerrain, BilTerrain, Control, Camera, Ellipsoid, Planet, PlanetCamera, LightSource, Program, Handler, Multisample, Renderer, Clock, Events, Extent, LonLat, RenderNode, Line2, Line3, Mat3, Mat4, Plane, Quat, Ray, Vec2, Vec3, Vec4, Geoid, Popup, QuadTreeStrategy, EquiQuadTreeStrategy, EarthQuadTreeStrategy, Wgs84QuadTreeStrategy, Object3d };
33
+ import { MoveAxisEntity } from "./control/geoObjectEditor/MoveAxisEntity";
34
+ export { bv, jd, math, mercator, utils, input, control, scene, quadTreeStrategyType, wgs84, moon, mars, terrain, layer, webgl, Framebuffer, EmptyTerrain, GlobusTerrain, RgbTerrain, GlobusRgbTerrain, BilTerrain, Control, Camera, Ellipsoid, Planet, PlanetCamera, LightSource, Program, Handler, Multisample, Renderer, Clock, Events, Extent, LonLat, RenderNode, Line2, Line3, Mat3, Mat4, Plane, Quat, Ray, Vec2, Vec3, Vec4, Geoid, Popup, QuadTreeStrategy, EquiQuadTreeStrategy, EarthQuadTreeStrategy, Wgs84QuadTreeStrategy, Object3d, MoveAxisEntity, };
package/lib/js/index.js CHANGED
@@ -30,4 +30,5 @@ import { Control } from './control/Control';
30
30
  export * from './entity/index';
31
31
  export * from './layer/index';
32
32
  import { EmptyTerrain, GlobusTerrain, RgbTerrain, BilTerrain, GlobusRgbTerrain } from './terrain/index';
33
- export { bv, jd, math, mercator, utils, input, control, scene, quadTreeStrategyType, wgs84, moon, mars, terrain, layer, webgl, Framebuffer, EmptyTerrain, GlobusTerrain, RgbTerrain, GlobusRgbTerrain, BilTerrain, Control, Camera, Ellipsoid, Planet, PlanetCamera, LightSource, Program, Handler, Multisample, Renderer, Clock, Events, Extent, LonLat, RenderNode, Line2, Line3, Mat3, Mat4, Plane, Quat, Ray, Vec2, Vec3, Vec4, Geoid, Popup, QuadTreeStrategy, EquiQuadTreeStrategy, EarthQuadTreeStrategy, Wgs84QuadTreeStrategy, Object3d };
33
+ import { MoveAxisEntity } from "./control/geoObjectEditor/MoveAxisEntity";
34
+ export { bv, jd, math, mercator, utils, input, control, scene, quadTreeStrategyType, wgs84, moon, mars, terrain, layer, webgl, Framebuffer, EmptyTerrain, GlobusTerrain, RgbTerrain, GlobusRgbTerrain, BilTerrain, Control, Camera, Ellipsoid, Planet, PlanetCamera, LightSource, Program, Handler, Multisample, Renderer, Clock, Events, Extent, LonLat, RenderNode, Line2, Line3, Mat3, Mat4, Plane, Quat, Ray, Vec2, Vec3, Vec4, Geoid, Popup, QuadTreeStrategy, EquiQuadTreeStrategy, EarthQuadTreeStrategy, Wgs84QuadTreeStrategy, Object3d, MoveAxisEntity, };
@@ -31,8 +31,8 @@ export class Bing extends XYZ {
31
31
  });
32
32
  },
33
33
  specular: [0.00063, 0.00055, 0.00032],
34
- ambient: "rgb(90,90,90)",
35
- diffuse: "rgb(350,350,350)",
34
+ ambient: [0.35, 0.35, 0.35],
35
+ diffuse: [1.5, 1.5, 1.5],
36
36
  shininess: 20,
37
37
  nightTextureCoefficient: 2.7,
38
38
  ...options
@@ -19,6 +19,7 @@ export interface IVectorParams extends ILayerParams {
19
19
  scaleByDistance?: NumberArray3;
20
20
  labelMaxLetters?: number;
21
21
  useLighting?: boolean;
22
+ depthOrder?: number;
22
23
  }
23
24
  type VectorEventsList = [
24
25
  "draw",
@@ -61,6 +62,7 @@ export type VectorEventsType = EventsHandler<VectorEventsList> & EventsHandler<L
61
62
  */
62
63
  declare class Vector extends Layer {
63
64
  events: VectorEventsType;
65
+ protected _depthOrder: number;
64
66
  /**
65
67
  * Entities collection.
66
68
  * @protected
@@ -113,6 +115,8 @@ declare class Vector extends Layer {
113
115
  protected _labelMaxLetters: number;
114
116
  protected _useLighting: boolean;
115
117
  constructor(name?: string | null, options?: IVectorParams);
118
+ get depthOrder(): number;
119
+ set depthOrder(d: number);
116
120
  get useLighting(): boolean;
117
121
  set useLighting(f: boolean);
118
122
  get labelMaxLetters(): number;
@@ -103,6 +103,16 @@ class Vector extends Layer {
103
103
  this.setEntities(this._entities);
104
104
  this.polygonOffsetUnits = options.polygonOffsetUnits != undefined ? options.polygonOffsetUnits : 0.0;
105
105
  this.pickingEnabled = this._pickingEnabled;
106
+ this._depthOrder = options.depthOrder || 0;
107
+ }
108
+ get depthOrder() {
109
+ return this._depthOrder;
110
+ }
111
+ set depthOrder(d) {
112
+ if (d !== this._depthOrder) {
113
+ this._depthOrder = d;
114
+ this._planet && this._planet.updateVisibleLayers();
115
+ }
106
116
  }
107
117
  get useLighting() {
108
118
  return this._useLighting;
@@ -135,6 +145,9 @@ class Vector extends Layer {
135
145
  this._polylineEntityCollection.addTo(planet, true);
136
146
  this._stripEntityCollection.addTo(planet, true);
137
147
  this._geoObjectEntityCollection.addTo(planet, true);
148
+ this._polylineEntityCollection._layer = this;
149
+ this._stripEntityCollection._layer = this;
150
+ this._geoObjectEntityCollection._layer = this;
138
151
  this.setEntities(this._entities);
139
152
  }
140
153
  }
@@ -143,6 +156,9 @@ class Vector extends Layer {
143
156
  this._polylineEntityCollection.remove();
144
157
  this._stripEntityCollection.remove();
145
158
  this._geoObjectEntityCollection.remove();
159
+ this._polylineEntityCollection._layer = undefined;
160
+ this._stripEntityCollection._layer = undefined;
161
+ this._geoObjectEntityCollection._layer = undefined;
146
162
  return this;
147
163
  }
148
164
  /**