ol 7.3.0 → 7.3.1-dev

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 (535) hide show
  1. package/Collection.d.ts +2 -2
  2. package/Collection.d.ts.map +1 -1
  3. package/DataTile.d.ts +1 -1
  4. package/DataTile.d.ts.map +1 -1
  5. package/DataTile.js +2 -1
  6. package/Feature.d.ts +1 -1
  7. package/Feature.d.ts.map +1 -1
  8. package/Geolocation.d.ts +2 -2
  9. package/Geolocation.d.ts.map +1 -1
  10. package/Image.d.ts +1 -1
  11. package/Image.d.ts.map +1 -1
  12. package/ImageBase.d.ts +1 -1
  13. package/ImageBase.d.ts.map +1 -1
  14. package/ImageCanvas.d.ts +1 -1
  15. package/ImageCanvas.d.ts.map +1 -1
  16. package/ImageTile.d.ts +1 -1
  17. package/ImageTile.d.ts.map +1 -1
  18. package/Map.d.ts +7 -7
  19. package/Map.d.ts.map +1 -1
  20. package/Map.js +2 -1
  21. package/MapBrowserEvent.d.ts +1 -1
  22. package/MapBrowserEvent.d.ts.map +1 -1
  23. package/MapBrowserEventHandler.d.ts +1 -1
  24. package/MapBrowserEventHandler.d.ts.map +1 -1
  25. package/MapEvent.d.ts +1 -1
  26. package/MapEvent.d.ts.map +1 -1
  27. package/Object.d.ts +2 -2
  28. package/Object.d.ts.map +1 -1
  29. package/Observable.d.ts +1 -1
  30. package/Observable.d.ts.map +1 -1
  31. package/Overlay.d.ts +1 -1
  32. package/Overlay.d.ts.map +1 -1
  33. package/Tile.d.ts +1 -1
  34. package/Tile.d.ts.map +1 -1
  35. package/TileCache.d.ts +1 -1
  36. package/TileCache.d.ts.map +1 -1
  37. package/TileQueue.d.ts +1 -1
  38. package/TileQueue.d.ts.map +1 -1
  39. package/VectorRenderTile.d.ts +1 -1
  40. package/VectorRenderTile.d.ts.map +1 -1
  41. package/VectorTile.d.ts +1 -1
  42. package/VectorTile.d.ts.map +1 -1
  43. package/View.d.ts +10 -6
  44. package/View.d.ts.map +1 -1
  45. package/View.js +9 -6
  46. package/array.d.ts.map +1 -1
  47. package/array.js +38 -20
  48. package/control/Attribution.d.ts +1 -1
  49. package/control/Attribution.d.ts.map +1 -1
  50. package/control/Control.d.ts +1 -1
  51. package/control/Control.d.ts.map +1 -1
  52. package/control/FullScreen.d.ts +1 -1
  53. package/control/FullScreen.d.ts.map +1 -1
  54. package/control/MousePosition.d.ts +1 -1
  55. package/control/MousePosition.d.ts.map +1 -1
  56. package/control/OverviewMap.d.ts +3 -3
  57. package/control/OverviewMap.d.ts.map +1 -1
  58. package/control/Rotate.d.ts +1 -1
  59. package/control/Rotate.d.ts.map +1 -1
  60. package/control/ScaleLine.d.ts +1 -1
  61. package/control/ScaleLine.d.ts.map +1 -1
  62. package/control/Zoom.d.ts +1 -1
  63. package/control/Zoom.d.ts.map +1 -1
  64. package/control/ZoomSlider.d.ts +1 -1
  65. package/control/ZoomSlider.d.ts.map +1 -1
  66. package/control/ZoomToExtent.d.ts +1 -1
  67. package/control/ZoomToExtent.d.ts.map +1 -1
  68. package/control/defaults.d.ts +1 -1
  69. package/control/defaults.d.ts.map +1 -1
  70. package/dist/ol.js +2 -2
  71. package/dist/ol.js.map +1 -1
  72. package/events/Key.d.ts +8 -0
  73. package/events/Key.d.ts.map +1 -0
  74. package/events/Key.js +14 -0
  75. package/events/Target.d.ts +1 -1
  76. package/events/Target.d.ts.map +1 -1
  77. package/events/condition.d.ts +2 -2
  78. package/events/condition.d.ts.map +1 -1
  79. package/extent.d.ts.map +1 -1
  80. package/extent.js +7 -2
  81. package/format/EsriJSON.d.ts +1 -1
  82. package/format/EsriJSON.d.ts.map +1 -1
  83. package/format/GML.d.ts +1 -1
  84. package/format/GML.d.ts.map +1 -1
  85. package/format/GML2.d.ts +1 -1
  86. package/format/GML2.d.ts.map +1 -1
  87. package/format/GML3.d.ts +5 -5
  88. package/format/GML3.d.ts.map +1 -1
  89. package/format/GML32.d.ts +1 -1
  90. package/format/GML32.d.ts.map +1 -1
  91. package/format/GMLBase.d.ts +9 -9
  92. package/format/GMLBase.d.ts.map +1 -1
  93. package/format/GPX.d.ts +2 -2
  94. package/format/GPX.d.ts.map +1 -1
  95. package/format/GeoJSON.d.ts +1 -1
  96. package/format/GeoJSON.d.ts.map +1 -1
  97. package/format/IGC.d.ts +1 -1
  98. package/format/IGC.d.ts.map +1 -1
  99. package/format/IIIFInfo.d.ts +8 -8
  100. package/format/IIIFInfo.d.ts.map +1 -1
  101. package/format/IIIFInfo.js +10 -9
  102. package/format/JSONFeature.d.ts +1 -1
  103. package/format/JSONFeature.d.ts.map +1 -1
  104. package/format/JSONFeature.js +2 -1
  105. package/format/KML.d.ts +121 -5
  106. package/format/KML.d.ts.map +1 -1
  107. package/format/KML.js +105 -7
  108. package/format/MVT.d.ts +2 -2
  109. package/format/MVT.d.ts.map +1 -1
  110. package/format/OSMXML.d.ts +1 -1
  111. package/format/OSMXML.d.ts.map +1 -1
  112. package/format/OSMXML.js +11 -4
  113. package/format/OWS.d.ts +1 -1
  114. package/format/OWS.d.ts.map +1 -1
  115. package/format/Polyline.d.ts +2 -2
  116. package/format/Polyline.d.ts.map +1 -1
  117. package/format/TextFeature.d.ts +1 -1
  118. package/format/TextFeature.d.ts.map +1 -1
  119. package/format/TopoJSON.d.ts +1 -1
  120. package/format/TopoJSON.d.ts.map +1 -1
  121. package/format/WFS.d.ts +2 -2
  122. package/format/WFS.d.ts.map +1 -1
  123. package/format/WFS.js +8 -4
  124. package/format/WKB.d.ts +1 -1
  125. package/format/WKB.d.ts.map +1 -1
  126. package/format/WKB.js +6 -4
  127. package/format/WKT.d.ts +1 -1
  128. package/format/WKT.d.ts.map +1 -1
  129. package/format/WMSCapabilities.d.ts +1 -1
  130. package/format/WMSCapabilities.d.ts.map +1 -1
  131. package/format/WMSGetFeatureInfo.d.ts +1 -1
  132. package/format/WMSGetFeatureInfo.d.ts.map +1 -1
  133. package/format/WMTSCapabilities.d.ts +1 -1
  134. package/format/WMTSCapabilities.d.ts.map +1 -1
  135. package/format/XML.d.ts.map +1 -1
  136. package/format/XML.js +4 -2
  137. package/format/XMLFeature.d.ts +1 -1
  138. package/format/XMLFeature.d.ts.map +1 -1
  139. package/format/XMLFeature.js +16 -8
  140. package/format/filter/And.d.ts +1 -1
  141. package/format/filter/And.d.ts.map +1 -1
  142. package/format/filter/Bbox.d.ts +1 -1
  143. package/format/filter/Bbox.d.ts.map +1 -1
  144. package/format/filter/Comparison.d.ts +1 -1
  145. package/format/filter/Comparison.d.ts.map +1 -1
  146. package/format/filter/ComparisonBinary.d.ts +1 -1
  147. package/format/filter/ComparisonBinary.d.ts.map +1 -1
  148. package/format/filter/Contains.d.ts +1 -1
  149. package/format/filter/Contains.d.ts.map +1 -1
  150. package/format/filter/DWithin.d.ts +1 -1
  151. package/format/filter/DWithin.d.ts.map +1 -1
  152. package/format/filter/Disjoint.d.ts +1 -1
  153. package/format/filter/Disjoint.d.ts.map +1 -1
  154. package/format/filter/During.d.ts +1 -1
  155. package/format/filter/During.d.ts.map +1 -1
  156. package/format/filter/EqualTo.d.ts +1 -1
  157. package/format/filter/EqualTo.d.ts.map +1 -1
  158. package/format/filter/GreaterThan.d.ts +1 -1
  159. package/format/filter/GreaterThan.d.ts.map +1 -1
  160. package/format/filter/GreaterThanOrEqualTo.d.ts +1 -1
  161. package/format/filter/GreaterThanOrEqualTo.d.ts.map +1 -1
  162. package/format/filter/Intersects.d.ts +1 -1
  163. package/format/filter/Intersects.d.ts.map +1 -1
  164. package/format/filter/IsBetween.d.ts +1 -1
  165. package/format/filter/IsBetween.d.ts.map +1 -1
  166. package/format/filter/IsLike.d.ts +1 -1
  167. package/format/filter/IsLike.d.ts.map +1 -1
  168. package/format/filter/IsNull.d.ts +1 -1
  169. package/format/filter/IsNull.d.ts.map +1 -1
  170. package/format/filter/LessThan.d.ts +1 -1
  171. package/format/filter/LessThan.d.ts.map +1 -1
  172. package/format/filter/LessThanOrEqualTo.d.ts +1 -1
  173. package/format/filter/LessThanOrEqualTo.d.ts.map +1 -1
  174. package/format/filter/LogicalNary.d.ts +1 -1
  175. package/format/filter/LogicalNary.d.ts.map +1 -1
  176. package/format/filter/Not.d.ts +1 -1
  177. package/format/filter/Not.d.ts.map +1 -1
  178. package/format/filter/NotEqualTo.d.ts +1 -1
  179. package/format/filter/NotEqualTo.d.ts.map +1 -1
  180. package/format/filter/Or.d.ts +2 -2
  181. package/format/filter/Or.d.ts.map +1 -1
  182. package/format/filter/Or.js +1 -1
  183. package/format/filter/ResourceId.d.ts +1 -1
  184. package/format/filter/ResourceId.d.ts.map +1 -1
  185. package/format/filter/Spatial.d.ts +1 -1
  186. package/format/filter/Spatial.d.ts.map +1 -1
  187. package/format/filter/Within.d.ts +1 -1
  188. package/format/filter/Within.d.ts.map +1 -1
  189. package/format/filter.d.ts +20 -20
  190. package/format/filter.d.ts.map +1 -1
  191. package/geom/Circle.d.ts +1 -1
  192. package/geom/Circle.d.ts.map +1 -1
  193. package/geom/Circle.js +1 -17
  194. package/geom/Geometry.d.ts +1 -1
  195. package/geom/Geometry.d.ts.map +1 -1
  196. package/geom/GeometryCollection.d.ts +1 -1
  197. package/geom/GeometryCollection.d.ts.map +1 -1
  198. package/geom/LineString.d.ts +1 -1
  199. package/geom/LineString.d.ts.map +1 -1
  200. package/geom/LinearRing.d.ts +1 -1
  201. package/geom/LinearRing.d.ts.map +1 -1
  202. package/geom/MultiLineString.d.ts +2 -2
  203. package/geom/MultiLineString.d.ts.map +1 -1
  204. package/geom/MultiPoint.d.ts +2 -2
  205. package/geom/MultiPoint.d.ts.map +1 -1
  206. package/geom/MultiPolygon.d.ts +3 -3
  207. package/geom/MultiPolygon.d.ts.map +1 -1
  208. package/geom/Point.d.ts +1 -1
  209. package/geom/Point.d.ts.map +1 -1
  210. package/geom/Polygon.d.ts +3 -3
  211. package/geom/Polygon.d.ts.map +1 -1
  212. package/geom/SimpleGeometry.d.ts +1 -1
  213. package/geom/SimpleGeometry.d.ts.map +1 -1
  214. package/geom/flat/interpolate.d.ts.map +1 -1
  215. package/geom/flat/interpolate.js +4 -2
  216. package/geom/flat/orient.d.ts +1 -1
  217. package/geom/flat/orient.js +1 -1
  218. package/interaction/DblClickDragZoom.d.ts +110 -0
  219. package/interaction/DblClickDragZoom.d.ts.map +1 -0
  220. package/interaction/DblClickDragZoom.js +251 -0
  221. package/interaction/DoubleClickZoom.d.ts +1 -1
  222. package/interaction/DoubleClickZoom.d.ts.map +1 -1
  223. package/interaction/DragAndDrop.d.ts +2 -2
  224. package/interaction/DragAndDrop.d.ts.map +1 -1
  225. package/interaction/DragBox.d.ts +2 -2
  226. package/interaction/DragBox.d.ts.map +1 -1
  227. package/interaction/DragPan.d.ts +1 -1
  228. package/interaction/DragPan.d.ts.map +1 -1
  229. package/interaction/DragRotate.d.ts +1 -1
  230. package/interaction/DragRotate.d.ts.map +1 -1
  231. package/interaction/DragRotateAndZoom.d.ts +1 -1
  232. package/interaction/DragRotateAndZoom.d.ts.map +1 -1
  233. package/interaction/DragZoom.d.ts +1 -1
  234. package/interaction/DragZoom.d.ts.map +1 -1
  235. package/interaction/Draw.d.ts +6 -6
  236. package/interaction/Draw.d.ts.map +1 -1
  237. package/interaction/Extent.d.ts +2 -2
  238. package/interaction/Extent.d.ts.map +1 -1
  239. package/interaction/Extent.js +2 -1
  240. package/interaction/Interaction.d.ts +1 -1
  241. package/interaction/Interaction.d.ts.map +1 -1
  242. package/interaction/KeyboardPan.d.ts +1 -1
  243. package/interaction/KeyboardPan.d.ts.map +1 -1
  244. package/interaction/KeyboardPan.js +9 -9
  245. package/interaction/KeyboardZoom.d.ts +1 -1
  246. package/interaction/KeyboardZoom.d.ts.map +1 -1
  247. package/interaction/Link.d.ts +1 -1
  248. package/interaction/Link.d.ts.map +1 -1
  249. package/interaction/Modify.d.ts +6 -6
  250. package/interaction/Modify.d.ts.map +1 -1
  251. package/interaction/Modify.js +6 -1
  252. package/interaction/MouseWheelZoom.d.ts +1 -1
  253. package/interaction/MouseWheelZoom.d.ts.map +1 -1
  254. package/interaction/PinchRotate.d.ts +1 -1
  255. package/interaction/PinchRotate.d.ts.map +1 -1
  256. package/interaction/PinchZoom.d.ts +1 -1
  257. package/interaction/PinchZoom.d.ts.map +1 -1
  258. package/interaction/Pointer.d.ts +1 -1
  259. package/interaction/Pointer.d.ts.map +1 -1
  260. package/interaction/Select.d.ts +5 -5
  261. package/interaction/Select.d.ts.map +1 -1
  262. package/interaction/Snap.d.ts +1 -1
  263. package/interaction/Snap.d.ts.map +1 -1
  264. package/interaction/Snap.js +10 -4
  265. package/interaction/Translate.d.ts +4 -4
  266. package/interaction/Translate.d.ts.map +1 -1
  267. package/interaction/Translate.js +18 -3
  268. package/interaction/defaults.d.ts +1 -1
  269. package/interaction/defaults.d.ts.map +1 -1
  270. package/interaction.d.ts +1 -0
  271. package/interaction.js +1 -0
  272. package/layer/Base.d.ts +4 -3
  273. package/layer/Base.d.ts.map +1 -1
  274. package/layer/Base.js +3 -2
  275. package/layer/BaseImage.d.ts +1 -1
  276. package/layer/BaseImage.d.ts.map +1 -1
  277. package/layer/BaseTile.d.ts +1 -1
  278. package/layer/BaseTile.d.ts.map +1 -1
  279. package/layer/BaseVector.d.ts +10 -4
  280. package/layer/BaseVector.d.ts.map +1 -1
  281. package/layer/BaseVector.js +9 -3
  282. package/layer/Graticule.d.ts +6 -6
  283. package/layer/Graticule.d.ts.map +1 -1
  284. package/layer/Group.d.ts +4 -4
  285. package/layer/Group.d.ts.map +1 -1
  286. package/layer/Heatmap.d.ts +2 -2
  287. package/layer/Heatmap.d.ts.map +1 -1
  288. package/layer/Image.d.ts +2 -2
  289. package/layer/Image.d.ts.map +1 -1
  290. package/layer/Layer.d.ts +14 -11
  291. package/layer/Layer.d.ts.map +1 -1
  292. package/layer/Layer.js +28 -8
  293. package/layer/MapboxVector.d.ts +1 -1
  294. package/layer/MapboxVector.d.ts.map +1 -1
  295. package/layer/Tile.d.ts +2 -2
  296. package/layer/Tile.d.ts.map +1 -1
  297. package/layer/Vector.d.ts +2 -2
  298. package/layer/Vector.d.ts.map +1 -1
  299. package/layer/VectorImage.d.ts +2 -2
  300. package/layer/VectorImage.d.ts.map +1 -1
  301. package/layer/VectorTile.d.ts +2 -2
  302. package/layer/VectorTile.d.ts.map +1 -1
  303. package/layer/WebGLPoints.d.ts +4 -4
  304. package/layer/WebGLPoints.d.ts.map +1 -1
  305. package/layer/WebGLPoints.js +13 -4
  306. package/layer/WebGLTile.d.ts +9 -2
  307. package/layer/WebGLTile.d.ts.map +1 -1
  308. package/layer/WebGLTile.js +6 -6
  309. package/package.json +2 -2
  310. package/proj/proj4.d.ts +2 -2
  311. package/proj/proj4.d.ts.map +1 -1
  312. package/proj/proj4.js +1 -1
  313. package/proj.d.ts +9 -9
  314. package/proj.d.ts.map +1 -1
  315. package/proj.js +9 -8
  316. package/render/Box.d.ts +1 -1
  317. package/render/Box.d.ts.map +1 -1
  318. package/render/Event.d.ts +1 -1
  319. package/render/Event.d.ts.map +1 -1
  320. package/render/Feature.d.ts +7 -7
  321. package/render/Feature.d.ts.map +1 -1
  322. package/render/canvas/Builder.d.ts +1 -1
  323. package/render/canvas/Builder.d.ts.map +1 -1
  324. package/render/canvas/ImageBuilder.d.ts +1 -1
  325. package/render/canvas/ImageBuilder.d.ts.map +1 -1
  326. package/render/canvas/Immediate.d.ts +1 -1
  327. package/render/canvas/Immediate.d.ts.map +1 -1
  328. package/render/canvas/Immediate.js +9 -1
  329. package/render/canvas/LineStringBuilder.d.ts +1 -1
  330. package/render/canvas/LineStringBuilder.d.ts.map +1 -1
  331. package/render/canvas/PolygonBuilder.d.ts +1 -1
  332. package/render/canvas/PolygonBuilder.d.ts.map +1 -1
  333. package/render/canvas/TextBuilder.d.ts +1 -1
  334. package/render/canvas/TextBuilder.d.ts.map +1 -1
  335. package/render/canvas.d.ts +1 -1
  336. package/render/canvas.d.ts.map +1 -1
  337. package/render/webgl/MixedGeometryBatch.d.ts +37 -131
  338. package/render/webgl/MixedGeometryBatch.d.ts.map +1 -1
  339. package/render/webgl/MixedGeometryBatch.js +230 -147
  340. package/render/webgl/VectorStyleRenderer.d.ts +256 -0
  341. package/render/webgl/VectorStyleRenderer.d.ts.map +1 -0
  342. package/render/webgl/VectorStyleRenderer.js +440 -0
  343. package/render/webgl/constants.d.ts +1 -1
  344. package/render/webgl/constants.js +1 -1
  345. package/render/webgl/renderinstructions.d.ts +36 -0
  346. package/render/webgl/renderinstructions.d.ts.map +1 -0
  347. package/render/webgl/renderinstructions.js +241 -0
  348. package/render/webgl/utils.d.ts +4 -4
  349. package/render/webgl/utils.d.ts.map +1 -1
  350. package/render/webgl/utils.js +9 -9
  351. package/render.d.ts +1 -1
  352. package/render.d.ts.map +1 -1
  353. package/renderer/Composite.d.ts +1 -1
  354. package/renderer/Composite.d.ts.map +1 -1
  355. package/renderer/Layer.d.ts +1 -1
  356. package/renderer/Layer.d.ts.map +1 -1
  357. package/renderer/Map.d.ts +1 -1
  358. package/renderer/Map.d.ts.map +1 -1
  359. package/renderer/canvas/ImageLayer.d.ts +1 -1
  360. package/renderer/canvas/ImageLayer.d.ts.map +1 -1
  361. package/renderer/canvas/Layer.d.ts +1 -1
  362. package/renderer/canvas/Layer.d.ts.map +1 -1
  363. package/renderer/canvas/TileLayer.d.ts +1 -1
  364. package/renderer/canvas/TileLayer.d.ts.map +1 -1
  365. package/renderer/canvas/VectorImageLayer.d.ts +1 -1
  366. package/renderer/canvas/VectorImageLayer.d.ts.map +1 -1
  367. package/renderer/canvas/VectorLayer.d.ts +3 -3
  368. package/renderer/canvas/VectorLayer.d.ts.map +1 -1
  369. package/renderer/canvas/VectorTileLayer.d.ts +2 -2
  370. package/renderer/canvas/VectorTileLayer.d.ts.map +1 -1
  371. package/renderer/webgl/Layer.d.ts +2 -2
  372. package/renderer/webgl/Layer.d.ts.map +1 -1
  373. package/renderer/webgl/PointsLayer.d.ts +3 -3
  374. package/renderer/webgl/PointsLayer.d.ts.map +1 -1
  375. package/renderer/webgl/PointsLayer.js +5 -8
  376. package/renderer/webgl/TileLayer.d.ts +32 -99
  377. package/renderer/webgl/TileLayer.d.ts.map +1 -1
  378. package/renderer/webgl/TileLayer.js +103 -644
  379. package/renderer/webgl/TileLayerBase.d.ts +194 -0
  380. package/renderer/webgl/TileLayerBase.d.ts.map +1 -0
  381. package/renderer/webgl/TileLayerBase.js +750 -0
  382. package/renderer/webgl/VectorLayer.d.ts +59 -60
  383. package/renderer/webgl/VectorLayer.d.ts.map +1 -1
  384. package/renderer/webgl/VectorLayer.js +118 -156
  385. package/renderer/webgl/VectorTileLayer.d.ts +87 -0
  386. package/renderer/webgl/VectorTileLayer.d.ts.map +1 -0
  387. package/renderer/webgl/VectorTileLayer.js +201 -0
  388. package/reproj/DataTile.d.ts +1 -1
  389. package/reproj/DataTile.d.ts.map +1 -1
  390. package/reproj/Image.d.ts +1 -1
  391. package/reproj/Image.d.ts.map +1 -1
  392. package/reproj/Image.js +22 -8
  393. package/reproj/Tile.d.ts +1 -1
  394. package/reproj/Tile.d.ts.map +1 -1
  395. package/reproj/Triangulation.js +2 -2
  396. package/source/BingMaps.d.ts +1 -1
  397. package/source/BingMaps.d.ts.map +1 -1
  398. package/source/CartoDB.d.ts +1 -1
  399. package/source/CartoDB.d.ts.map +1 -1
  400. package/source/Cluster.d.ts +3 -3
  401. package/source/Cluster.d.ts.map +1 -1
  402. package/source/DataTile.d.ts +4 -4
  403. package/source/DataTile.d.ts.map +1 -1
  404. package/source/DataTile.js +1 -1
  405. package/source/GeoTIFF.d.ts +1 -1
  406. package/source/GeoTIFF.d.ts.map +1 -1
  407. package/source/IIIF.d.ts +1 -1
  408. package/source/IIIF.d.ts.map +1 -1
  409. package/source/Image.d.ts +2 -2
  410. package/source/Image.d.ts.map +1 -1
  411. package/source/ImageArcGISRest.d.ts +1 -1
  412. package/source/ImageArcGISRest.d.ts.map +1 -1
  413. package/source/ImageCanvas.d.ts +1 -1
  414. package/source/ImageCanvas.d.ts.map +1 -1
  415. package/source/ImageMapGuide.d.ts +1 -1
  416. package/source/ImageMapGuide.d.ts.map +1 -1
  417. package/source/ImageStatic.d.ts +1 -1
  418. package/source/ImageStatic.d.ts.map +1 -1
  419. package/source/ImageWMS.d.ts +1 -1
  420. package/source/ImageWMS.d.ts.map +1 -1
  421. package/source/OGCMapTile.d.ts +1 -1
  422. package/source/OGCMapTile.d.ts.map +1 -1
  423. package/source/OGCVectorTile.d.ts +1 -1
  424. package/source/OGCVectorTile.d.ts.map +1 -1
  425. package/source/OSM.d.ts +1 -1
  426. package/source/OSM.d.ts.map +1 -1
  427. package/source/Raster.d.ts +3 -3
  428. package/source/Raster.d.ts.map +1 -1
  429. package/source/Source.d.ts +5 -5
  430. package/source/Source.d.ts.map +1 -1
  431. package/source/Source.js +2 -2
  432. package/source/Stamen.d.ts +1 -1
  433. package/source/Stamen.d.ts.map +1 -1
  434. package/source/Tile.d.ts +2 -2
  435. package/source/Tile.d.ts.map +1 -1
  436. package/source/TileArcGISRest.d.ts +1 -1
  437. package/source/TileArcGISRest.d.ts.map +1 -1
  438. package/source/TileDebug.d.ts +1 -1
  439. package/source/TileDebug.d.ts.map +1 -1
  440. package/source/TileImage.d.ts +4 -4
  441. package/source/TileImage.d.ts.map +1 -1
  442. package/source/TileJSON.d.ts +1 -1
  443. package/source/TileJSON.d.ts.map +1 -1
  444. package/source/TileWMS.d.ts +1 -1
  445. package/source/TileWMS.d.ts.map +1 -1
  446. package/source/UTFGrid.d.ts +2 -2
  447. package/source/UTFGrid.d.ts.map +1 -1
  448. package/source/UrlTile.d.ts +1 -1
  449. package/source/UrlTile.d.ts.map +1 -1
  450. package/source/Vector.d.ts +3 -3
  451. package/source/Vector.d.ts.map +1 -1
  452. package/source/Vector.js +6 -3
  453. package/source/VectorTile.d.ts +4 -4
  454. package/source/VectorTile.d.ts.map +1 -1
  455. package/source/WMTS.d.ts +1 -1
  456. package/source/WMTS.d.ts.map +1 -1
  457. package/source/XYZ.d.ts +1 -1
  458. package/source/XYZ.d.ts.map +1 -1
  459. package/source/Zoomify.d.ts +2 -2
  460. package/source/Zoomify.d.ts.map +1 -1
  461. package/structs/LRUCache.d.ts.map +1 -1
  462. package/structs/LRUCache.js +2 -1
  463. package/style/Circle.d.ts +1 -1
  464. package/style/Circle.d.ts.map +1 -1
  465. package/style/Icon.d.ts +4 -78
  466. package/style/Icon.d.ts.map +1 -1
  467. package/style/Icon.js +89 -86
  468. package/style/IconImage.d.ts +1 -1
  469. package/style/IconImage.d.ts.map +1 -1
  470. package/style/RegularShape.d.ts +1 -1
  471. package/style/RegularShape.d.ts.map +1 -1
  472. package/style/RegularShape.js +1 -1
  473. package/style/Style.d.ts +2 -2
  474. package/style/Style.d.ts.map +1 -1
  475. package/style/Text.d.ts +5 -5
  476. package/style/Text.d.ts.map +1 -1
  477. package/style/Text.js +2 -2
  478. package/style/expressions.d.ts +42 -17
  479. package/style/expressions.d.ts.map +1 -1
  480. package/style/expressions.js +258 -118
  481. package/style/flat.d.ts +14 -0
  482. package/style/flat.d.ts.map +1 -1
  483. package/style/flat.js +6 -0
  484. package/style/literal.d.ts +204 -3
  485. package/style/literal.d.ts.map +1 -1
  486. package/style/literal.js +106 -3
  487. package/tilegrid/TileGrid.d.ts +1 -9
  488. package/tilegrid/TileGrid.d.ts.map +1 -1
  489. package/tilegrid/TileGrid.js +0 -18
  490. package/tilegrid/WMTS.d.ts +1 -1
  491. package/tilegrid/WMTS.d.ts.map +1 -1
  492. package/tilegrid.d.ts +1 -1
  493. package/tilegrid.d.ts.map +1 -1
  494. package/util.d.ts.map +1 -1
  495. package/util.js +1 -1
  496. package/webgl/BaseTileRepresentation.d.ts +72 -0
  497. package/webgl/BaseTileRepresentation.d.ts.map +1 -0
  498. package/webgl/BaseTileRepresentation.js +108 -0
  499. package/webgl/Buffer.d.ts +9 -6
  500. package/webgl/Buffer.d.ts.map +1 -1
  501. package/webgl/Buffer.js +6 -0
  502. package/webgl/Helper.d.ts +19 -12
  503. package/webgl/Helper.d.ts.map +1 -1
  504. package/webgl/Helper.js +79 -71
  505. package/webgl/ShaderBuilder.d.ts +75 -65
  506. package/webgl/ShaderBuilder.d.ts.map +1 -1
  507. package/webgl/ShaderBuilder.js +382 -241
  508. package/webgl/TileGeometry.d.ts +29 -0
  509. package/webgl/TileGeometry.d.ts.map +1 -0
  510. package/webgl/TileGeometry.js +73 -0
  511. package/webgl/TileTexture.d.ts +8 -51
  512. package/webgl/TileTexture.d.ts.map +1 -1
  513. package/webgl/TileTexture.js +11 -62
  514. package/webgl/styleparser.d.ts +61 -0
  515. package/webgl/styleparser.d.ts.map +1 -0
  516. package/webgl/styleparser.js +406 -0
  517. package/worker/webgl.js +1 -1
  518. package/events/KeyCode.d.ts +0 -8
  519. package/events/KeyCode.d.ts.map +0 -1
  520. package/events/KeyCode.js +0 -14
  521. package/render/webgl/BatchRenderer.d.ts +0 -92
  522. package/render/webgl/BatchRenderer.d.ts.map +0 -1
  523. package/render/webgl/BatchRenderer.js +0 -200
  524. package/render/webgl/LineStringBatchRenderer.d.ts +0 -27
  525. package/render/webgl/LineStringBatchRenderer.d.ts.map +0 -1
  526. package/render/webgl/LineStringBatchRenderer.js +0 -114
  527. package/render/webgl/PointBatchRenderer.d.ts +0 -26
  528. package/render/webgl/PointBatchRenderer.d.ts.map +0 -1
  529. package/render/webgl/PointBatchRenderer.js +0 -95
  530. package/render/webgl/PolygonBatchRenderer.d.ts +0 -25
  531. package/render/webgl/PolygonBatchRenderer.d.ts.map +0 -1
  532. package/render/webgl/PolygonBatchRenderer.js +0 -115
  533. package/renderer/webgl/shaders.d.ts +0 -43
  534. package/renderer/webgl/shaders.d.ts.map +0 -1
  535. package/renderer/webgl/shaders.js +0 -198
