@openglobus/og 0.17.2 → 0.18.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 (490) hide show
  1. package/README.md +75 -46
  2. package/dist/@openglobus/og.esm.js +1 -20
  3. package/dist/@openglobus/og.esm.js.map +1 -1
  4. package/dist/@openglobus/og.umd.js +1 -20
  5. package/dist/@openglobus/og.umd.js.map +1 -1
  6. package/dist/@openglobus/res/fonts/Karla-Bold.json +5252 -0
  7. package/dist/@openglobus/res/fonts/Karla-Bold.ttf.cfg +920 -0
  8. package/dist/@openglobus/res/fonts/Karla-Bold.ttf.png +0 -0
  9. package/dist/@openglobus/res/fonts/Karla-Light.json +5252 -0
  10. package/dist/@openglobus/res/fonts/Karla-Light.ttf.cfg +830 -0
  11. package/dist/@openglobus/res/fonts/Karla-Light.ttf.png +0 -0
  12. package/dist/@openglobus/res/fonts/Karla-Medium.json +5252 -0
  13. package/dist/@openglobus/res/fonts/Karla-Medium.ttf.cfg +1196 -0
  14. package/dist/@openglobus/res/fonts/Karla-Medium.ttf.png +0 -0
  15. package/dist/@openglobus/res/fonts/NotoSansArabic-Regular.json +3332 -0
  16. package/dist/@openglobus/res/fonts/NotoSansArabic-Regular.ttf.cfg +1370 -0
  17. package/dist/@openglobus/res/fonts/NotoSansArabic-Regular.ttf.png +0 -0
  18. package/dist/@openglobus/res/fonts/Roboto-Regular.json +37147 -0
  19. package/dist/@openglobus/res/fonts/Roboto-Regular.ttf.cfg +1340 -0
  20. package/dist/@openglobus/res/fonts/Roboto-Regular.ttf.png +0 -0
  21. package/dist/@openglobus/res/fonts/arial.json +4321 -0
  22. package/dist/@openglobus/res/fonts/arial.ttf.cfg +1570 -0
  23. package/dist/@openglobus/res/fonts/arial.ttf.png +0 -0
  24. package/dist/@openglobus/res/night-4326.png +0 -0
  25. package/dist/@openglobus/res/night.png +0 -0
  26. package/dist/@openglobus/res/spec.png +0 -0
  27. package/package.json +25 -23
  28. package/src/{og/Clock.js → Clock.ts} +100 -78
  29. package/src/Deferred.ts +17 -0
  30. package/src/Events.ts +200 -0
  31. package/src/{og/Extent.js → Extent.ts} +324 -352
  32. package/src/Globe.ts +363 -0
  33. package/src/{og/ImageCanvas.js → ImageCanvas.ts} +244 -236
  34. package/src/Lock.ts +41 -0
  35. package/src/{og/LonLat.js → LonLat.ts} +50 -47
  36. package/src/{og/Object3d.js → Object3d.ts} +89 -55
  37. package/src/Popup.ts +228 -0
  38. package/src/{og/QueueArray.js → QueueArray.ts} +76 -75
  39. package/src/{og/Rectangle.js → Rectangle.ts} +115 -111
  40. package/src/Stack.ts +58 -0
  41. package/src/{og/astro/astro.js → astro/astro.ts} +49 -51
  42. package/src/{og/astro/earth.js → astro/earth.ts} +8 -9
  43. package/src/{og/astro/jd.js → astro/jd.ts} +92 -111
  44. package/src/{og/astro/orbit.js → astro/orbit.ts} +35 -37
  45. package/src/{og/astro/rotation.js → astro/rotation.ts} +4 -6
  46. package/src/{og/bv/Box.js → bv/Box.ts} +21 -17
  47. package/src/{og/bv/Sphere.js → bv/Sphere.ts} +21 -19
  48. package/src/bv/index.ts +4 -0
  49. package/src/{og/camera/Camera.js → camera/Camera.ts} +254 -197
  50. package/src/{og/camera/Frustum.js → camera/Frustum.ts} +137 -111
  51. package/src/{og/camera/PlanetCamera.js → camera/PlanetCamera.ts} +246 -182
  52. package/src/camera/index.ts +4 -0
  53. package/src/{og/cons.js → cons.ts} +14 -18
  54. package/src/{og/control/Atmosphere.js → control/Atmosphere.ts} +50 -50
  55. package/src/{og/control/CompassButton.js → control/CompassButton.ts} +27 -30
  56. package/src/{og/control/Control.js → control/Control.ts} +76 -70
  57. package/src/{og/control/DebugInfo.js → control/DebugInfo.ts} +130 -62
  58. package/src/{og/control/DrawingSwitcher.js → control/DrawingSwitcher.ts} +16 -22
  59. package/src/control/EarthCoordinates.ts +222 -0
  60. package/src/control/EarthNavigation.ts +293 -0
  61. package/src/{og/control/GeoImageDragControl.js → control/GeoImageDragControl.ts} +37 -29
  62. package/src/control/KeyboardNavigation.ts +168 -0
  63. package/src/{og/control/LayerAnimation.js → control/LayerAnimation.ts} +74 -90
  64. package/src/control/LayerSwitcher.ts +76 -0
  65. package/src/{og/control/Lighting.js → control/Lighting.ts} +158 -120
  66. package/src/control/MouseNavigation.ts +468 -0
  67. package/src/control/MouseWheelZoomControl.ts +269 -0
  68. package/src/{og/control/RulerSwitcher.js → control/RulerSwitcher.ts} +18 -20
  69. package/src/control/ScaleControl.ts +131 -0
  70. package/src/control/SegmentBoundVisualization.ts +50 -0
  71. package/src/control/ShowFps.ts +28 -0
  72. package/src/control/SimpleNavigation.ts +118 -0
  73. package/src/{og/control/SimpleSkyBackground.js → control/SimpleSkyBackground.ts} +36 -38
  74. package/src/{og/control/Sun.js → control/Sun.ts} +56 -64
  75. package/src/control/ToggleWireframe.ts +35 -0
  76. package/src/control/TouchNavigation.ts +368 -0
  77. package/src/control/ZoomControl.ts +111 -0
  78. package/src/control/drawing/DrawingControl.ts +45 -0
  79. package/src/{og/control/drawing/LineStringDrawingScene.js → control/drawing/LineStringDrawingScene.ts} +28 -35
  80. package/src/{og/control/drawing/PolygonDrawingScene.js → control/drawing/PolygonDrawingScene.ts} +148 -201
  81. package/src/{og/control/elevationProfile/ElevationProfile.js → control/elevationProfile/ElevationProfile.ts} +70 -36
  82. package/src/control/heightRuler/HeightRuler.ts +16 -0
  83. package/src/{og/control/heightRuler/HeightRulerScene.js → control/heightRuler/HeightRulerScene.ts} +92 -87
  84. package/src/{og/control/heightRuler/HeightRulerSwitcher.js → control/heightRuler/HeightRulerSwitcher.ts} +3 -3
  85. package/src/control/index.ts +45 -0
  86. package/src/control/ruler/Ruler.ts +35 -0
  87. package/src/{og/control/ruler/RulerScene.js → control/ruler/RulerScene.ts} +163 -121
  88. package/src/{og/control/selection/Selection.js → control/selection/Selection.ts} +23 -21
  89. package/src/{og/control/selection/SelectionScene.js → control/selection/SelectionScene.ts} +64 -50
  90. package/src/{og/control/timeline/TimelineControl.js → control/timeline/TimelineControl.ts} +37 -28
  91. package/src/{og/control/timeline/TimelineModel.js → control/timeline/TimelineModel.ts} +50 -35
  92. package/src/{og/control/timeline/TimelineView.js → control/timeline/TimelineView.ts} +162 -113
  93. package/src/{og/control/timeline/timelineUtils.js → control/timeline/timelineUtils.ts} +11 -10
  94. package/src/{og/control → control}/visibleExtent/Segment.js +5 -5
  95. package/src/{og/control → control}/visibleExtent/VisibleExtent.js +8 -15
  96. package/src/{og/control/visibleExtent/drawnode.js → control/visibleExtent/drawnode.ts} +1 -3
  97. package/src/{og/ellipsoid/Ellipsoid.js → ellipsoid/Ellipsoid.ts} +113 -59
  98. package/src/ellipsoid/index.ts +4 -0
  99. package/src/{og/ellipsoid/wgs84.js → ellipsoid/wgs84.ts} +1 -3
  100. package/src/{og/entity/BaseBillboard.js → entity/BaseBillboard.ts} +128 -102
  101. package/src/entity/BaseBillboardHandler.ts +772 -0
  102. package/src/{og/entity/Billboard.js → entity/Billboard.ts} +77 -47
  103. package/src/entity/BillboardHandler.ts +135 -0
  104. package/src/{og/entity/Entity.js → entity/Entity.ts} +285 -226
  105. package/src/{og/entity/EntityCollection.js → entity/EntityCollection.ts} +340 -247
  106. package/src/{og/entity/GeoObject.js → entity/GeoObject.ts} +122 -67
  107. package/src/{og/entity/GeoObjectHandler.js → entity/GeoObjectHandler.ts} +273 -198
  108. package/src/entity/Geometry.ts +486 -0
  109. package/src/{og/entity/GeometryHandler.js → entity/GeometryHandler.ts} +383 -541
  110. package/src/{og/entity/Label.js → entity/Label.ts} +131 -83
  111. package/src/{og/entity/LabelHandler.js → entity/LabelHandler.ts} +289 -255
  112. package/src/{og/entity/LabelWorker.js → entity/LabelWorker.ts} +26 -36
  113. package/src/{og/entity/PointCloud.js → entity/PointCloud.ts} +200 -164
  114. package/src/entity/PointCloudHandler.ts +125 -0
  115. package/src/{og/entity/Polyline.js → entity/Polyline.ts} +517 -539
  116. package/src/{og/entity/PolylineHandler.js → entity/PolylineHandler.ts} +29 -31
  117. package/src/{og/entity/Ray.js → entity/Ray.ts} +89 -60
  118. package/src/{og/entity/RayHandler.js → entity/RayHandler.ts} +201 -306
  119. package/src/{og/entity/Strip.js → entity/Strip.ts} +143 -100
  120. package/src/{og/entity/StripHandler.js → entity/StripHandler.ts} +76 -72
  121. package/src/entity/index.ts +12 -0
  122. package/src/index.ts +173 -0
  123. package/src/input/KeyboardHandler.ts +196 -0
  124. package/src/{og/input/MouseHandler.js → input/MouseHandler.ts} +46 -35
  125. package/src/input/TouchHandler.ts +54 -0
  126. package/src/{og/input/input.js → input/input.ts} +1 -3
  127. package/src/{og/layer/BaseGeoImage.js → layer/BaseGeoImage.ts} +174 -107
  128. package/src/{og/layer/CanvasTiles.js → layer/CanvasTiles.ts} +139 -105
  129. package/src/{og/layer/GeoImage.js → layer/GeoImage.ts} +62 -52
  130. package/src/layer/GeoTexture2d.ts +56 -0
  131. package/src/{og/layer/GeoVideo.js → layer/GeoVideo.ts} +53 -53
  132. package/src/{og/layer/KML.js → layer/KML.ts} +63 -74
  133. package/src/{og/layer/Layer.js → layer/Layer.ts} +399 -223
  134. package/src/{og/layer/Material.js → layer/Material.ts} +40 -35
  135. package/src/{og/layer/Vector.js → layer/Vector.ts} +319 -267
  136. package/src/{og/layer/WMS.js → layer/WMS.ts} +76 -64
  137. package/src/{og/layer/XYZ.js → layer/XYZ.ts} +123 -98
  138. package/src/layer/index.ts +12 -0
  139. package/src/{og/light/LightSource.js → light/LightSource.ts} +132 -93
  140. package/src/{og/math/Line2.js → math/Line2.ts} +11 -8
  141. package/src/{og/math/Line3.js → math/Line3.ts} +49 -27
  142. package/src/{og/math/Mat3.js → math/Mat3.ts} +43 -27
  143. package/src/{og/math/Mat4.js → math/Mat4.ts} +110 -77
  144. package/src/{og/math/Plane.js → math/Plane.ts} +28 -23
  145. package/src/{og/math/Quat.js → math/Quat.ts} +238 -222
  146. package/src/{og/math/Ray.js → math/Ray.ts} +59 -63
  147. package/src/{og/math/Vec2.js → math/Vec2.ts} +85 -76
  148. package/src/{og/math/Vec3.js → math/Vec3.ts} +141 -140
  149. package/src/{og/math/Vec4.js → math/Vec4.ts} +64 -53
  150. package/src/{og/math/coder.js → math/coder.ts} +30 -27
  151. package/src/math/index.ts +26 -0
  152. package/src/{og/math.js → math.ts} +46 -49
  153. package/src/{og/mercator.js → mercator.ts} +143 -149
  154. package/src/{og/proj/EPSG3857.js → proj/EPSG3857.ts} +1 -3
  155. package/src/{og/proj/EPSG4326.js → proj/EPSG4326.ts} +11 -13
  156. package/src/{og/proj/Proj.js → proj/Proj.ts} +27 -23
  157. package/src/{og/quadTree/EPSG4326QuadTreeStrategy.js → quadTree/EPSG4326QuadTreeStrategy.ts} +10 -13
  158. package/src/{og/quadTree/EarthQuadTreeStrategy.js → quadTree/EarthQuadTreeStrategy.ts} +11 -13
  159. package/src/quadTree/EntityCollectionNode.ts +395 -0
  160. package/src/{og/quadTree/MarsQuadTreeStrategy.js → quadTree/MarsQuadTreeStrategy.ts} +10 -13
  161. package/src/{og/quadTree/Node.js → quadTree/Node.ts} +283 -191
  162. package/src/{og/quadTree/QuadTreeStrategy.js → quadTree/QuadTreeStrategy.ts} +35 -29
  163. package/src/quadTree/Wgs84QuadTreeStrategy.ts +22 -0
  164. package/src/quadTree/index.ts +14 -0
  165. package/src/{og/quadTree/quadTree.js → quadTree/quadTree.ts} +75 -77
  166. package/src/{og/renderer/Renderer.js → renderer/Renderer.ts} +454 -298
  167. package/src/{og/renderer/RendererEvents.js → renderer/RendererEvents.ts} +347 -256
  168. package/src/{og/scene/Axes.js → scene/Axes.ts} +26 -22
  169. package/src/{og/scene/BaseNode.js → scene/BaseNode.ts} +53 -47
  170. package/src/{og/scene/Planet.js → scene/Planet.ts} +776 -592
  171. package/src/{og/scene/RenderNode.js → scene/RenderNode.ts} +105 -91
  172. package/src/{og/scene/SkyBox.js → scene/SkyBox.ts} +29 -25
  173. package/src/scene/index.ts +6 -0
  174. package/src/{og/segment/Segment.js → segment/Segment.ts} +497 -371
  175. package/src/{og/segment/SegmentLonLat.js → segment/SegmentLonLat.ts} +81 -87
  176. package/src/{og/segment/SegmentLonLatWgs84.js → segment/SegmentLonLatWgs84.ts} +9 -16
  177. package/src/{og/segment/Slice.js → segment/Slice.ts} +15 -9
  178. package/src/{og/segment/segmentHelper.js → segment/segmentHelper.ts} +57 -49
  179. package/src/{og/shaders/atmos.js → shaders/atmos.ts} +4 -6
  180. package/src/{og/shaders/billboard.js → shaders/billboard.ts} +3 -5
  181. package/src/{og/shaders/bloom.js → shaders/bloom.ts} +2 -4
  182. package/src/{og/shaders/blur.js → shaders/blur.ts} +4 -7
  183. package/src/{og/shaders/depth.js → shaders/depth.ts} +1 -3
  184. package/src/{og/shaders/drawnode.js → shaders/drawnode.ts} +19 -21
  185. package/src/{og/shaders/geoObject.js → shaders/geoObject.ts} +17 -19
  186. package/src/{og/shaders/label.js → shaders/label.ts} +4 -6
  187. package/src/{og/shaders/lumFilter.js → shaders/lumFilter.ts} +2 -4
  188. package/src/{og/shaders/pickingMask.js → shaders/pickingMask.ts} +2 -4
  189. package/src/{og/shaders/pointCloud.js → shaders/pointCloud.ts} +7 -10
  190. package/src/{og/shaders/polyline.js → shaders/polyline.ts} +3 -200
  191. package/src/{og/shaders/ray.js → shaders/ray.ts} +2 -4
  192. package/src/{og/shaders/screenFrame.js → shaders/screenFrame.ts} +2 -4
  193. package/src/{og/shaders/skybox.js → shaders/skybox.ts} +7 -9
  194. package/src/{og/shaders/toneMapping.js → shaders/toneMapping.ts} +2 -4
  195. package/src/{og/shaders/utils.js → shaders/utils.ts} +0 -2
  196. package/src/{og/terrain/BilTerrain.js → terrain/BilTerrain.ts} +38 -32
  197. package/src/terrain/EmptyTerrain.ts +230 -0
  198. package/src/{og/terrain/Geoid.js → terrain/Geoid.ts} +67 -41
  199. package/src/{og/terrain/GlobusTerrain.js → terrain/GlobusTerrain.ts} +159 -153
  200. package/src/{og/terrain/MapboxTerrain.js → terrain/MapboxTerrain.ts} +58 -61
  201. package/src/terrain/index.ts +6 -0
  202. package/src/ui/Button.ts +121 -0
  203. package/src/ui/ButtonGroup.ts +63 -0
  204. package/src/ui/Dialog.ts +244 -0
  205. package/src/ui/Slider.ts +188 -0
  206. package/src/ui/ToggleButton.ts +68 -0
  207. package/src/{og/ui/View.js → ui/View.ts} +66 -59
  208. package/src/utils/BaseWorker.ts +60 -0
  209. package/src/utils/FontAtlas.ts +356 -0
  210. package/src/{og/utils/GeoImageCreator.js → utils/GeoImageCreator.ts} +45 -29
  211. package/src/{og/utils/ImagesCacheManager.js → utils/ImagesCacheManager.ts} +85 -70
  212. package/src/utils/Loader.ts +247 -0
  213. package/src/{og/utils/NormalMapCreator.js → utils/NormalMapCreator.ts} +114 -77
  214. package/src/{og/utils/PlainSegmentWorker.js → utils/PlainSegmentWorker.ts} +41 -24
  215. package/src/{og/utils/TerrainWorker.js → utils/TerrainWorker.ts} +51 -36
  216. package/src/utils/TextureAtlas.ts +322 -0
  217. package/src/{og/utils/VectorTileCreator.js → utils/VectorTileCreator.ts} +67 -52
  218. package/src/{og/utils/colorTable.js → utils/colorTable.ts} +142 -144
  219. package/src/{og/utils/earcut.js → utils/earcut.ts} +664 -661
  220. package/src/{og/utils/objParser.js → utils/objParser.ts} +66 -37
  221. package/src/{og/utils/shared.js → utils/shared.ts} +267 -206
  222. package/src/utils/units.ts +78 -0
  223. package/src/webgl/BaseFramebuffer.ts +125 -0
  224. package/src/webgl/Framebuffer.ts +206 -0
  225. package/src/webgl/Handler.ts +1414 -0
  226. package/src/webgl/Multisample.ts +153 -0
  227. package/src/webgl/Program.ts +451 -0
  228. package/src/{og/webgl/ProgramController.js → webgl/ProgramController.ts} +44 -43
  229. package/src/webgl/index.ts +13 -0
  230. package/src/{og/webgl/types.js → webgl/types.ts} +29 -31
  231. package/src/webgl/variableHandlers.ts +114 -0
  232. package/src/og/Deferred.js +0 -11
  233. package/src/og/Events.js +0 -185
  234. package/src/og/Globe.js +0 -342
  235. package/src/og/Lock.js +0 -44
  236. package/src/og/Popup.js +0 -187
  237. package/src/og/Stack.js +0 -49
  238. package/src/og/bv/index.js +0 -4
  239. package/src/og/camera/index.js +0 -4
  240. package/src/og/control/EarthCoordinates.js +0 -214
  241. package/src/og/control/EarthNavigation.js +0 -258
  242. package/src/og/control/KeyboardNavigation.js +0 -172
  243. package/src/og/control/LayerSwitcher.js +0 -424
  244. package/src/og/control/MouseNavigation.js +0 -436
  245. package/src/og/control/MouseWheelZoomControl.js +0 -253
  246. package/src/og/control/ScaleControl.js +0 -119
  247. package/src/og/control/SegmentBoundVisualization.js +0 -54
  248. package/src/og/control/ShowFps.js +0 -40
  249. package/src/og/control/SimpleNavigation.js +0 -123
  250. package/src/og/control/ToggleWireframe.js +0 -35
  251. package/src/og/control/TouchNavigation.js +0 -350
  252. package/src/og/control/ZoomControl.js +0 -115
  253. package/src/og/control/drawing/DrawingControl.js +0 -51
  254. package/src/og/control/heightRuler/HeightRuler.js +0 -12
  255. package/src/og/control/index.js +0 -56
  256. package/src/og/control/ruler/Ruler.js +0 -39
  257. package/src/og/ellipsoid/index.js +0 -4
  258. package/src/og/entity/BillboardHandler.js +0 -883
  259. package/src/og/entity/Geometry.js +0 -320
  260. package/src/og/entity/PointCloudHandler.js +0 -122
  261. package/src/og/entity/index.js +0 -9
  262. package/src/og/index.js +0 -112
  263. package/src/og/input/KeyboardHandler.js +0 -195
  264. package/src/og/input/TouchHandler.js +0 -59
  265. package/src/og/layer/GeoTexture2d.js +0 -50
  266. package/src/og/layer/index.js +0 -11
  267. package/src/og/math/index.js +0 -23
  268. package/src/og/quadTree/EntityCollectionNode.js +0 -391
  269. package/src/og/quadTree/Wgs84QuadTreeStrategy.js +0 -27
  270. package/src/og/quadTree/index.js +0 -14
  271. package/src/og/res/images.js +0 -8
  272. package/src/og/scene/index.js +0 -5
  273. package/src/og/terrain/EmptyTerrain.js +0 -174
  274. package/src/og/terrain/index.js +0 -6
  275. package/src/og/ui/Button.js +0 -107
  276. package/src/og/ui/ButtonGroup.js +0 -57
  277. package/src/og/ui/Dialog.js +0 -239
  278. package/src/og/ui/Slider.js +0 -170
  279. package/src/og/ui/ToggleButton.js +0 -51
  280. package/src/og/ui/UIhelpers.js +0 -155
  281. package/src/og/utils/BaseWorker.js +0 -46
  282. package/src/og/utils/FontAtlas.js +0 -218
  283. package/src/og/utils/Loader.js +0 -188
  284. package/src/og/utils/TextureAtlas.js +0 -291
  285. package/src/og/utils/functionComposition.js +0 -13
  286. package/src/og/utils/units.js +0 -78
  287. package/src/og/webgl/Framebuffer.js +0 -311
  288. package/src/og/webgl/Handler.js +0 -1170
  289. package/src/og/webgl/Multisample.js +0 -275
  290. package/src/og/webgl/Program.js +0 -407
  291. package/src/og/webgl/callbacks.js +0 -98
  292. package/src/og/webgl/index.js +0 -13
  293. package/src/og.jsdoc +0 -3
  294. package/types/Clock.d.ts +0 -99
  295. package/types/Deferred.d.ts +0 -6
  296. package/types/Events.d.ts +0 -78
  297. package/types/Extent.d.ts +0 -166
  298. package/types/Globe.d.ts +0 -108
  299. package/types/ImageCanvas.d.ts +0 -128
  300. package/types/Lock.d.ts +0 -12
  301. package/types/LonLat.d.ts +0 -127
  302. package/types/Object3d.d.ts +0 -35
  303. package/types/Popup.d.ts +0 -29
  304. package/types/QueueArray.d.ts +0 -19
  305. package/types/Rectangle.d.ts +0 -80
  306. package/types/Stack.d.ts +0 -19
  307. package/types/arial.d.ts +0 -49
  308. package/types/astro/astro.d.ts +0 -38
  309. package/types/astro/earth.d.ts +0 -7
  310. package/types/astro/jd.d.ts +0 -254
  311. package/types/bv/Box.d.ts +0 -30
  312. package/types/bv/Sphere.d.ts +0 -38
  313. package/types/bv/index.d.ts +0 -3
  314. package/types/camera/Camera.d.ts +0 -314
  315. package/types/camera/Frustum.d.ts +0 -133
  316. package/types/camera/PlanetCamera.d.ts +0 -219
  317. package/types/camera/index.d.ts +0 -3
  318. package/types/cons.d.ts +0 -40
  319. package/types/control/Atmosphere.d.ts +0 -15
  320. package/types/control/CompassButton.d.ts +0 -16
  321. package/types/control/Control.d.ts +0 -104
  322. package/types/control/DebugInfo.d.ts +0 -19
  323. package/types/control/DrawingSwitcher.d.ts +0 -13
  324. package/types/control/EarthCoordinates.d.ts +0 -44
  325. package/types/control/EarthNavigation.d.ts +0 -43
  326. package/types/control/GeoImageDragControl.d.ts +0 -14
  327. package/types/control/KeyboardNavigation.d.ts +0 -24
  328. package/types/control/LayerAnimation.d.ts +0 -73
  329. package/types/control/LayerSwitcher.d.ts +0 -64
  330. package/types/control/Lighting.d.ts +0 -41
  331. package/types/control/MouseNavigation.d.ts +0 -49
  332. package/types/control/MouseWheelZoomControl.d.ts +0 -46
  333. package/types/control/ScaleControl.d.ts +0 -23
  334. package/types/control/ShowFps.d.ts +0 -11
  335. package/types/control/SimpleNavigation.d.ts +0 -26
  336. package/types/control/SimpleSkyBackground.d.ts +0 -15
  337. package/types/control/Sun.d.ts +0 -53
  338. package/types/control/ToggleWireframe.d.ts +0 -12
  339. package/types/control/TouchNavigation.d.ts +0 -54
  340. package/types/control/ZoomControl.d.ts +0 -26
  341. package/types/control/drawing/DrawingControl.d.ts +0 -14
  342. package/types/control/drawing/LineStringDrawingScene.d.ts +0 -5
  343. package/types/control/drawing/PolygonDrawingScene.d.ts +0 -99
  344. package/types/control/heightRuler/HeightRuler.d.ts +0 -6
  345. package/types/control/heightRuler/HeightRulerScene.d.ts +0 -23
  346. package/types/control/index.d.ts +0 -27
  347. package/types/control/ruler/Ruler.d.ts +0 -13
  348. package/types/control/ruler/RulerScene.d.ts +0 -51
  349. package/types/control/selection/Selection.d.ts +0 -49
  350. package/types/control/selection/SelectionScene.d.ts +0 -32
  351. package/types/control/timeline/TimelineControl.d.ts +0 -10
  352. package/types/control/timeline/TimelineModel.d.ts +0 -33
  353. package/types/control/timeline/TimelineView.d.ts +0 -57
  354. package/types/control/timeline/timelineUtils.d.ts +0 -9
  355. package/types/ellipsoid/Ellipsoid.d.ts +0 -170
  356. package/types/ellipsoid/index.d.ts +0 -3
  357. package/types/ellipsoid/wgs84.d.ts +0 -6
  358. package/types/entity/BaseBillboard.d.ts +0 -215
  359. package/types/entity/Billboard.d.ts +0 -94
  360. package/types/entity/BillboardHandler.d.ts +0 -75
  361. package/types/entity/Entity.d.ts +0 -340
  362. package/types/entity/EntityCollection.d.ts +0 -303
  363. package/types/entity/GeoObject.d.ts +0 -117
  364. package/types/entity/GeoObjectHandler.d.ts +0 -41
  365. package/types/entity/Geometry.d.ts +0 -79
  366. package/types/entity/GeometryHandler.d.ts +0 -76
  367. package/types/entity/Label.d.ts +0 -190
  368. package/types/entity/LabelHandler.d.ts +0 -31
  369. package/types/entity/LabelWorker.d.ts +0 -9
  370. package/types/entity/PointCloud.d.ts +0 -174
  371. package/types/entity/PointCloudHandler.d.ts +0 -38
  372. package/types/entity/Polyline.d.ts +0 -307
  373. package/types/entity/PolylineHandler.d.ts +0 -18
  374. package/types/entity/Ray.d.ts +0 -122
  375. package/types/entity/RayHandler.d.ts +0 -63
  376. package/types/entity/Strip.d.ts +0 -119
  377. package/types/entity/StripHandler.d.ts +0 -38
  378. package/types/entity/index.d.ts +0 -8
  379. package/types/index.d.ts +0 -53
  380. package/types/input/KeyboardHandler.d.ts +0 -17
  381. package/types/input/MouseHandler.d.ts +0 -5
  382. package/types/input/TouchHandler.d.ts +0 -5
  383. package/types/input/input.d.ts +0 -42
  384. package/types/layer/BaseGeoImage.d.ts +0 -116
  385. package/types/layer/CanvasTiles.d.ts +0 -73
  386. package/types/layer/GeoImage.d.ts +0 -51
  387. package/types/layer/GeoTexture2d.d.ts +0 -7
  388. package/types/layer/GeoVideo.d.ts +0 -47
  389. package/types/layer/KML.d.ts +0 -93
  390. package/types/layer/Layer.d.ts +0 -320
  391. package/types/layer/Material.d.ts +0 -45
  392. package/types/layer/Vector.d.ts +0 -211
  393. package/types/layer/WMS.d.ts +0 -66
  394. package/types/layer/XYZ.d.ts +0 -122
  395. package/types/layer/index.d.ts +0 -10
  396. package/types/light/LightSource.d.ts +0 -178
  397. package/types/math/Line2.d.ts +0 -11
  398. package/types/math/Line3.d.ts +0 -10
  399. package/types/math/Mat3.d.ts +0 -65
  400. package/types/math/Mat4.d.ts +0 -176
  401. package/types/math/Plane.d.ts +0 -18
  402. package/types/math/Quat.d.ts +0 -379
  403. package/types/math/Ray.d.ts +0 -82
  404. package/types/math/Vec2.d.ts +0 -309
  405. package/types/math/Vec3.d.ts +0 -472
  406. package/types/math/Vec4.d.ts +0 -161
  407. package/types/math/coder.d.ts +0 -43
  408. package/types/math/index.d.ts +0 -11
  409. package/types/math.d.ts +0 -268
  410. package/types/mercator.d.ts +0 -92
  411. package/types/proj/EPSG3857.d.ts +0 -6
  412. package/types/proj/EPSG4326.d.ts +0 -6
  413. package/types/proj/Proj.d.ts +0 -42
  414. package/types/quadTree/EPSG4326QuadTreeStrategy.d.ts +0 -3
  415. package/types/quadTree/EarthQuadTreeStrategy.d.ts +0 -3
  416. package/types/quadTree/EntityCollectionNode.d.ts +0 -41
  417. package/types/quadTree/MarsQuadTreeStrategy.d.ts +0 -3
  418. package/types/quadTree/Node.d.ts +0 -58
  419. package/types/quadTree/QuadTreeStrategy.d.ts +0 -21
  420. package/types/quadTree/Wgs84QuadTreeStrategy.d.ts +0 -3
  421. package/types/quadTree/index.d.ts +0 -12
  422. package/types/quadTree/quadTree.d.ts +0 -40
  423. package/types/renderer/Renderer.d.ts +0 -291
  424. package/types/renderer/RendererEvents.d.ts +0 -241
  425. package/types/res/images.d.ts +0 -2
  426. package/types/scene/Axes.d.ts +0 -10
  427. package/types/scene/BaseNode.d.ts +0 -60
  428. package/types/scene/Planet.d.ts +0 -594
  429. package/types/scene/RenderNode.d.ts +0 -152
  430. package/types/scene/SkyBox.d.ts +0 -9
  431. package/types/scene/index.d.ts +0 -4
  432. package/types/segment/Segment.d.ts +0 -273
  433. package/types/segment/SegmentLonLat.d.ts +0 -22
  434. package/types/segment/SegmentLonLatWgs84.d.ts +0 -4
  435. package/types/segment/Slice.d.ts +0 -10
  436. package/types/segment/segmentHelper.d.ts +0 -13
  437. package/types/shaders/atmos.d.ts +0 -4
  438. package/types/shaders/billboard.d.ts +0 -3
  439. package/types/shaders/depth.d.ts +0 -2
  440. package/types/shaders/drawnode.d.ts +0 -8
  441. package/types/shaders/geoObject.d.ts +0 -3
  442. package/types/shaders/label.d.ts +0 -4
  443. package/types/shaders/pickingMask.d.ts +0 -2
  444. package/types/shaders/pointCloud.d.ts +0 -2
  445. package/types/shaders/polyline.d.ts +0 -3
  446. package/types/shaders/ray.d.ts +0 -2
  447. package/types/shaders/screenFrame.d.ts +0 -2
  448. package/types/shaders/skybox.d.ts +0 -2
  449. package/types/shaders/toneMapping.d.ts +0 -2
  450. package/types/shaders/utils.d.ts +0 -1
  451. package/types/terrain/BilTerrain.d.ts +0 -14
  452. package/types/terrain/EmptyTerrain.d.ts +0 -87
  453. package/types/terrain/Geoid.d.ts +0 -17
  454. package/types/terrain/GlobusTerrain.d.ts +0 -122
  455. package/types/terrain/MapboxTerrain.d.ts +0 -14
  456. package/types/terrain/index.d.ts +0 -5
  457. package/types/ui/Button.d.ts +0 -21
  458. package/types/ui/ButtonGroup.d.ts +0 -12
  459. package/types/ui/Dialog.d.ts +0 -41
  460. package/types/ui/Slider.d.ts +0 -33
  461. package/types/ui/ToggleButton.d.ts +0 -10
  462. package/types/ui/UIhelpers.d.ts +0 -13
  463. package/types/ui/View.d.ts +0 -33
  464. package/types/ui/icons.d.ts +0 -1
  465. package/types/utils/BaseWorker.d.ts +0 -14
  466. package/types/utils/FontAtlas.d.ts +0 -16
  467. package/types/utils/GeoImageCreator.d.ts +0 -30
  468. package/types/utils/ImagesCacheManager.d.ts +0 -10
  469. package/types/utils/Loader.d.ts +0 -31
  470. package/types/utils/NormalMapCreator.d.ts +0 -39
  471. package/types/utils/PlainSegmentWorker.d.ts +0 -8
  472. package/types/utils/TerrainWorker.d.ts +0 -7
  473. package/types/utils/TextureAtlas.d.ts +0 -113
  474. package/types/utils/VectorTileCreator.d.ts +0 -14
  475. package/types/utils/colorTable.d.ts +0 -143
  476. package/types/utils/earcut.d.ts +0 -6
  477. package/types/utils/functionComposition.d.ts +0 -5
  478. package/types/utils/objParser.d.ts +0 -8
  479. package/types/utils/shared.d.ts +0 -241
  480. package/types/utils/units.d.ts +0 -20
  481. package/types/webgl/Framebuffer.d.ts +0 -134
  482. package/types/webgl/Handler.d.ts +0 -403
  483. package/types/webgl/Multisample.d.ts +0 -91
  484. package/types/webgl/Program.d.ts +0 -163
  485. package/types/webgl/ProgramController.d.ts +0 -89
  486. package/types/webgl/callbacks.d.ts +0 -1
  487. package/types/webgl/index.d.ts +0 -6
  488. package/types/webgl/types.d.ts +0 -2
  489. /package/{src/og → dist/@openglobus/res/fonts}/arial.js +0 -0
  490. /package/src/{og/ui/icons.js → ui/icons.ts} +0 -0
