@deck.gl/aggregation-layers 9.0.0-beta.2 → 9.0.0-beta.3

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 (323) hide show
  1. package/dist/aggregation-layer.js +153 -0
  2. package/dist/contour-layer/contour-layer.js +241 -0
  3. package/dist/contour-layer/contour-utils.js +64 -0
  4. package/dist/contour-layer/marching-squares-codes.js +337 -0
  5. package/dist/contour-layer/marching-squares.js +147 -0
  6. package/dist/cpu-grid-layer/cpu-grid-layer.js +130 -0
  7. package/dist/cpu-grid-layer/grid-aggregator.js +141 -0
  8. package/dist/dist.dev.js +1296 -13614
  9. package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +34 -0
  10. package/dist/{esm/gpu-grid-layer → gpu-grid-layer}/gpu-grid-cell-layer-vertex.glsl.js +20 -1
  11. package/dist/gpu-grid-layer/gpu-grid-cell-layer.js +145 -0
  12. package/dist/gpu-grid-layer/gpu-grid-layer.js +288 -0
  13. package/dist/grid-aggregation-layer.js +172 -0
  14. package/dist/grid-layer/grid-layer.js +63 -0
  15. package/dist/heatmap-layer/heatmap-layer-utils.js +63 -0
  16. package/dist/heatmap-layer/heatmap-layer.js +471 -0
  17. package/dist/{esm/heatmap-layer → heatmap-layer}/max-fs.glsl.js +0 -1
  18. package/dist/{esm/heatmap-layer → heatmap-layer}/max-vs.glsl.js +0 -1
  19. package/dist/heatmap-layer/triangle-layer-fragment.glsl.js +61 -0
  20. package/dist/heatmap-layer/triangle-layer-vertex.glsl.js +52 -0
  21. package/dist/heatmap-layer/triangle-layer.js +59 -0
  22. package/dist/{esm/heatmap-layer → heatmap-layer}/weights-fs.glsl.js +0 -1
  23. package/dist/{esm/heatmap-layer → heatmap-layer}/weights-vs.glsl.js +0 -1
  24. package/dist/hexagon-layer/hexagon-aggregator.js +112 -0
  25. package/dist/hexagon-layer/hexagon-layer.js +174 -0
  26. package/dist/index.cjs +4494 -0
  27. package/dist/index.cjs.map +7 -0
  28. package/dist/index.js +32 -0
  29. package/dist/screen-grid-layer/screen-grid-cell-layer.js +166 -0
  30. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js +40 -0
  31. package/dist/{esm/screen-grid-layer → screen-grid-layer}/screen-grid-layer-vertex.glsl.js +19 -1
  32. package/dist/screen-grid-layer/screen-grid-layer.js +216 -0
  33. package/dist/types.js +1 -0
  34. package/dist/utils/aggregation-operation-utils.js +94 -0
  35. package/dist/utils/bin-sorter.js +167 -0
  36. package/dist/utils/color-utils.js +53 -0
  37. package/dist/utils/cpu-aggregator.js +421 -0
  38. package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +39 -0
  39. package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +53 -0
  40. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +34 -0
  41. package/dist/{esm/utils → utils}/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +19 -1
  42. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +41 -0
  43. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +1 -0
  44. package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map +1 -1
  45. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +566 -0
  46. package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +37 -0
  47. package/dist/utils/grid-aggregation-utils.js +114 -0
  48. package/dist/utils/prop-utils.js +28 -0
  49. package/dist/utils/resource-utils.js +38 -0
  50. package/dist/utils/scale-utils.js +184 -0
  51. package/dist.min.js +60 -174
  52. package/package.json +18 -11
  53. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts +10 -13
  54. package/dist/es5/aggregation-layer.js +0 -215
  55. package/dist/es5/aggregation-layer.js.map +0 -1
  56. package/dist/es5/contour-layer/contour-layer.js +0 -353
  57. package/dist/es5/contour-layer/contour-layer.js.map +0 -1
  58. package/dist/es5/contour-layer/contour-utils.js +0 -110
  59. package/dist/es5/contour-layer/contour-utils.js.map +0 -1
  60. package/dist/es5/contour-layer/marching-squares-codes.js +0 -152
  61. package/dist/es5/contour-layer/marching-squares-codes.js.map +0 -1
  62. package/dist/es5/contour-layer/marching-squares.js +0 -168
  63. package/dist/es5/contour-layer/marching-squares.js.map +0 -1
  64. package/dist/es5/cpu-grid-layer/cpu-grid-layer.js +0 -235
  65. package/dist/es5/cpu-grid-layer/cpu-grid-layer.js.map +0 -1
  66. package/dist/es5/cpu-grid-layer/grid-aggregator.js +0 -180
  67. package/dist/es5/cpu-grid-layer/grid-aggregator.js.map +0 -1
  68. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -9
  69. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js.map +0 -1
  70. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +0 -9
  71. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js.map +0 -1
  72. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer.js +0 -247
  73. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer.js.map +0 -1
  74. package/dist/es5/gpu-grid-layer/gpu-grid-layer.js +0 -424
  75. package/dist/es5/gpu-grid-layer/gpu-grid-layer.js.map +0 -1
  76. package/dist/es5/grid-aggregation-layer.js +0 -280
  77. package/dist/es5/grid-aggregation-layer.js.map +0 -1
  78. package/dist/es5/grid-layer/grid-layer.js +0 -125
  79. package/dist/es5/grid-layer/grid-layer.js.map +0 -1
  80. package/dist/es5/heatmap-layer/heatmap-layer-utils.js +0 -107
  81. package/dist/es5/heatmap-layer/heatmap-layer-utils.js.map +0 -1
  82. package/dist/es5/heatmap-layer/heatmap-layer.js +0 -678
  83. package/dist/es5/heatmap-layer/heatmap-layer.js.map +0 -1
  84. package/dist/es5/heatmap-layer/max-fs.glsl.js +0 -9
  85. package/dist/es5/heatmap-layer/max-fs.glsl.js.map +0 -1
  86. package/dist/es5/heatmap-layer/max-vs.glsl.js +0 -9
  87. package/dist/es5/heatmap-layer/max-vs.glsl.js.map +0 -1
  88. package/dist/es5/heatmap-layer/triangle-layer-fragment.glsl.js +0 -9
  89. package/dist/es5/heatmap-layer/triangle-layer-fragment.glsl.js.map +0 -1
  90. package/dist/es5/heatmap-layer/triangle-layer-vertex.glsl.js +0 -9
  91. package/dist/es5/heatmap-layer/triangle-layer-vertex.glsl.js.map +0 -1
  92. package/dist/es5/heatmap-layer/triangle-layer.js +0 -121
  93. package/dist/es5/heatmap-layer/triangle-layer.js.map +0 -1
  94. package/dist/es5/heatmap-layer/weights-fs.glsl.js +0 -9
  95. package/dist/es5/heatmap-layer/weights-fs.glsl.js.map +0 -1
  96. package/dist/es5/heatmap-layer/weights-vs.glsl.js +0 -9
  97. package/dist/es5/heatmap-layer/weights-vs.glsl.js.map +0 -1
  98. package/dist/es5/hexagon-layer/hexagon-aggregator.js +0 -118
  99. package/dist/es5/hexagon-layer/hexagon-aggregator.js.map +0 -1
  100. package/dist/es5/hexagon-layer/hexagon-layer.js +0 -289
  101. package/dist/es5/hexagon-layer/hexagon-layer.js.map +0 -1
  102. package/dist/es5/index.js +0 -104
  103. package/dist/es5/index.js.map +0 -1
  104. package/dist/es5/screen-grid-layer/screen-grid-cell-layer.js +0 -244
  105. package/dist/es5/screen-grid-layer/screen-grid-cell-layer.js.map +0 -1
  106. package/dist/es5/screen-grid-layer/screen-grid-layer-fragment.glsl.js +0 -9
  107. package/dist/es5/screen-grid-layer/screen-grid-layer-fragment.glsl.js.map +0 -1
  108. package/dist/es5/screen-grid-layer/screen-grid-layer-vertex.glsl.js +0 -9
  109. package/dist/es5/screen-grid-layer/screen-grid-layer-vertex.glsl.js.map +0 -1
  110. package/dist/es5/screen-grid-layer/screen-grid-layer.js +0 -317
  111. package/dist/es5/screen-grid-layer/screen-grid-layer.js.map +0 -1
  112. package/dist/es5/types.js +0 -2
  113. package/dist/es5/types.js.map +0 -1
  114. package/dist/es5/utils/aggregation-operation-utils.js +0 -123
  115. package/dist/es5/utils/aggregation-operation-utils.js.map +0 -1
  116. package/dist/es5/utils/bin-sorter.js +0 -248
  117. package/dist/es5/utils/bin-sorter.js.map +0 -1
  118. package/dist/es5/utils/color-utils.js +0 -39
  119. package/dist/es5/utils/color-utils.js.map +0 -1
  120. package/dist/es5/utils/cpu-aggregator.js +0 -496
  121. package/dist/es5/utils/cpu-aggregator.js.map +0 -1
  122. package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -9
  123. package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js.map +0 -1
  124. package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -9
  125. package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js.map +0 -1
  126. package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -9
  127. package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js.map +0 -1
  128. package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +0 -9
  129. package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js.map +0 -1
  130. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -63
  131. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js.map +0 -1
  132. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -2
  133. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js.map +0 -1
  134. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -732
  135. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.js.map +0 -1
  136. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
  137. package/dist/es5/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -9
  138. package/dist/es5/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js.map +0 -1
  139. package/dist/es5/utils/grid-aggregation-utils.js +0 -118
  140. package/dist/es5/utils/grid-aggregation-utils.js.map +0 -1
  141. package/dist/es5/utils/prop-utils.js +0 -19
  142. package/dist/es5/utils/prop-utils.js.map +0 -1
  143. package/dist/es5/utils/resource-utils.js +0 -59
  144. package/dist/es5/utils/resource-utils.js.map +0 -1
  145. package/dist/es5/utils/scale-utils.js +0 -254
  146. package/dist/es5/utils/scale-utils.js.map +0 -1
  147. package/dist/esm/aggregation-layer.js +0 -156
  148. package/dist/esm/aggregation-layer.js.map +0 -1
  149. package/dist/esm/contour-layer/contour-layer.js +0 -316
  150. package/dist/esm/contour-layer/contour-layer.js.map +0 -1
  151. package/dist/esm/contour-layer/contour-utils.js +0 -81
  152. package/dist/esm/contour-layer/contour-utils.js.map +0 -1
  153. package/dist/esm/contour-layer/marching-squares-codes.js +0 -219
  154. package/dist/esm/contour-layer/marching-squares-codes.js.map +0 -1
  155. package/dist/esm/contour-layer/marching-squares.js +0 -151
  156. package/dist/esm/contour-layer/marching-squares.js.map +0 -1
  157. package/dist/esm/cpu-grid-layer/cpu-grid-layer.js +0 -186
  158. package/dist/esm/cpu-grid-layer/cpu-grid-layer.js.map +0 -1
  159. package/dist/esm/cpu-grid-layer/grid-aggregator.js +0 -142
  160. package/dist/esm/cpu-grid-layer/grid-aggregator.js.map +0 -1
  161. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -16
  162. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js.map +0 -1
  163. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js.map +0 -1
  164. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer.js +0 -196
  165. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer.js.map +0 -1
  166. package/dist/esm/gpu-grid-layer/gpu-grid-layer.js +0 -399
  167. package/dist/esm/gpu-grid-layer/gpu-grid-layer.js.map +0 -1
  168. package/dist/esm/grid-aggregation-layer.js +0 -240
  169. package/dist/esm/grid-aggregation-layer.js.map +0 -1
  170. package/dist/esm/grid-layer/grid-layer.js +0 -80
  171. package/dist/esm/grid-layer/grid-layer.js.map +0 -1
  172. package/dist/esm/heatmap-layer/heatmap-layer-utils.js +0 -55
  173. package/dist/esm/heatmap-layer/heatmap-layer-utils.js.map +0 -1
  174. package/dist/esm/heatmap-layer/heatmap-layer.js +0 -638
  175. package/dist/esm/heatmap-layer/heatmap-layer.js.map +0 -1
  176. package/dist/esm/heatmap-layer/max-fs.glsl.js.map +0 -1
  177. package/dist/esm/heatmap-layer/max-vs.glsl.js.map +0 -1
  178. package/dist/esm/heatmap-layer/triangle-layer-fragment.glsl.js +0 -43
  179. package/dist/esm/heatmap-layer/triangle-layer-fragment.glsl.js.map +0 -1
  180. package/dist/esm/heatmap-layer/triangle-layer-vertex.glsl.js +0 -33
  181. package/dist/esm/heatmap-layer/triangle-layer-vertex.glsl.js.map +0 -1
  182. package/dist/esm/heatmap-layer/triangle-layer.js +0 -78
  183. package/dist/esm/heatmap-layer/triangle-layer.js.map +0 -1
  184. package/dist/esm/heatmap-layer/weights-fs.glsl.js.map +0 -1
  185. package/dist/esm/heatmap-layer/weights-vs.glsl.js.map +0 -1
  186. package/dist/esm/hexagon-layer/hexagon-aggregator.js +0 -87
  187. package/dist/esm/hexagon-layer/hexagon-aggregator.js.map +0 -1
  188. package/dist/esm/hexagon-layer/hexagon-layer.js +0 -232
  189. package/dist/esm/hexagon-layer/hexagon-layer.js.map +0 -1
  190. package/dist/esm/index.js +0 -13
  191. package/dist/esm/index.js.map +0 -1
  192. package/dist/esm/screen-grid-layer/screen-grid-cell-layer.js +0 -203
  193. package/dist/esm/screen-grid-layer/screen-grid-cell-layer.js.map +0 -1
  194. package/dist/esm/screen-grid-layer/screen-grid-layer-fragment.glsl.js +0 -21
  195. package/dist/esm/screen-grid-layer/screen-grid-layer-fragment.glsl.js.map +0 -1
  196. package/dist/esm/screen-grid-layer/screen-grid-layer-vertex.glsl.js.map +0 -1
  197. package/dist/esm/screen-grid-layer/screen-grid-layer.js +0 -285
  198. package/dist/esm/screen-grid-layer/screen-grid-layer.js.map +0 -1
  199. package/dist/esm/types.js +0 -2
  200. package/dist/esm/types.js.map +0 -1
  201. package/dist/esm/utils/aggregation-operation-utils.js +0 -91
  202. package/dist/esm/utils/aggregation-operation-utils.js.map +0 -1
  203. package/dist/esm/utils/bin-sorter.js +0 -165
  204. package/dist/esm/utils/bin-sorter.js.map +0 -1
  205. package/dist/esm/utils/color-utils.js +0 -28
  206. package/dist/esm/utils/color-utils.js.map +0 -1
  207. package/dist/esm/utils/cpu-aggregator.js +0 -487
  208. package/dist/esm/utils/cpu-aggregator.js.map +0 -1
  209. package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -21
  210. package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js.map +0 -1
  211. package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -35
  212. package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js.map +0 -1
  213. package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -16
  214. package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js.map +0 -1
  215. package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js.map +0 -1
  216. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -42
  217. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js.map +0 -1
  218. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -2
  219. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js.map +0 -1
  220. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -720
  221. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator.js.map +0 -1
  222. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
  223. package/dist/esm/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -19
  224. package/dist/esm/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js.map +0 -1
  225. package/dist/esm/utils/grid-aggregation-utils.js +0 -109
  226. package/dist/esm/utils/grid-aggregation-utils.js.map +0 -1
  227. package/dist/esm/utils/prop-utils.js +0 -12
  228. package/dist/esm/utils/prop-utils.js.map +0 -1
  229. package/dist/esm/utils/resource-utils.js +0 -44
  230. package/dist/esm/utils/resource-utils.js.map +0 -1
  231. package/dist/esm/utils/scale-utils.js +0 -192
  232. package/dist/esm/utils/scale-utils.js.map +0 -1
  233. /package/{typed → dist}/aggregation-layer.d.ts +0 -0
  234. /package/{typed → dist}/aggregation-layer.d.ts.map +0 -0
  235. /package/{typed → dist}/contour-layer/contour-layer.d.ts +0 -0
  236. /package/{typed → dist}/contour-layer/contour-layer.d.ts.map +0 -0
  237. /package/{typed → dist}/contour-layer/contour-utils.d.ts +0 -0
  238. /package/{typed → dist}/contour-layer/contour-utils.d.ts.map +0 -0
  239. /package/{typed → dist}/contour-layer/marching-squares-codes.d.ts +0 -0
  240. /package/{typed → dist}/contour-layer/marching-squares-codes.d.ts.map +0 -0
  241. /package/{typed → dist}/contour-layer/marching-squares.d.ts +0 -0
  242. /package/{typed → dist}/contour-layer/marching-squares.d.ts.map +0 -0
  243. /package/{typed → dist}/cpu-grid-layer/cpu-grid-layer.d.ts +0 -0
  244. /package/{typed → dist}/cpu-grid-layer/cpu-grid-layer.d.ts.map +0 -0
  245. /package/{typed → dist}/cpu-grid-layer/grid-aggregator.d.ts +0 -0
  246. /package/{typed → dist}/cpu-grid-layer/grid-aggregator.d.ts.map +0 -0
  247. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts +0 -0
  248. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map +0 -0
  249. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts +0 -0
  250. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map +0 -0
  251. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer.d.ts +0 -0
  252. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +0 -0
  253. /package/{typed → dist}/gpu-grid-layer/gpu-grid-layer.d.ts +0 -0
  254. /package/{typed → dist}/gpu-grid-layer/gpu-grid-layer.d.ts.map +0 -0
  255. /package/{typed → dist}/grid-aggregation-layer.d.ts +0 -0
  256. /package/{typed → dist}/grid-aggregation-layer.d.ts.map +0 -0
  257. /package/{typed → dist}/grid-layer/grid-layer.d.ts +0 -0
  258. /package/{typed → dist}/grid-layer/grid-layer.d.ts.map +0 -0
  259. /package/{typed → dist}/heatmap-layer/heatmap-layer-utils.d.ts +0 -0
  260. /package/{typed → dist}/heatmap-layer/heatmap-layer-utils.d.ts.map +0 -0
  261. /package/{typed → dist}/heatmap-layer/heatmap-layer.d.ts +0 -0
  262. /package/{typed → dist}/heatmap-layer/heatmap-layer.d.ts.map +0 -0
  263. /package/{typed → dist}/heatmap-layer/max-fs.glsl.d.ts +0 -0
  264. /package/{typed → dist}/heatmap-layer/max-fs.glsl.d.ts.map +0 -0
  265. /package/{typed → dist}/heatmap-layer/max-vs.glsl.d.ts +0 -0
  266. /package/{typed → dist}/heatmap-layer/max-vs.glsl.d.ts.map +0 -0
  267. /package/{typed → dist}/heatmap-layer/triangle-layer-fragment.glsl.d.ts +0 -0
  268. /package/{typed → dist}/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map +0 -0
  269. /package/{typed → dist}/heatmap-layer/triangle-layer-vertex.glsl.d.ts +0 -0
  270. /package/{typed → dist}/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map +0 -0
  271. /package/{typed → dist}/heatmap-layer/triangle-layer.d.ts +0 -0
  272. /package/{typed → dist}/heatmap-layer/triangle-layer.d.ts.map +0 -0
  273. /package/{typed → dist}/heatmap-layer/weights-fs.glsl.d.ts +0 -0
  274. /package/{typed → dist}/heatmap-layer/weights-fs.glsl.d.ts.map +0 -0
  275. /package/{typed → dist}/heatmap-layer/weights-vs.glsl.d.ts +0 -0
  276. /package/{typed → dist}/heatmap-layer/weights-vs.glsl.d.ts.map +0 -0
  277. /package/{typed → dist}/hexagon-layer/hexagon-aggregator.d.ts +0 -0
  278. /package/{typed → dist}/hexagon-layer/hexagon-aggregator.d.ts.map +0 -0
  279. /package/{typed → dist}/hexagon-layer/hexagon-layer.d.ts +0 -0
  280. /package/{typed → dist}/hexagon-layer/hexagon-layer.d.ts.map +0 -0
  281. /package/{typed → dist}/index.d.ts +0 -0
  282. /package/{typed → dist}/index.d.ts.map +0 -0
  283. /package/{typed → dist}/screen-grid-layer/screen-grid-cell-layer.d.ts +0 -0
  284. /package/{typed → dist}/screen-grid-layer/screen-grid-cell-layer.d.ts.map +0 -0
  285. /package/{typed → dist}/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts +0 -0
  286. /package/{typed → dist}/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map +0 -0
  287. /package/{typed → dist}/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts +0 -0
  288. /package/{typed → dist}/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map +0 -0
  289. /package/{typed → dist}/screen-grid-layer/screen-grid-layer.d.ts +0 -0
  290. /package/{typed → dist}/screen-grid-layer/screen-grid-layer.d.ts.map +0 -0
  291. /package/{typed → dist}/types.d.ts +0 -0
  292. /package/{typed → dist}/types.d.ts.map +0 -0
  293. /package/{typed → dist}/utils/aggregation-operation-utils.d.ts +0 -0
  294. /package/{typed → dist}/utils/aggregation-operation-utils.d.ts.map +0 -0
  295. /package/{typed → dist}/utils/bin-sorter.d.ts +0 -0
  296. /package/{typed → dist}/utils/bin-sorter.d.ts.map +0 -0
  297. /package/{typed → dist}/utils/color-utils.d.ts +0 -0
  298. /package/{typed → dist}/utils/color-utils.d.ts.map +0 -0
  299. /package/{typed → dist}/utils/cpu-aggregator.d.ts +0 -0
  300. /package/{typed → dist}/utils/cpu-aggregator.d.ts.map +0 -0
  301. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts +0 -0
  302. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map +0 -0
  303. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts +0 -0
  304. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map +0 -0
  305. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts +0 -0
  306. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map +0 -0
  307. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts +0 -0
  308. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map +0 -0
  309. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts +0 -0
  310. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map +0 -0
  311. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts +0 -0
  312. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map +0 -0
  313. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts +0 -0
  314. /package/{typed → dist}/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts +0 -0
  315. /package/{typed → dist}/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map +0 -0
  316. /package/{typed → dist}/utils/grid-aggregation-utils.d.ts +0 -0
  317. /package/{typed → dist}/utils/grid-aggregation-utils.d.ts.map +0 -0
  318. /package/{typed → dist}/utils/prop-utils.d.ts +0 -0
  319. /package/{typed → dist}/utils/prop-utils.d.ts.map +0 -0
  320. /package/{typed → dist}/utils/resource-utils.d.ts +0 -0
  321. /package/{typed → dist}/utils/resource-utils.d.ts.map +0 -0
  322. /package/{typed → dist}/utils/scale-utils.d.ts +0 -0
  323. /package/{typed → dist}/utils/scale-utils.d.ts.map +0 -0