@@ -1,14 +1,22 @@
1
1
  /**
2
2
  * @module ol/render/webgl/MixedGeometryBatch
3
3
  */
4
- import WebGLArrayBuffer from '../../webgl/Buffer.js';
5
- import {ARRAY_BUFFER, DYNAMIC_DRAW, ELEMENT_ARRAY_BUFFER} from '../../webgl.js';
6
- import {create as createTransform} from '../../transform.js';
7
4
  import {getUid} from '../../util.js';
5
+ import {linearRingIsClockwise} from '../../geom/flat/orient.js';
6
+
7
+ /**
8
+ * @typedef {import("../../render/Feature").default} RenderFeature
9
+ */
10
+ /**
11
+ * @typedef {import("../../Feature").default} Feature
12
+ */
13
+ /**
14
+ * @typedef {import("../../geom/Geometry.js").Type} GeometryType
15
+ */
8
16
 
9
17
  /**
10
18
  * @typedef {Object} GeometryBatchItem Object that holds a reference to a feature as well as the raw coordinates of its various geometries
11
- * @property {import("../../Feature").default} feature Feature
19
+ * @property {Feature|RenderFeature} feature Feature
12
20
  * @property {Array<Array<number>>} flatCoordss Array of flat coordinates arrays, one for each geometry related to the feature
13
21
  * @property {number} [verticesCount] Only defined for linestring and polygon batches
14
22
  * @property {number} [ringsCount] Only defined for polygon batches
@@ -24,13 +32,6 @@ import {getUid} from '../../util.js';
24
32
  * @property {Object<string, GeometryBatchItem>} entries Dictionary of all entries in the batch with associated computed values.
25
33
  * One entry corresponds to one feature. Key is feature uid.
26
34
  * @property {number} geometriesCount Amount of geometries in the batch.
27
- * @property {Float32Array} renderInstructions Render instructions for polygons are structured like so:
28
- * [ numberOfRings, numberOfVerticesInRing0, ..., numberOfVerticesInRingN, x0, y0, customAttr0, ..., xN, yN, customAttrN, numberOfRings,... ]
29
- * @property {WebGLArrayBuffer} verticesBuffer Vertices WebGL buffer
30
- * @property {WebGLArrayBuffer} indicesBuffer Indices WebGL buffer
31
- * @property {import("../../transform.js").Transform} renderInstructionsTransform Converts world space coordinates to screen space; applies to the rendering instructions
32
- * @property {import("../../transform.js").Transform} verticesBufferTransform Converts world space coordinates to screen space; applies to the webgl vertices buffer
33
- * @property {import("../../transform.js").Transform} invertVerticesBufferTransform Screen space to world space; applies to the webgl vertices buffer
34
35
  * @property {number} verticesCount Amount of vertices from geometries in the batch.
35
36
  * @property {number} ringsCount How many outer and inner rings in this batch.
36
37
  */