@@ -1,18 +1,38 @@
1
- "use strict";
2
-
3
- import { Extent } from "../Extent.js";
4
- import { LonLat } from "../LonLat.js";
5
- import { Vec3 } from "../math/Vec3.js";
6
- import * as mercator from "../mercator.js";
7
- import * as utils from "../utils/shared.js";
8
- import { Billboard } from "./Billboard.js";
9
- import { Geometry } from "./Geometry.js";
10
- import { GeoObject } from "./GeoObject.js";
11
- import { Label } from "./Label.js";
12
- import { PointCloud } from "./PointCloud.js";
13
- import { Polyline } from "./Polyline.js";
14
- import { Ray } from "./Ray.js";
15
- import { Strip } from "./Strip.js";
1
+ import * as mercator from "../mercator";
2
+ import * as utils from "../utils/shared";
3
+ import {Billboard, IBillboardParams} from "./Billboard";
4
+ import {EntityCollection, EntityCollectionEvents} from "./EntityCollection";
5
+ import {Extent} from "../Extent";
6
+ import {Geometry, IGeometryParams} from "./Geometry";
7
+ import {GeoObject, IGeoObjectParams} from "./GeoObject";
8
+ import {LonLat} from "../LonLat";
9
+ import {Label, ILabelParams} from "./Label";
10
+ import {NumberArray3, Vec3} from "../math/Vec3";
11
+ import {NumberArray2} from "../math/Vec2";
12
+ import {Planet} from "../scene/Planet";
13
+ import {IPointCloudParams, PointCloud} from "./PointCloud";
14
+ import {IPolylineParams, Polyline} from "./Polyline";
15
+ import {IRayParams, Ray} from "./Ray";
16
+ import {Strip, IStripParams} from "./Strip";
17
+ import {Vector, VectorEventsType} from "../layer/Vector";
18
+ import {EntityCollectionNode} from "../quadTree/EntityCollectionNode";
19
+
20
+ export interface IEntityParams {
21
+ name?: string;
22
+ properties?: any;
23
+ cartesian?: Vec3 | NumberArray3;
24
+ lonlat?: LonLat | NumberArray3 | NumberArray2;
25
+ altitude?: number;
26
+ visibility?: boolean;
27
+ billboard?: Billboard | IBillboardParams;
28
+ label?: Label | ILabelParams;
29
+ polyline?: Polyline | IPolylineParams;
30
+ ray?: Ray | IRayParams;
31
+ pointCloud?: PointCloud | IPointCloudParams;
32
+ geometry?: Geometry | IGeometryParams;
33
+ geoObject?: GeoObject | IGeoObjectParams;
34
+ strip?: Strip;
35
+ }
16
36
 