@@ -1,638 +0,0 @@
1
- import { getBounds, boundsContain, packVertices, scaleToAspectRatio, getTextureCoordinates } from './heatmap-layer-utils';
2
- import { GL } from '@luma.gl/constants';
3
- import { TextureTransform } from '@luma.gl/engine';
4
- import { AttributeManager, COORDINATE_SYSTEM, log } from '@deck.gl/core';
5
- import TriangleLayer from './triangle-layer';
6
- import AggregationLayer from '../aggregation-layer';
7
- import { defaultColorRange, colorRangeToFlatArray } from '../utils/color-utils';
8
- import weightsVs from './weights-vs.glsl';
9
- import weightsFs from './weights-fs.glsl';
10
- import maxVs from './max-vs.glsl';
11
- import maxFs from './max-fs.glsl';
12
- const RESOLUTION = 2;
13
- const TEXTURE_PROPS = {
14
- format: 'rgba8unorm',
15
- mipmaps: false,
16
- sampler: {
17
- minFilter: 'linear',
18
- magFilter: 'linear',
19
- addressModeU: 'clamp-to-edge',
20
- addressModeV: 'clamp-to-edge'
21
- }
22
- };
23
- const DEFAULT_COLOR_DOMAIN = [0, 0];
24
- const AGGREGATION_MODE = {
25
- SUM: 0,
26
- MEAN: 1
27
- };
28
- const defaultProps = {
29
- getPosition: {
30
- type: 'accessor',
31
- value: x => x.position
32
- },
33
- getWeight: {
34
- type: 'accessor',
35
- value: 1
36
- },
37
- intensity: {
38
- type: 'number',
39
- min: 0,
40
- value: 1
41
- },
42
- radiusPixels: {
43
- type: 'number',
44
- min: 1,
45
- max: 100,
46
- value: 50
47
- },
48
- colorRange: defaultColorRange,
49
- threshold: {
50
- type: 'number',
51
- min: 0,
52
- max: 1,
53
- value: 0.05
54
- },
55
- colorDomain: {
56
- type: 'array',
57
- value: null,
58
- optional: true
59
- },
60
- aggregation: 'SUM',
61
- weightsTextureSize: {
62
- type: 'number',
63
- min: 128,
64
- max: 2048,
65
- value: 2048
66
- },
67
- debounceTimeout: {
68
- type: 'number',
69
- min: 0,
70
- max: 1000,
71
- value: 500
72
- }
73
- };
74
- const REQUIRED_FEATURES = ['blend-minmax-webgl1', 'texture-formats-float32-webgl1'];
75
- const FLOAT_TARGET_FEATURES = ['texture-renderable-float32-webgl', 'texture-blend-float-webgl1'];
76
- const DIMENSIONS = {
77
- data: {
78
- props: ['radiusPixels']
79
- }
80
- };
81
- export default class HeatmapLayer extends AggregationLayer {
82
- constructor(...args) {
83
- super(...args);
84
- this.state = void 0;
85
- }
86
-
87
- initializeState() {
88
- if (!REQUIRED_FEATURES.every(feature => this.context.device.features.has(feature))) {
89
- this.setState({
90
- supported: false
91
- });
92
- log.error(`HeatmapLayer: ${this.id} is not supported on this browser`)();
93
- return;
94
- }
95
-
96
- super.initializeAggregationLayer(DIMENSIONS);
97
- this.setState({
98
- supported: true,
99
- colorDomain: DEFAULT_COLOR_DOMAIN
100
- });
101
-
102
- this._setupTextureParams();
103
-
104
- this._setupAttributes();
105
-
106
- this._setupResources();
107
- }
108
-
109
- shouldUpdateState({
110
- changeFlags
111
- }) {
112
- return changeFlags.somethingChanged;
113
- }
114
-
115
- updateState(opts) {
116
- if (!this.state.supported) {
117
- return;
118
- }
119
-
120
- super.updateState(opts);
121
-
122
- this._updateHeatmapState(opts);
123
- }
124
-
125
- _updateHeatmapState(opts) {
126
- const {
127
- props,
128
- oldProps
129
- } = opts;
130
-
131
- const changeFlags = this._getChangeFlags(opts);
132
-
133
- if (changeFlags.dataChanged || changeFlags.viewportChanged) {
134
- changeFlags.boundsChanged = this._updateBounds(changeFlags.dataChanged);
135
-
136
- this._updateTextureRenderingBounds();
137
- }
138
-
139
- if (changeFlags.dataChanged || changeFlags.boundsChanged) {
140
- clearTimeout(this.state.updateTimer);
141
- this.setState({
142
- isWeightMapDirty: true
143
- });
144
- } else if (changeFlags.viewportZoomChanged) {
145
- this._debouncedUpdateWeightmap();
146
- }
147
-
148
- if (props.colorRange !== oldProps.colorRange) {
149
- this._updateColorTexture(opts);
150
- }
151
-
152
- if (this.state.isWeightMapDirty) {
153
- this._updateWeightmap();
154
- }
155
-
156
- this.setState({
157
- zoom: opts.context.viewport.zoom
158
- });
159
- }
160
-
161
- renderLayers() {
162
- if (!this.state.supported) {
163
- return [];
164
- }
165
-
166
- const {
167
- weightsTexture,
168
- triPositionBuffer,
169
- triTexCoordBuffer,
170
- maxWeightsTexture,
171
- colorTexture,
172
- colorDomain
173
- } = this.state;
174
- const {
175
- updateTriggers,
176
- intensity,
177
- threshold,
178
- aggregation
179
- } = this.props;
180
- const TriangleLayerClass = this.getSubLayerClass('triangle', TriangleLayer);
181
- return new TriangleLayerClass(this.getSubLayerProps({
182
- id: 'triangle-layer',
183
- updateTriggers
184
- }), {
185
- coordinateSystem: COORDINATE_SYSTEM.DEFAULT,
186
- data: {
187
- attributes: {
188
- positions: triPositionBuffer,
189
- texCoords: triTexCoordBuffer
190
- }
191
- },
192
- vertexCount: 4,
193
- maxTexture: maxWeightsTexture,
194
- colorTexture,
195
- aggregationMode: AGGREGATION_MODE[aggregation] || 0,
196
- weightsTexture,
197
- intensity,
198
- threshold,
199
- colorDomain
200
- });
201
- }
202
-
203
- finalizeState(context) {
204
- super.finalizeState(context);
205
- const {
206
- weightsTransform,
207
- weightsTexture,
208
- maxWeightTransform,
209
- maxWeightsTexture,
210
- triPositionBuffer,
211
- triTexCoordBuffer,
212
- colorTexture,
213
- updateTimer
214
- } = this.state;
215
- weightsTransform === null || weightsTransform === void 0 ? void 0 : weightsTransform.destroy();
216
- weightsTexture === null || weightsTexture === void 0 ? void 0 : weightsTexture.destroy();
217
- maxWeightTransform === null || maxWeightTransform === void 0 ? void 0 : maxWeightTransform.destroy();
218
- maxWeightsTexture === null || maxWeightsTexture === void 0 ? void 0 : maxWeightsTexture.destroy();
219
- triPositionBuffer === null || triPositionBuffer === void 0 ? void 0 : triPositionBuffer.destroy();
220
- triTexCoordBuffer === null || triTexCoordBuffer === void 0 ? void 0 : triTexCoordBuffer.destroy();
221
- colorTexture === null || colorTexture === void 0 ? void 0 : colorTexture.destroy();
222
-
223
- if (updateTimer) {
224
- clearTimeout(updateTimer);
225
- }
226
- }
227
-
228
- _getAttributeManager() {
229
- return new AttributeManager(this.context.device, {
230
- id: this.props.id,
231
- stats: this.context.stats
232
- });
233
- }
234
-
235
- _getChangeFlags(opts) {
236
- const changeFlags = {};
237
- const {
238
- dimensions
239
- } = this.state;
240
- changeFlags.dataChanged = this.isAttributeChanged() && 'attribute changed' || this.isAggregationDirty(opts, {
241
- compareAll: true,
242
- dimension: dimensions.data
243
- }) && 'aggregation is dirty';
244
- changeFlags.viewportChanged = opts.changeFlags.viewportChanged;
245
- const {
246
- zoom
247
- } = this.state;
248
-
249
- if (!opts.context.viewport || opts.context.viewport.zoom !== zoom) {
250
- changeFlags.viewportZoomChanged = true;
251
- }
252
-
253
- return changeFlags;
254
- }
255
-
256
- _createTextures() {
257
- const {
258
- textureSize,
259
- format
260
- } = this.state;
261
- this.setState({
262
- weightsTexture: this.context.device.createTexture({ ...TEXTURE_PROPS,
263
- width: textureSize,
264
- height: textureSize,
265
- format
266
- }),
267
- maxWeightsTexture: this.context.device.createTexture({ ...TEXTURE_PROPS,
268
- width: 1,
269
- height: 1,
270
- format
271
- })
272
- });
273
- }
274
-
275
- _setupAttributes() {
276
- const attributeManager = this.getAttributeManager();
277
- attributeManager.add({
278
- positions: {
279
- size: 3,
280
- type: 5130,
281
- accessor: 'getPosition'
282
- },
283
- weights: {
284
- size: 1,
285
- accessor: 'getWeight'
286
- }
287
- });
288
- this.setState({
289
- positionAttributeName: 'positions'
290
- });
291
- }
292
-
293
- _setupTextureParams() {
294
- const {
295
- device
296
- } = this.context;
297
- const {
298
- weightsTextureSize
299
- } = this.props;
300
- const textureSize = Math.min(weightsTextureSize, device.limits.maxTextureDimension2D);
301
- const floatTargetSupport = FLOAT_TARGET_FEATURES.every(feature => device.features.has(feature));
302
- const format = floatTargetSupport ? 'rgba32float' : 'rgba8unorm';
303
- const weightsScale = floatTargetSupport ? 1 : 1 / 255;
304
- this.setState({
305
- textureSize,
306
- format,
307
- weightsScale
308
- });
309
-
310
- if (!floatTargetSupport) {
311
- log.warn(`HeatmapLayer: ${this.id} rendering to float texture not supported, falling back to low precision format`)();
312
- }
313
- }
314
-
315
- _createWeightsTransform(shaders) {
316
- var _weightsTransform;
317
-
318
- let {
319
- weightsTransform
320
- } = this.state;
321
- const {
322
- weightsTexture
323
- } = this.state;
324
- const attributeManager = this.getAttributeManager();
325
- (_weightsTransform = weightsTransform) === null || _weightsTransform === void 0 ? void 0 : _weightsTransform.destroy();
326
- weightsTransform = new TextureTransform(this.context.device, {
327
- id: `${this.id}-weights-transform`,
328
- bufferLayout: attributeManager.getBufferLayouts(),
329
- vertexCount: 1,
330
- targetTexture: weightsTexture,
331
- parameters: {
332
- depthWriteEnabled: false,
333
- blendColorOperation: 'add',
334
- blendColorSrcFactor: 'one',
335
- blendColorDstFactor: 'one',
336
- blendAlphaSrcFactor: 'one',
337
- blendAlphaDstFactor: 'one'
338
- },
339
- topology: 'point-list',
340
- ...shaders
341
- });
342
- this.setState({
343
- weightsTransform
344
- });
345
- }
346
-
347
- _setupResources() {
348
- this._createTextures();
349
-
350
- const {
351
- device
352
- } = this.context;
353
- const {
354
- textureSize,
355
- weightsTexture,
356
- maxWeightsTexture
357
- } = this.state;
358
- const weightsTransformShaders = this.getShaders({
359
- vs: weightsVs,
360
- fs: weightsFs
361
- });
362
-
363
- this._createWeightsTransform(weightsTransformShaders);
364
-
365
- const maxWeightsTransformShaders = this.getShaders({
366
- vs: maxVs,
367
- fs: maxFs
368
- });
369
- const maxWeightTransform = new TextureTransform(device, {
370
- id: `${this.id}-max-weights-transform`,
371
- bindings: {
372
- inTexture: weightsTexture
373
- },
374
- uniforms: {
375
- textureSize
376
- },
377
- targetTexture: maxWeightsTexture,
378
- ...maxWeightsTransformShaders,
379
- vertexCount: textureSize * textureSize,
380
- topology: 'point-list',
381
- parameters: {
382
- depthWriteEnabled: false,
383
- blendColorOperation: 'max',
384
- blendAlphaOperation: 'max',
385
- blendColorSrcFactor: 'one',
386
- blendColorDstFactor: 'one',
387
- blendAlphaSrcFactor: 'one',
388
- blendAlphaDstFactor: 'one'
389
- }
390
- });
391
- this.setState({
392
- weightsTexture,
393
- maxWeightsTexture,
394
- maxWeightTransform,
395
- zoom: null,
396
- triPositionBuffer: device.createBuffer({
397
- byteLength: 48
398
- }),
399
- triTexCoordBuffer: device.createBuffer({
400
- byteLength: 48
401
- })
402
- });
403
- }
404
-
405
- updateShaders(shaderOptions) {
406
- this._createWeightsTransform({
407
- vs: weightsVs,
408
- fs: weightsFs,
409
- ...shaderOptions
410
- });
411
- }
412
-
413
- _updateMaxWeightValue() {
414
- const {
415
- maxWeightTransform,
416
- textureSize
417
- } = this.state;
418
- maxWeightTransform.run({
419
- parameters: {
420
- viewport: [0, 0, 1, 1]
421
- },
422
- clearColor: [0, 0, 0, 0]
423
- });
424
- }
425
-
426
- _updateBounds(forceUpdate = false) {
427
- const {
428
- viewport
429
- } = this.context;
430
- const viewportCorners = [viewport.unproject([0, 0]), viewport.unproject([viewport.width, 0]), viewport.unproject([viewport.width, viewport.height]), viewport.unproject([0, viewport.height])].map(p => p.map(Math.fround));
431
- const visibleWorldBounds = getBounds(viewportCorners);
432
- const newState = {
433
- visibleWorldBounds,
434
- viewportCorners
435
- };
436
- let boundsChanged = false;
437
-
438
- if (forceUpdate || !this.state.worldBounds || !boundsContain(this.state.worldBounds, visibleWorldBounds)) {
439
- const scaledCommonBounds = this._worldToCommonBounds(visibleWorldBounds);
440
-
441
- const worldBounds = this._commonToWorldBounds(scaledCommonBounds);
442
-
443
- if (this.props.coordinateSystem === COORDINATE_SYSTEM.LNGLAT) {
444
- worldBounds[1] = Math.max(worldBounds[1], -85.051129);
445
- worldBounds[3] = Math.min(worldBounds[3], 85.051129);
446
- worldBounds[0] = Math.max(worldBounds[0], -360);
447
- worldBounds[2] = Math.min(worldBounds[2], 360);
448
- }
449
-
450
- const normalizedCommonBounds = this._worldToCommonBounds(worldBounds);
451
-
452
- newState.worldBounds = worldBounds;
453
- newState.normalizedCommonBounds = normalizedCommonBounds;
454
- boundsChanged = true;
455
- }
456
-
457
- this.setState(newState);
458
- return boundsChanged;
459
- }
460
-
461
- _updateTextureRenderingBounds() {
462
- const {
463
- triPositionBuffer,
464
- triTexCoordBuffer,
465
- normalizedCommonBounds,
466
- viewportCorners
467
- } = this.state;
468
- const {
469
- viewport
470
- } = this.context;
471
- triPositionBuffer.write(packVertices(viewportCorners, 3));
472
- const textureBounds = viewportCorners.map(p => getTextureCoordinates(viewport.projectPosition(p), normalizedCommonBounds));
473
- triTexCoordBuffer.write(packVertices(textureBounds, 2));
474
- }
475
-
476
- _updateColorTexture(opts) {
477
- var _colorTexture;
478
-
479
- const {
480
- colorRange
481
- } = opts.props;
482
- let {
483
- colorTexture
484
- } = this.state;
485
- const colors = colorRangeToFlatArray(colorRange, false, Uint8Array);
486
-
487
- if (colorTexture && ((_colorTexture = colorTexture) === null || _colorTexture === void 0 ? void 0 : _colorTexture.width) === colorRange.length) {
488
- colorTexture.setSubImageData({
489
- data: colors
490
- });
491
- } else {
492
- var _colorTexture2;
493
-
494
- (_colorTexture2 = colorTexture) === null || _colorTexture2 === void 0 ? void 0 : _colorTexture2.destroy();
495
- colorTexture = this.context.device.createTexture({ ...TEXTURE_PROPS,
496
- data: colors,
497
- width: colorRange.length,
498
- height: 1
499
- });
500
- }
501
-
502
- this.setState({
503
- colorTexture
504
- });
505
- }
506
-
507
- _updateWeightmap() {
508
- const {
509
- radiusPixels,
510
- colorDomain,
511
- aggregation
512
- } = this.props;
513
- const {
514
- worldBounds,
515
- textureSize,
516
- weightsScale
517
- } = this.state;
518
- const weightsTransform = this.state.weightsTransform;
519
- this.state.isWeightMapDirty = false;
520
-
521
- const commonBounds = this._worldToCommonBounds(worldBounds, {
522
- useLayerCoordinateSystem: true
523
- });
524
-
525
- if (colorDomain && aggregation === 'SUM') {
526
- const {
527
- viewport
528
- } = this.context;
529
- const metersPerPixel = viewport.distanceScales.metersPerUnit[2] * (commonBounds[2] - commonBounds[0]) / textureSize;
530
- this.state.colorDomain = colorDomain.map(x => x * metersPerPixel * weightsScale);
531
- } else {
532
- this.state.colorDomain = colorDomain || DEFAULT_COLOR_DOMAIN;
533
- }
534
-
535
- const attributeManager = this.getAttributeManager();
536
- const attributes = attributeManager.getAttributes();
537
- const moduleSettings = this.getModuleSettings();
538
- const positions = attributes.positions.buffer;
539
- const uniforms = {
540
- radiusPixels,
541
- commonBounds,
542
- textureWidth: textureSize,
543
- weightsScale
544
- };
545
- const weights = attributes.weights.buffer;
546
- weightsTransform.model.setAttributes({
547
- positions,
548
- weights
549
- });
550
- weightsTransform.model.setVertexCount(this.getNumInstances());
551
- weightsTransform.model.setUniforms(uniforms);
552
- weightsTransform.model.updateModuleSettings(moduleSettings);
553
- weightsTransform.run({
554
- parameters: {
555
- viewport: [0, 0, textureSize, textureSize]
556
- },
557
- clearColor: [0, 0, 0, 0]
558
- });
559
-
560
- this._updateMaxWeightValue();
561
- }
562
-
563
- _debouncedUpdateWeightmap(fromTimer = false) {
564
- let {
565
- updateTimer
566
- } = this.state;
567
- const {
568
- debounceTimeout
569
- } = this.props;
570
-
571
- if (fromTimer) {
572
- updateTimer = null;
573
-
574
- this._updateBounds(true);
575
-
576
- this._updateTextureRenderingBounds();
577
-
578
- this.setState({
579
- isWeightMapDirty: true
580
- });
581
- } else {
582
- this.setState({
583
- isWeightMapDirty: false
584
- });
585
- clearTimeout(updateTimer);
586
- updateTimer = setTimeout(this._debouncedUpdateWeightmap.bind(this, true), debounceTimeout);
587
- }
588
-
589
- this.setState({
590
- updateTimer
591
- });
592
- }
593
-
594
- _worldToCommonBounds(worldBounds, opts = {}) {
595
- const {
596
- useLayerCoordinateSystem = false
597
- } = opts;
598
- const [minLong, minLat, maxLong, maxLat] = worldBounds;
599
- const {
600
- viewport
601
- } = this.context;
602
- const {
603
- textureSize
604
- } = this.state;
605
- const {
606
- coordinateSystem
607
- } = this.props;
608
- const offsetMode = useLayerCoordinateSystem && (coordinateSystem === COORDINATE_SYSTEM.LNGLAT_OFFSETS || coordinateSystem === COORDINATE_SYSTEM.METER_OFFSETS);
609
- const offsetOriginCommon = offsetMode ? viewport.projectPosition(this.props.coordinateOrigin) : [0, 0];
610
- const size = textureSize * RESOLUTION / viewport.scale;
611
- let bottomLeftCommon;
612
- let topRightCommon;
613
-
614
- if (useLayerCoordinateSystem && !offsetMode) {
615
- bottomLeftCommon = this.projectPosition([minLong, minLat, 0]);
616
- topRightCommon = this.projectPosition([maxLong, maxLat, 0]);
617
- } else {
618
- bottomLeftCommon = viewport.projectPosition([minLong, minLat, 0]);
619
- topRightCommon = viewport.projectPosition([maxLong, maxLat, 0]);
620
- }
621
-
622
- return scaleToAspectRatio([bottomLeftCommon[0] - offsetOriginCommon[0], bottomLeftCommon[1] - offsetOriginCommon[1], topRightCommon[0] - offsetOriginCommon[0], topRightCommon[1] - offsetOriginCommon[1]], size, size);
623
- }
624
-
625
- _commonToWorldBounds(commonBounds) {
626
- const [xMin, yMin, xMax, yMax] = commonBounds;
627
- const {
628
- viewport
629
- } = this.context;
630
- const bottomLeftWorld = viewport.unprojectPosition([xMin, yMin]);
631
- const topRightWorld = viewport.unprojectPosition([xMax, yMax]);
632
- return bottomLeftWorld.slice(0, 2).concat(topRightWorld.slice(0, 2));
633
- }
634
-
635
- }
636
- HeatmapLayer.layerName = 'HeatmapLayer';
637
- HeatmapLayer.defaultProps = defaultProps;
638
- //# sourceMappingURL=heatmap-layer.js.map