@@ -40,13 +41,6 @@ import {getUid} from '../../util.js';
40
41
  * @property {Object<string, GeometryBatchItem>} entries Dictionary of all entries in the batch with associated computed values.
41
42
  * One entry corresponds to one feature. Key is feature uid.
42
43
  * @property {number} geometriesCount Amount of geometries in the batch.
43
- * @property {Float32Array} renderInstructions Render instructions for polygons are structured like so:
44
- * [ numberOfRings, numberOfVerticesInRing0, ..., numberOfVerticesInRingN, x0, y0, customAttr0, ..., xN, yN, customAttrN, numberOfRings,... ]
45
- * @property {WebGLArrayBuffer} verticesBuffer Vertices WebGL buffer
46
- * @property {WebGLArrayBuffer} indicesBuffer Indices WebGL buffer
47
- * @property {import("../../transform.js").Transform} renderInstructionsTransform Converts world space coordinates to screen space; applies to the rendering instructions
48
- * @property {import("../../transform.js").Transform} verticesBufferTransform Converts world space coordinates to screen space; applies to the webgl vertices buffer
49
- * @property {import("../../transform.js").Transform} invertVerticesBufferTransform Screen space to world space; applies to the webgl vertices buffer
50
44
  * @property {number} verticesCount Amount of vertices from geometries in the batch.