17
37
  /**
18
38
  * Entity instances aggregate multiple forms of visualization into a single high-level object.
@@ -20,128 +40,214 @@ import { Strip } from "./Strip.js";
20
40
  *
21
41
  * @class
22
42
  * @param {Object} [options] - Entity options:
23
- * @param {string} [options.name] - A human readable name to display to users. It does not have to be unique.
43
+ * @param {string} [options.name] - A human-readable name to display to users. It does not have to be unique.
24
44
  * @param {Vec3|Array.<number>} [options.cartesian] - Spatial entities like billboard, label etc. cartesian position.
25
45
  * @param {LonLat} [options.lonlat] - Geodetic coordinates for an entities like billboard, label etc.
26
46
  * @param {boolean} [options.aground] - True for entities that have to be placed on the relief.
27
47
  * @param {boolean} [options.visibility] - Entity visibility.
28
- * @param {*} [options.billboard] - Billboard options(see {@link og.Billboard}).
29
- * @param {*} [options.label] - Label options(see {@link og.Label}).
30
- * @param {*} [options.polyline] - Polyline options(see {@link og.Polyline}).
31
- * @param {*} [options.ray] - Ray options(see {@link og.Ray}).
32
- * @param {*} [options.pointCloud] - Point cloud options(see {@link og.PointCloud}).
33
- * @param {*} [options.geometry] - Geometry options (see {@link og.Geometry}), available for vector layer only.
48
+ * @param {*} [options.billboard] - Billboard options(see {@link Billboard}).
49
+ * @param {*} [options.label] - Label options(see {@link Label}).
50
+ * @param {*} [options.polyline] - Polyline options(see {@link Polyline}).
51
+ * @param {*} [options.ray] - Ray options(see {@link Ray}).
52
+ * @param {*} [options.pointCloud] - Point cloud options(see {@link PointCloud}).
53
+ * @param {*} [options.geometry] - Geometry options (see {@link Geometry}), available for vector layer only.
34
54
  * @param {*} [options.properties] - Entity custom properties.
35
55
  */