51
45
  */
52
46
 
@@ -55,13 +49,6 @@ import {getUid} from '../../util.js';
55
49
  * @property {Object<string, GeometryBatchItem>} entries Dictionary of all entries in the batch with associated computed values.
56
50
  * One entry corresponds to one feature. Key is feature uid.
57
51
  * @property {number} geometriesCount Amount of geometries in the batch.
58
- * @property {Float32Array} renderInstructions Render instructions for polygons are structured like so:
59
- * [ numberOfRings, numberOfVerticesInRing0, ..., numberOfVerticesInRingN, x0, y0, customAttr0, ..., xN, yN, customAttrN, numberOfRings,... ]
60
- * @property {WebGLArrayBuffer} verticesBuffer Vertices WebGL buffer
61
- * @property {WebGLArrayBuffer} indicesBuffer Indices WebGL buffer
62
- * @property {import("../../transform.js").Transform} renderInstructionsTransform Converts world space coordinates to screen space; applies to the rendering instructions
63
- * @property {import("../../transform.js").Transform} verticesBufferTransform Converts world space coordinates to screen space; applies to the webgl vertices buffer
64
- * @property {import("../../transform.js").Transform} invertVerticesBufferTransform Screen space to world space; applies to the webgl vertices buffer
65
52
  */
66
53
 
67
54
  /**
@@ -70,7 +57,7 @@ import {getUid} from '../../util.js';
70
57
  * from the batch, these inner batches are modified accordingly in order to keep them up-to-date.
71
58
  *
72
59
  * A feature can be present in several inner batches, for example a polygon geometry will be present in the polygon batch
73
- * and its linar rings will be present in the line batch. Multi geometries are also broken down into individual geometries
60
+ * and its linear rings will be present in the line batch. Multi geometries are also broken down into individual geometries
74
61
  * and added to the corresponding batches in a recursive manner.
75
62
  *
76
63
  * Corresponding {@link module:ol/render/webgl/BatchRenderer} instances are then used to generate the render instructions
@@ -93,12 +80,6 @@ class MixedGeometryBatch {
93
80
  geometriesCount: 0,
94
81
  verticesCount: 0,
95
82
  ringsCount: 0,
96
- renderInstructions: new Float32Array(0),
97
- verticesBuffer: new WebGLArrayBuffer(ARRAY_BUFFER, DYNAMIC_DRAW),
98
- indicesBuffer: new WebGLArrayBuffer(ELEMENT_ARRAY_BUFFER, DYNAMIC_DRAW),
99
- renderInstructionsTransform: createTransform(),
100
- verticesBufferTransform: createTransform(),
101
- invertVerticesBufferTransform: createTransform(),
102
83
  };
103
84
 
104
85
  /**
@@ -107,12 +88,6 @@ class MixedGeometryBatch {
107
88
  this.pointBatch = {
108
89
  entries: {},
109
90
  geometriesCount: 0,
110
- renderInstructions: new Float32Array(0),
111
- verticesBuffer: new WebGLArrayBuffer(ARRAY_BUFFER, DYNAMIC_DRAW),
112
- indicesBuffer: new WebGLArrayBuffer(ELEMENT_ARRAY_BUFFER, DYNAMIC_DRAW),
113
- renderInstructionsTransform: createTransform(),
114
- verticesBufferTransform: createTransform(),
115
- invertVerticesBufferTransform: createTransform(),
116
91
  };
117
92
 
118
93
  /**
@@ -122,17 +97,11 @@ class MixedGeometryBatch {
122
97
  entries: {},
123
98
  geometriesCount: 0,
124
99
  verticesCount: 0,
125
- renderInstructions: new Float32Array(0),
126
- verticesBuffer: new WebGLArrayBuffer(ARRAY_BUFFER, DYNAMIC_DRAW),
127
- indicesBuffer: new WebGLArrayBuffer(ELEMENT_ARRAY_BUFFER, DYNAMIC_DRAW),
128
- renderInstructionsTransform: createTransform(),
129
- verticesBufferTransform: createTransform(),
130
- invertVerticesBufferTransform: createTransform(),
131
100
  };
132
101
  }
133
102
 
134
103
  /**
135
- * @param {Array<import("../../Feature").default>} features Array of features to add to the batch
104
+ * @param {Array<Feature|RenderFeature>} features Array of features to add to the batch
136
105
  */