36
56
  class Entity {
37
- constructor(options) {
38
- options = options || {};
57
+
58
+ static __counter__: number = 0;
59
+
60
+ /**
61
+ * Uniq identifier.
62
+ * @public
63
+ * @readonly
64
+ */
65
+ protected __id: number;
66
+
67
+ /**
68
+ * Entity user defined properties.
69
+ * @public
70
+ * @type {Object}
71
+ */
72
+ public properties: any;
73
+
74
+
75
+ /**
76
+ * Children entities.
77
+ * @public
78
+ * @type {Array.<Entity>}
79
+ */
80
+ public childrenNodes: Entity[];
81
+
82
+ /**
83
+ * Parent entity.
84
+ * @public
85
+ * @type {Entity}
86
+ */
87
+ public parent: Entity | null;
88
+
89
+ /**
90
+ * Entity cartesian position.
91
+ * @protected
92
+ * @type {Vec3}
93
+ */
94
+ public _cartesian: Vec3;
95
+
96
+ /**
97
+ * Geodetic entity coordinates.
98
+ * @public
99
+ * @type {LonLat}
100
+ */
101
+ public _lonLat: LonLat;
102
+
103
+ /**
104
+ * World Mercator entity coordinates.
105
+ * @public
106
+ * @type {LonLat}
107
+ */
108
+ public _lonLatMerc: LonLat;
109
+
110
+ /**
111
+ * Entity visible terrain altitude.
112
+ * @public
113
+ * @type {number}
114
+ */
115
+ public _altitude: number;
116
+
117
+ /**
118
+ * Visibility flag.
119
+ * @protected
120
+ * @type {boolean}
121
+ */
122
+ protected _visibility: boolean;
123
+
124
+ /**
125
+ * Entity collection that this entity belongs to.
126
+ * @public
127
+ * @type {EntityCollection}
128
+ */
129
+ public _entityCollection: EntityCollection | null;
130
+
131
+ /**
132
+ * Entity collection array store index.
133
+ * @public
134
+ * @type {number}
135
+ */
136
+ public _entityCollectionIndex: number;
137
+
138
+ /**
139
+ * Assigned vector layer pointer.
140
+ * @public
141
+ * @type {Vector}
142
+ */
143
+ public _layer: Vector | null;
144
+
145
+ /**
146
+ * Assigned vector layer entity array index.
147
+ * @public
148
+ * @type {number}
149
+ */
150
+ public _layerIndex: number;
151
+
152
+ /**
153
+ * Picking color.
154
+ * @public
155
+ * @type {Vec3}
156
+ */
157
+ public _pickingColor: Vec3;
158
+
159
+ protected _featureConstructorArray: Record<string, [any, Function]>;
160
+
161
+ /**
162
+ * Billboard entity.
163
+ * @public
164
+ * @type {Billboard | null}
165
+ */
166
+ public billboard: Billboard | null;
167
+
168
+ /**
169
+ * Text label entity.
170
+ * @public
171
+ * @type {Label | null}
172
+ */
173
+ public label: Label | null;
174
+
175
+ /**
176
+ * Polyline entity.
177
+ * @public
178
+ * @type {Polyline | null}
179
+ */
180
+ public polyline: Polyline | null;
181
+
182
+ /**
183
+ * Ray entity.
184
+ * @public
185
+ * @type {Ray | null}
186
+ */
187
+ public ray: Ray | null;
188
+
189
+ /**
190
+ * PointCloud entity.
191
+ * @public
192
+ * @type {PointCloud | null}
193
+ */
194
+ public pointCloud: PointCloud | null;
195
+
196
+ /**
197
+ * Geometry entity(available for vector layer only).
198
+ * @public
199
+ * @type {Geometry | null}
200
+ */
201
+ public geometry: Geometry | null;
202
+
203
+ /**
204
+ * Geo object entity
205
+ * @public
206
+ * @type {Geometry | null}
207
+ */
208
+ public geoObject: GeoObject | null;
209
+
210
+ /**
211
+ * Strip entity.
212
+ * @public
213
+ * @type {Strip | null}
214
+ */
215
+ public strip: Strip | null;
216
+
217
+ public _nodePtr?: EntityCollectionNode;
218
+
219
+ constructor(options: IEntityParams = {}) {
39
220
 
40
221
  options.properties = options.properties || {};
41
222
 
42
- /**
43
- * Unic identifier.
44
- * @public
45
- * @readonly
46
- */
47
- this.id = Entity._staticCounter++;
48
-
49
- /**
50
- * Entity user defined properties.
51
- * @public
52
- * @type {Object}
53
- */
223
+ this.__id = Entity.__counter__++;
224
+
54
225
  this.properties = options.properties || {};
55
226
 
56
- /**
57
- * Entity name.
58
- * @public
59
- * @type {string}
60
- */
61
227
  this.properties.name = this.properties.name != undefined ? this.properties.name : "";
62
228
 
63
- /**
64
- * Children entities.
65
- * @public
66
- * @type {Array.<Entity>}
67
- */
68
229
  this.childrenNodes = [];
69
230
 
70
- /**
71
- * Parent entity.
72
- * @public
73
- * @type {Entity}
74
- */
75
231
  this.parent = null;
76
232
 
77
- /**
78
- * Entity cartesian position.
79
- * @protected
80
- * @type {Vec3}
81
- */
82
233
  this._cartesian = utils.createVector3(options.cartesian);
83
234
 
84
- /**
85
- * Geodetic entity coordinates.
86
- * @protected
87
- * @type {LonLat}
88
- */
89
235
  this._lonLat = utils.createLonLat(options.lonlat);
90
236
 
91
- /**
92
- * World Mercator entity coordinates.
93
- * @protected
94
- * @type {LonLat}
95
- */
96
- this._lonLatMerc = null;
97
-
98
- /**
99
- * Entity visible terrain altitude.
100
- * @protected
101
- * @type {number}
102
- */
237
+ this._lonLatMerc = new LonLat();
238
+
103
239
  this._altitude = options.altitude || 0.0;
104
240
 
105
- /**
106
- * Visibility flag.
107
- * @protected
108
- * @type {boolean}
109
- */
110
241
  this._visibility = options.visibility != undefined ? options.visibility : true;
111
242
 
112
- /**
113
- * Entity collection that this entity belongs to.
114
- * @protected
115
- * @type {EntityCollection}
116
- */
117
243
  this._entityCollection = null;
118
244
 
119
- /**
120
- * Entity collection array store index.
121
- * @protected
122
- * @type {number}
123
- */
124
245
  this._entityCollectionIndex = -1;
125
246
 
126
- /**
127
- * Assigned vector layer pointer.
128
- * @protected
129
- * @type {layer.Vector}
130
- */
131
247
  this._layer = null;
132
248
 
133
- /**
134
- * Assigned vector layer entity array index.
135
- * @protected
136
- * @type {number}
137
- */
138
249
  this._layerIndex = -1;
139
250
 
140
- /**
141
- * Picking color.
142
- * @protected
143
- * @type {Vec3}
144
- */
145
251
  this._pickingColor = new Vec3(0, 0, 0);
146
252
 
147
253
  this._featureConstructorArray = {
@@ -155,102 +261,62 @@ class Entity {
155
261
  ray: [Ray, this.setRay]
156
262
  };
157
263
 
158
- /**
159
- * Billboard entity.
160
- * @public
161
- * @type {Billboard}
162
- */
163
- this.billboard = this._createOptionFeature("billboard", options.billboard);
164
-
165
- /**
166
- * Text label entity.
167
- * @public
168
- * @type {Label}
169
- */
170
- this.label = this._createOptionFeature("label", options.label);
171
-
172
- /**
173
- * Polyline entity.
174
- * @public
175
- * @type {Polyline}
176
- */
177
- this.polyline = this._createOptionFeature("polyline", options.polyline);
178
-
179
- /**
180
- * Ray entity.
181
- * @public
182
- * @type {ray}
183
- */
184
- this.ray = this._createOptionFeature("ray", options.ray);
185
-
186
- /**
187
- * PointCloud entity.
188
- * @public
189
- * @type {PointCloud}
190
- */
191
- this.pointCloud = this._createOptionFeature("pointCloud", options.pointCloud);
192
-
193
- /**
194
- * Geometry entity(available for vector layer only).
195
- * @public
196
- * @type {Geometry}
197
- */
198
- this.geometry = this._createOptionFeature("geometry", options.geometry);
199
-
200
- /**
201
- * Geo object entity
202
- * @public
203
- * @type {og.Geometry}
204
- */
205
- this.geoObject = this._createOptionFeature("geoObject", options.geoObject);
206
-
207
- /**
208
- * Strip entity.
209
- * @public
210
- * @type {Strip}
211
- */
212
- this.strip = this._createOptionFeature("strip", options.strip);
213
- }
214
-
215
- static get _staticCounter() {
216
- if (!this._counter && this._counter !== 0) {
217
- this._counter = 0;
218
- }
219
- return this._counter;
264
+ this.billboard = this._createOptionFeature<Billboard, IBillboardParams>("billboard", options.billboard);
265
+
266
+ this.label = this._createOptionFeature<Label, ILabelParams>("label", options.label);
267
+
268
+ this.polyline = this._createOptionFeature<Polyline, IPolylineParams>("polyline", options.polyline);
269
+
270
+ this.ray = this._createOptionFeature<Ray, IRayParams>("ray", options.ray);
271
+
272
+ this.pointCloud = this._createOptionFeature<PointCloud, IPolylineParams>("pointCloud", options.pointCloud);
273
+
274
+ this.geometry = this._createOptionFeature<Geometry, IGeometryParams>("geometry", options.geometry);
275
+
276
+ this.geoObject = this._createOptionFeature<GeoObject, IGeoObjectParams>("geoObject", options.geoObject);
277
+
278
+ this.strip = this._createOptionFeature<Strip, IStripParams>("strip", options.strip);
279
+ }
280
+
281
+ public get id(): number {
282
+ return this.__id;
220
283
  }
221
284
 
222
- static set _staticCounter(n) {
223
- this._counter = n;
285
+ public isEqual(entity: Entity): boolean {
286
+ return this.__id === entity.__id;
224
287
  }
225
288
 
226
- get layerIndex() {
289
+ public get layerIndex(): number {
227
290
  return this._layerIndex;
228
291
  }
229
292
 
230
- get instanceName() {
293
+ public get instanceName(): string {
231
294
  return "Entity";
232
295
  }
233
296
 
234
- _createOptionFeature(featureName, options) {
297
+ protected _createOptionFeature<T, K>(
298
+ featureName: string,
299
+ options?: T | K
300
+ ): T | null {
235
301
  if (options) {
236
302
  let c = this._featureConstructorArray[featureName];
237
- return c[1].call(this, new c[0](options));
303
+ return c[1].call(this, new c[0](options)) as T;
238
304
  }
239
305
  return null;
240
306
  }
241
307
 
242
- getCollectionIndex() {
308
+ public getCollectionIndex(): number {
243
309
  return this._entityCollectionIndex;
244
310
  }
245
311
 
246
312
  /**
247
313
  * Adds current entity into the specified entity collection.
248
314
  * @public
249
- * @param {EntityCollection|Vector} collection - Specified entity collection or vector layer.
315
+ * @param {EntityCollection | Vector} collection - Specified entity collection or vector layer.
250
316
  * @param {Boolean} [rightNow=false] - Entity insertion option for vector layer.
251
317
  * @returns {Entity} - This object.
252
318
  */
253
- addTo(collection, rightNow = false) {
319
+ public addTo(collection: EntityCollection | Vector, rightNow: boolean = false) {
254
320
  collection.add(this, rightNow);
255
321
  return this;
256
322
  }
@@ -259,7 +325,7 @@ class Entity {
259
325
  * Removes current entity from collection and layer.
260
326
  * @public
261
327
  */
262
- remove() {
328
+ public remove() {
263
329
  this._layer && this._layer.removeEntity(this);
264
330
  this._entityCollection && this._entityCollection.removeEntity(this);
265
331
  }
@@ -269,7 +335,7 @@ class Entity {
269
335
  * @public
270
336
  * @param {boolean} visibility - Entity visibility.
271
337
  */
272
- setVisibility(visibility) {
338
+ public setVisibility(visibility: boolean) {
273
339
  this._visibility = visibility;
274
340
 
275
341
  // billboards
@@ -300,7 +366,7 @@ class Entity {
300
366
  * @public
301
367
  * @returns {boolean} -
302
368
  */
303
- getVisibility() {
369
+ public getVisibility() {
304
370
  return this._visibility;
305
371
  }
306
372
 
@@ -309,7 +375,7 @@ class Entity {
309
375
  * @public
310
376
  * @param {Vec3} cartesian - Cartesian position in 3d space.
311
377
  */
312
- setCartesian3v(cartesian) {
378
+ public setCartesian3v(cartesian: Vec3) {
313
379
  this.setCartesian(cartesian.x, cartesian.y, cartesian.z);
314
380
  }
315
381
 
@@ -320,7 +386,7 @@ class Entity {
320
386
  * @param {number} y - 3d space Y - position.
321
387
  * @param {number} z - 3d space Z - position.
322
388
  */
323
- setCartesian(x, y, z) {
389
+ public setCartesian(x?: number, y?: number, z?: number) {
324
390
  let p = this._cartesian;
325
391
 
326
392
  p.x = x || 0.0;
@@ -342,13 +408,13 @@ class Entity {
342
408
 
343
409
  let ec = this._entityCollection;
344
410
 
345
- if (ec && ec.renderNode && ec.renderNode.ellipsoid) {
346
- this._lonLat = ec.renderNode.ellipsoid.cartesianToLonLat(p);
411
+ if (ec && ec.renderNode && (ec.renderNode as Planet).ellipsoid) {
412
+ this._lonLat = (ec.renderNode as Planet).ellipsoid.cartesianToLonLat(p);
347
413
 
348
414
  if (Math.abs(this._lonLat.lat) < mercator.MAX_LAT) {
349
415
  this._lonLatMerc = this._lonLat.forwardMercator();
350
416
  } else {
351
- this._lonLatMerc = null;
417
+ this._lonLatMerc.lon = this._lonLatMerc.lat = this._lonLatMerc.height = 0;
352
418
  }
353
419
  }
354
420
 
@@ -357,11 +423,11 @@ class Entity {
357
423
 
358
424
  /**
359
425
  * Sets entity cartesian position without event dispatching.
360
- * @protected
426
+ * @public
361
427
  * @param {Vec3} cartesian - Cartesian position in 3d space.
362
428
  * @param {boolean} skipLonLat - skip geodetic calculation.
363
429
  */
364
- _setCartesian3vSilent(cartesian, skipLonLat) {
430
+ public _setCartesian3vSilent(cartesian: Vec3, skipLonLat: boolean = false) {
365
431
  let p = this._cartesian;
366
432
 
367
433
  p.x = cartesian.x || 0.0;
@@ -383,13 +449,13 @@ class Entity {
383
449
 
384
450
  let ec = this._entityCollection;
385
451
 
386
- if (!skipLonLat && ec && ec.renderNode && ec.renderNode.ellipsoid) {
387
- this._lonLat = ec.renderNode.ellipsoid.cartesianToLonLat(p);
452
+ if (!skipLonLat && ec && ec.renderNode && (ec.renderNode as Planet).ellipsoid) {
453
+ this._lonLat = (ec.renderNode as Planet).ellipsoid.cartesianToLonLat(p);
388
454
 
389
455
  if (Math.abs(this._lonLat.lat) < mercator.MAX_LAT) {
390
456
  this._lonLatMerc = this._lonLat.forwardMercator();
391
457
  } else {
392
- this._lonLatMerc = null;
458
+ //this._lonLatMerc = null;
393
459
  }
394
460
  }
395
461
  }
@@ -399,7 +465,7 @@ class Entity {
399
465
  * @public
400
466
  * @returns {LonLat} -
401
467
  */
402
- getLonLat() {
468
+ public getLonLat(): LonLat {
403
469
  return this._lonLat.clone();
404
470
  }
405
471
 
@@ -408,7 +474,7 @@ class Entity {
408
474
  * @public
409
475
  * @param {LonLat} lonlat - WGS84 coordinates.
410
476
  */
411
- setLonLat(lonlat) {
477
+ public setLonLat(lonlat: LonLat) {
412
478
  let l = this._lonLat;
413
479
 
414
480
  l.lon = lonlat.lon;
@@ -416,14 +482,14 @@ class Entity {
416
482
  l.height = lonlat.height;
417
483
 
418
484
  let ec = this._entityCollection;
419
- if (ec && ec.renderNode && ec.renderNode.ellipsoid) {
485
+ if (ec && ec.renderNode && (ec.renderNode as Planet).ellipsoid) {
420
486
  if (Math.abs(l.lat) < mercator.MAX_LAT) {
421
487
  this._lonLatMerc = l.forwardMercator();
422
488
  } else {
423
- this._lonLatMerc = null;
489
+ //this._lonLatMerc = null;
424
490
  }
425
491
 
426
- ec.renderNode.ellipsoid.lonLatToCartesianRes(l, this._cartesian);
492
+ (ec.renderNode as Planet).ellipsoid.lonLatToCartesianRes(l, this._cartesian);
427
493
  this.setCartesian3v(this._cartesian);
428
494
  }
429
495
  }
@@ -435,7 +501,7 @@ class Entity {
435
501
  * @param {number} lat - Latitude
436
502
  * @param {number} [height] - Height
437
503
  */
438
- setLonLat2(lon, lat, height) {
504
+ public setLonLat2(lon: number, lat: number, height?: number) {
439
505
  let l = this._lonLat;
440
506
 
441
507
  l.lon = lon;
@@ -443,14 +509,14 @@ class Entity {
443
509
  l.height = height != undefined ? height : l.height;
444
510
 
445
511
  let ec = this._entityCollection;
446
- if (ec && ec.renderNode && ec.renderNode.ellipsoid) {
512
+ if (ec && ec.renderNode && (ec.renderNode as Planet).ellipsoid) {
447
513
  if (Math.abs(l.lat) < mercator.MAX_LAT) {
448
514
  this._lonLatMerc = l.forwardMercator();
449
515
  } else {
450
- this._lonLatMerc = null;
516
+ this._lonLatMerc.lon = this._lonLatMerc.lat = this._lonLatMerc.height = 0;
451
517
  }
452
518
 
453
- ec.renderNode.ellipsoid.lonLatToCartesianRes(l, this._cartesian);
519
+ (ec.renderNode as Planet).ellipsoid.lonLatToCartesianRes(l, this._cartesian);
454
520
  this.setCartesian3v(this._cartesian);
455
521
  }
456
522
  }
@@ -460,7 +526,7 @@ class Entity {
460
526
  * @public
461
527
  * @param {number} altitude - Altitude.
462
528
  */
463
- setAltitude(altitude) {
529
+ public setAltitude(altitude: number) {
464
530
  this._altitude = altitude;
465
531
  }
466
532
 
@@ -469,7 +535,7 @@ class Entity {
469
535
  * @public
470
536
  * @return {number} Altitude.
471
537
  */
472
- getAltitude() {
538
+ public getAltitude(): number {
473
539
  return this._altitude;
474
540
  }
475
541
 
@@ -478,7 +544,7 @@ class Entity {
478
544
  * @public
479
545
  * @returns {Vec3} -
480
546
  */
481
- getCartesian() {
547
+ public getCartesian(): Vec3 {
482
548
  return this._cartesian.clone();
483
549
  }
484
550
 
@@ -488,7 +554,7 @@ class Entity {
488
554
  * @param {Billboard} billboard - Billboard object.
489
555
  * @returns {Billboard} -
490
556
  */
491
- setBillboard(billboard) {
557
+ public setBillboard(billboard: Billboard): Billboard {
492
558
  if (this.billboard) {
493
559
  this.billboard.remove();
494
560
  }
@@ -496,7 +562,7 @@ class Entity {
496
562
  this.billboard._entity = this;
497
563
  this.billboard.setPosition3v(this._cartesian);
498
564
  this.billboard.setVisibility(this._visibility);
499
- this._entityCollection && this._entityCollection._billboardHandler.add(billboard);
565
+ this._entityCollection && this._entityCollection.billboardHandler.add(billboard);
500
566
  return billboard;
501
567
  }
502
568
 
@@ -506,7 +572,7 @@ class Entity {
506
572
  * @param {Label} label - Text label.
507
573
  * @returns {Label} -
508
574
  */
509
- setLabel(label) {
575
+ public setLabel(label: Label): Label {
510
576
  if (this.label) {
511
577
  this.label.remove();
512
578
  }
@@ -514,7 +580,7 @@ class Entity {
514
580
  this.label._entity = this;
515
581
  this.label.setPosition3v(this._cartesian);
516
582
  this.label.setVisibility(this._visibility);
517
- this._entityCollection && this._entityCollection._labelHandler.add(label);
583
+ this._entityCollection && this._entityCollection.labelHandler.add(label);
518
584
  return label;
519
585
  }
520
586
 
@@ -524,7 +590,7 @@ class Entity {
524
590
  * @param {Ray} ray - Ray object.
525
591
  * @returns {Ray} -
526
592
  */
527
- setRay(ray) {
593
+ public setRay(ray: Ray): Ray {
528
594
  if (this.ray) {
529
595
  this.ray.remove();
530
596
  }
@@ -541,7 +607,7 @@ class Entity {
541
607
  * @param {Polyline} polyline - Polyline object.
542
608
  * @returns {Polyline} -
543
609
  */
544
- setPolyline(polyline) {
610
+ public setPolyline(polyline: Polyline): Polyline {
545
611
  if (this.polyline) {
546
612
  this.polyline.remove();
547
613
  }
@@ -558,7 +624,7 @@ class Entity {
558
624
  * @param {PointCloud} pointCloud - PointCloud object.
559
625
  * @returns {PointCloud} -
560
626
  */
561
- setPointCloud(pointCloud) {
627
+ public setPointCloud(pointCloud: PointCloud): PointCloud {
562
628
  if (this.pointCloud) {
563
629
  this.pointCloud.remove();
564
630
  }
@@ -575,7 +641,7 @@ class Entity {
575
641
  * @param {Geometry} geometry - Geometry object.
576
642
  * @returns {Geometry} -
577
643
  */
578
- setGeometry(geometry) {
644
+ public setGeometry(geometry: Geometry): Geometry {
579
645
  if (this.geometry) {
580
646
  this.geometry.remove();
581
647
  }
@@ -592,7 +658,7 @@ class Entity {
592
658
  * @param {GeoObject} geoObject - GeoObject.
593
659
  * @returns {GeoObject} -
594
660
  */
595
- setGeoObject(geoObject) {
661
+ public setGeoObject(geoObject: GeoObject): GeoObject {
596
662
  if (this.geoObject) {
597
663
  this.geoObject.remove();
598
664
  }
@@ -610,7 +676,7 @@ class Entity {
610
676
  * @param {Strip} strip - Strip object.
611
677
  * @returns {Strip} -
612
678
  */
613
- setStrip(strip) {
679
+ public setStrip(strip: Strip): Strip {
614
680
  if (this.strip) {
615
681
  this.strip.remove();
616
682
  }
@@ -621,11 +687,11 @@ class Entity {
621
687
  return strip;
622
688
  }
623
689
 
624
- get layer() {
690
+ public get layer(): Vector | null {
625
691
  return this._layer;
626
692
  }
627
693
 
628
- get rendererEvents() {
694
+ public get rendererEvents(): VectorEventsType | EntityCollectionEvents | null {
629
695
  if (this._layer) {
630
696
  return this._layer.events;
631
697
  } else if (this._entityCollection) {
@@ -639,7 +705,7 @@ class Entity {
639
705
  * @public
640
706
  * @param {Entity} entity - Child entity.
641
707
  */
642
- appendChild(entity) {
708
+ public appendChild(entity: Entity) {
643
709
  entity._entityCollection = this._entityCollection;
644
710
  entity._pickingColor = this._pickingColor;
645
711
  entity.parent = this;
@@ -651,25 +717,19 @@ class Entity {
651
717
  * Appends entity items(billboard, label etc.) picking color.
652
718
  * @public
653
719
  */
654
- setPickingColor() {
720
+ public setPickingColor() {
655
721
  let c = this._pickingColor;
656
722
 
657
- // billboard
658
723
  this.billboard && this.billboard.setPickingColor3v(c);
659
724
 
660
- // label
661
725
  this.label && this.label.setPickingColor3v(c);
662
726
 
663
- // polyline
664
727
  this.polyline && this.polyline.setPickingColor3v(c);
665
728
 
666
- // ray
667
729
  this.ray && this.ray.setPickingColor3v(c);
668
730
 
669
- // strip
670
731
  this.strip && this.strip.setPickingColor3v(c);
671
732
 
672
- // geoObject
673
733
  this.geoObject && this.geoObject.setPickingColor3v(c);
674
734
 
675
735
  for (let i = 0; i < this.childrenNodes.length; i++) {
@@ -678,12 +738,15 @@ class Entity {
678
738
  }
679
739
 
680
740
  /**
681
- * Return geodethic extent.
741
+ * Return geodetic extent.
742
+ * @public
682
743
  * @returns {Extent} -
683
744
  */
684
- getExtent() {
745
+ public getExtent(): Extent {
746
+
685
747
  let res;
686
748
  let c = this._lonLat;
749
+
687
750
  if (this.billboard || this.label) {
688
751
  res = new Extent(new LonLat(c.lon, c.lat), new LonLat(c.lon, c.lat));
689
752
  } else {
@@ -719,10 +782,6 @@ class Entity {
719
782
 
720
783
  return res;
721
784
  }
722
-
723
- isEqual(entity) {
724
- return this.id === entity.id;
725
- }
726
785
  }
727
786
 
728
- export { Entity };
787
+ export {Entity};