137
106
  addFeatures(features) {
138
107
  for (let i = 0; i < features.length; i++) {
@@ -141,7 +110,7 @@ class MixedGeometryBatch {
141
110
  }
142
111
 
143
112
  /**
144
- * @param {import("../../Feature").default} feature Feature to add to the batch
113
+ * @param {Feature|RenderFeature} feature Feature to add to the batch
145
114
  */
146
115
  addFeature(feature) {
147
116
  const geometry = feature.getGeometry();
@@ -152,59 +121,7 @@ class MixedGeometryBatch {
152
121
  }
153
122
 
154
123
  /**
155
- * @param {import("../../Feature").default} feature Feature
156
- * @return {GeometryBatchItem} Batch item added (or existing one)
157
- * @private
158
- */
159
- addFeatureEntryInPointBatch_(feature) {
160
- const uid = getUid(feature);
161
- if (!(uid in this.pointBatch.entries)) {
162
- this.pointBatch.entries[uid] = {
163
- feature: feature,
164
- flatCoordss: [],
165
- };
166
- }
167
- return this.pointBatch.entries[uid];
168
- }
169
-
170
- /**
171
- * @param {import("../../Feature").default} feature Feature
172
- * @return {GeometryBatchItem} Batch item added (or existing one)
173
- * @private
174
- */
175
- addFeatureEntryInLineStringBatch_(feature) {
176
- const uid = getUid(feature);
177
- if (!(uid in this.lineStringBatch.entries)) {
178
- this.lineStringBatch.entries[uid] = {
179
- feature: feature,
180
- flatCoordss: [],
181
- verticesCount: 0,
182
- };
183
- }
184
- return this.lineStringBatch.entries[uid];
185
- }
186
-
187
- /**
188
- * @param {import("../../Feature").default} feature Feature
189
- * @return {GeometryBatchItem} Batch item added (or existing one)
190
- * @private
191
- */
192
- addFeatureEntryInPolygonBatch_(feature) {
193
- const uid = getUid(feature);
194
- if (!(uid in this.polygonBatch.entries)) {
195
- this.polygonBatch.entries[uid] = {
196
- feature: feature,
197
- flatCoordss: [],
198
- verticesCount: 0,
199
- ringsCount: 0,
200
- ringsVerticesCounts: [],
201
- };
202
- }
203
- return this.polygonBatch.entries[uid];
204
- }
205
-
206
- /**
207
- * @param {import("../../Feature").default} feature Feature
124
+ * @param {Feature|RenderFeature} feature Feature
208
125
  * @private
209
126
  */
210
127
  clearFeatureEntryInPointBatch_(feature) {
@@ -217,7 +134,7 @@ class MixedGeometryBatch {
217
134
  }
218
135
 
219
136
  /**
220
- * @param {import("../../Feature").default} feature Feature
137
+ * @param {Feature|RenderFeature} feature Feature
221
138
  * @private
222
139
  */
223
140
  clearFeatureEntryInLineStringBatch_(feature) {
@@ -231,7 +148,7 @@ class MixedGeometryBatch {
231
148
  }
232
149
 
233
150
  /**
234
- * @param {import("../../Feature").default} feature Feature
151
+ * @param {Feature|RenderFeature} feature Feature
235
152
  * @private
236
153
  */
237
154
  clearFeatureEntryInPolygonBatch_(feature) {
@@ -246,79 +163,245 @@ class MixedGeometryBatch {
246
163
  }
247
164
 
248
165
  /**
249
- * @param {import("../../geom").Geometry} geometry Geometry
250
- * @param {import("../../Feature").default} feature Feature
166
+ * @param {import("../../geom").Geometry|RenderFeature} geometry Geometry
167
+ * @param {Feature|RenderFeature} feature Feature
251
168
  * @private
252
169
  */
253
170
  addGeometry_(geometry, feature) {
254
171
  const type = geometry.getType();
255
- let flatCoords;
256
- let verticesCount;
257
- let batchEntry;
258
172
  switch (type) {
259
173
  case 'GeometryCollection':
260
- /** @type {import("../../geom").GeometryCollection} */ (geometry)
261
- .getGeometries()
262
- .map((geom) => this.addGeometry_(geom, feature));
174
+ const geometries =
175
+ /** @type {import("../../geom").GeometryCollection} */ (
176
+ geometry
177
+ ).getGeometriesArray();
178
+ for (const geometry of geometries) {
179
+ this.addGeometry_(geometry, feature);
180
+ }
263
181
  break;
264
182
  case 'MultiPolygon':
265
- /** @type {import("../../geom").MultiPolygon} */ (geometry)
266
- .getPolygons()
267
- .map((polygon) => this.addGeometry_(polygon, feature));
183
+ const multiPolygonGeom =
184
+ /** @type {import("../../geom").MultiPolygon|RenderFeature} */ (
185
+ geometry
186
+ );
187
+ this.addCoordinates_(
188
+ type,
189
+ multiPolygonGeom.getFlatCoordinates(),
190
+ multiPolygonGeom.getEndss(),
191
+ feature,
192
+ getUid(feature)
193
+ );
268
194
  break;
269
195
  case 'MultiLineString':
270
- /** @type {import("../../geom").MultiLineString} */ (geometry)
271
- .getLineStrings()
272
- .map((line) => this.addGeometry_(line, feature));
196
+ const multiLineGeom =
197
+ /** @type {import("../../geom").MultiLineString|RenderFeature} */ (
198
+ geometry
199
+ );
200
+ this.addCoordinates_(
201
+ type,
202
+ multiLineGeom.getFlatCoordinates(),
203
+ multiLineGeom.getEnds(),
204
+ feature,
205
+ getUid(feature)
206
+ );
273
207
  break;
274
208
  case 'MultiPoint':
275
- /** @type {import("../../geom").MultiPoint} */ (geometry)
276
- .getPoints()
277
- .map((point) => this.addGeometry_(point, feature));
209
+ const multiPointGeom =
210
+ /** @type {import("../../geom").MultiPoint|RenderFeature} */ (
211
+ geometry
212
+ );
213
+ this.addCoordinates_(
214
+ type,
215
+ multiPointGeom.getFlatCoordinates(),
216
+ null,
217
+ feature,
218
+ getUid(feature)
219
+ );
278
220
  break;
279
221
  case 'Polygon':
280
- const polygonGeom = /** @type {import("../../geom").Polygon} */ (
222
+ const polygonGeom =
223
+ /** @type {import("../../geom").Polygon|RenderFeature} */ (geometry);
224
+ this.addCoordinates_(
225
+ type,
226
+ polygonGeom.getFlatCoordinates(),
227
+ polygonGeom.getEnds(),
228
+ feature,
229
+ getUid(feature)
230
+ );
231
+ break;
232
+ case 'Point':
233
+ const pointGeom = /** @type {import("../../geom").Point} */ (geometry);
234
+ this.addCoordinates_(
235
+ type,
236
+ pointGeom.getFlatCoordinates(),
237
+ null,
238
+ feature,
239
+ getUid(feature)
240
+ );
241
+ break;
242
+ case 'LineString':
243
+ case 'LinearRing':
244
+ const lineGeom = /** @type {import("../../geom").LineString} */ (
281
245
  geometry
282
246
  );
283
- batchEntry = this.addFeatureEntryInPolygonBatch_(feature);
284
- flatCoords = polygonGeom.getFlatCoordinates();
285
- verticesCount = flatCoords.length / 2;
286
- const ringsCount = polygonGeom.getLinearRingCount();
287
- const ringsVerticesCount = polygonGeom
288
- .getEnds()
289
- .map((end, ind, arr) =>
290
- ind > 0 ? (end - arr[ind - 1]) / 2 : end / 2
247
+ this.addCoordinates_(
248
+ type,
249
+ lineGeom.getFlatCoordinates(),
250
+ null,
251
+ feature,
252
+ getUid(feature)
253
+ );
254
+ break;
255
+ default:
256
+ // pass
257
+ }
258
+ }
259
+
260
+ /**
261
+ * @param {GeometryType} type Geometry type
262
+ * @param {Array<number>} flatCoords Flat coordinates
263
+ * @param {Array<number> | Array<Array<number>> | null} ends Coordinate ends
264
+ * @param {Feature|RenderFeature} feature Feature
265
+ * @param {string} featureUid Feature uid
266
+ * @private
267
+ */
268
+ addCoordinates_(type, flatCoords, ends, feature, featureUid) {
269
+ /** @type {number} */
270
+ let verticesCount;
271
+ switch (type) {
272
+ case 'MultiPolygon':
273
+ const multiPolygonEndss = /** @type {Array<Array<number>>} */ (ends);
274
+ for (let i = 0, ii = multiPolygonEndss.length; i < ii; i++) {
275
+ let polygonEnds = multiPolygonEndss[i];
276
+ const prevPolygonEnds = i > 0 ? multiPolygonEndss[i - 1] : null;
277
+ const startIndex = prevPolygonEnds
278
+ ? prevPolygonEnds[prevPolygonEnds.length - 1]
279
+ : 0;
280
+ const endIndex = polygonEnds[polygonEnds.length - 1];
281
+ const polygonCoords = flatCoords.slice(startIndex, endIndex);
282
+ polygonEnds =
283
+ startIndex > 0
284
+ ? polygonEnds.map((end) => end - startIndex)
285
+ : polygonEnds;
286
+ this.addCoordinates_(
287
+ 'Polygon',
288
+ polygonCoords,
289
+ polygonEnds,
290
+ feature,
291
+ featureUid
291
292
  );
293
+ }
294
+ break;
295
+ case 'MultiLineString':
296
+ const multiLineEnds = /** @type {Array<number>} */ (ends);
297
+ for (let i = 0, ii = multiLineEnds.length; i < ii; i++) {
298
+ const startIndex = i > 0 ? multiLineEnds[i - 1] : 0;
299
+ const ringCoords = flatCoords.slice(startIndex, multiLineEnds[i]);
300
+ this.addCoordinates_(
301
+ 'LinearRing',
302
+ ringCoords,
303
+ null,
304
+ feature,
305
+ featureUid
306
+ );
307
+ }
308
+ break;
309
+ case 'MultiPoint':
310
+ for (let i = 0, ii = flatCoords.length; i < ii; i += 2) {
311
+ this.addCoordinates_(
312
+ 'Point',
313
+ flatCoords.slice(i, i + 2),
314
+ null,
315
+ feature,
316
+ featureUid
317
+ );
318
+ }
319
+ break;
320
+ case 'Polygon':
321
+ const polygonEnds = /** @type {Array<number>} */ (ends);
322
+ // first look for a CW ring; if so, handle it and following rings as another polygon
323
+ for (let i = 1, ii = polygonEnds.length; i < ii; i++) {
324
+ const ringStartIndex = polygonEnds[i - 1];
325
+ if (
326
+ i > 0 &&
327
+ linearRingIsClockwise(flatCoords, ringStartIndex, polygonEnds[i], 2)
328
+ ) {
329
+ this.addCoordinates_(
330
+ 'Polygon',
331
+ flatCoords.slice(0, ringStartIndex),
332
+ polygonEnds.slice(0, i),
333
+ feature,
334
+ featureUid
335
+ );
336
+ this.addCoordinates_(
337
+ 'Polygon',
338
+ flatCoords.slice(ringStartIndex),
339
+ polygonEnds.slice(i).map((end) => end - polygonEnds[i - 1]),
340
+ feature,
341
+ featureUid
342
+ );
343
+ return;
344
+ }
345
+ }
346
+ if (!this.polygonBatch.entries[featureUid]) {
347
+ this.polygonBatch.entries[featureUid] = {
348
+ feature: feature,
349
+ flatCoordss: [],
350
+ verticesCount: 0,
351
+ ringsCount: 0,
352
+ ringsVerticesCounts: [],
353
+ };
354
+ }
355
+ verticesCount = flatCoords.length / 2;
356
+ const ringsCount = ends.length;
357
+ const ringsVerticesCount = ends.map((end, ind, arr) =>
358
+ ind > 0 ? (end - arr[ind - 1]) / 2 : end / 2
359
+ );
292
360
  this.polygonBatch.verticesCount += verticesCount;
293
361
  this.polygonBatch.ringsCount += ringsCount;
294
362
  this.polygonBatch.geometriesCount++;
295
- batchEntry.flatCoordss.push(flatCoords);
296
- batchEntry.ringsVerticesCounts.push(ringsVerticesCount);
297
- batchEntry.verticesCount += verticesCount;
298
- batchEntry.ringsCount += ringsCount;
299
- polygonGeom
300
- .getLinearRings()
301
- .map((ring) => this.addGeometry_(ring, feature));
363
+ this.polygonBatch.entries[featureUid].flatCoordss.push(flatCoords);
364
+ this.polygonBatch.entries[featureUid].ringsVerticesCounts.push(
365
+ ringsVerticesCount
366
+ );
367
+ this.polygonBatch.entries[featureUid].verticesCount += verticesCount;
368
+ this.polygonBatch.entries[featureUid].ringsCount += ringsCount;
369
+ for (let i = 0, ii = polygonEnds.length; i < ii; i++) {
370
+ const startIndex = i > 0 ? polygonEnds[i - 1] : 0;
371
+ const ringCoords = flatCoords.slice(startIndex, polygonEnds[i]);
372
+ this.addCoordinates_(
373
+ 'LinearRing',
374
+ ringCoords,
375
+ null,
376
+ feature,
377
+ featureUid
378
+ );
379
+ }
302
380
  break;
303
381
  case 'Point':
304
- const pointGeom = /** @type {import("../../geom").Point} */ (geometry);
305
- batchEntry = this.addFeatureEntryInPointBatch_(feature);
306
- flatCoords = pointGeom.getFlatCoordinates();
382
+ if (!this.pointBatch.entries[featureUid]) {
383
+ this.pointBatch.entries[featureUid] = {
384
+ feature: feature,
385
+ flatCoordss: [],
386
+ };
387
+ }
307
388
  this.pointBatch.geometriesCount++;
308
- batchEntry.flatCoordss.push(flatCoords);
389
+ this.pointBatch.entries[featureUid].flatCoordss.push(flatCoords);
309
390
  break;
310
391
  case 'LineString':
311
392
  case 'LinearRing':
312
- const lineGeom = /** @type {import("../../geom").LineString} */ (
313
- geometry
314
- );
315
- batchEntry = this.addFeatureEntryInLineStringBatch_(feature);
316
- flatCoords = lineGeom.getFlatCoordinates();
393
+ if (!this.lineStringBatch.entries[featureUid]) {
394
+ this.lineStringBatch.entries[featureUid] = {
395
+ feature: feature,
396
+ flatCoordss: [],
397
+ verticesCount: 0,
398
+ };
399
+ }
317
400
  verticesCount = flatCoords.length / 2;
318
401
  this.lineStringBatch.verticesCount += verticesCount;
319
402
  this.lineStringBatch.geometriesCount++;
320
- batchEntry.flatCoordss.push(flatCoords);
321
- batchEntry.verticesCount += verticesCount;
403
+ this.lineStringBatch.entries[featureUid].flatCoordss.push(flatCoords);
404
+ this.lineStringBatch.entries[featureUid].verticesCount += verticesCount;
322
405
  break;
323
406
  default:
324
407
  // pass
@@ -326,7 +409,7 @@ class MixedGeometryBatch {
326
409
  }
327
410
 
328
411
  /**
329
- * @param {import("../../Feature").default} feature Feature
412
+ * @param {Feature|RenderFeature} feature Feature
330
413
  */
331
414
  changeFeature(feature) {
332
415
  this.clearFeatureEntryInPointBatch_(feature);
@@ -340,7 +423,7 @@ class MixedGeometryBatch {
340
423
  }
341
424
 
342
425
  /**
343
- * @param {import("../../Feature").default} feature Feature
426
+ * @param {Feature|RenderFeature} feature Feature
344
427
  */
345
428
  removeFeature(feature) {
346
429
  this.clearFeatureEntryInPointBatch_(feature);