@deck.gl/carto 9.0.0-alpha.7 → 9.0.0-beta.10

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 (499) hide show
  1. package/{typed → dist}/api/carto-api-error.d.ts +1 -1
  2. package/dist/api/carto-api-error.d.ts.map +1 -0
  3. package/dist/api/carto-api-error.js +47 -0
  4. package/{typed → dist}/api/common.d.ts +1 -2
  5. package/{typed → dist}/api/common.d.ts.map +1 -1
  6. package/dist/{esm/api → api}/common.js +4 -6
  7. package/{typed → dist}/api/endpoints.d.ts +1 -1
  8. package/dist/api/endpoints.d.ts.map +1 -0
  9. package/dist/api/endpoints.js +22 -0
  10. package/{typed → dist}/api/fetch-map.d.ts.map +1 -1
  11. package/dist/api/fetch-map.js +196 -0
  12. package/dist/api/index.d.ts +7 -0
  13. package/dist/api/index.d.ts.map +1 -0
  14. package/dist/api/index.js +3 -0
  15. package/{typed → dist}/api/layer-map.d.ts +6 -6
  16. package/dist/api/layer-map.d.ts.map +1 -0
  17. package/dist/api/layer-map.js +373 -0
  18. package/dist/api/parse-map.js +250 -0
  19. package/{typed → dist}/api/query.d.ts +1 -1
  20. package/dist/api/query.d.ts.map +1 -0
  21. package/dist/api/query.js +24 -0
  22. package/{typed → dist}/api/request-with-parameters.d.ts +1 -1
  23. package/dist/api/request-with-parameters.d.ts.map +1 -0
  24. package/dist/api/request-with-parameters.js +53 -0
  25. package/{typed → dist}/api/types.d.ts +18 -1
  26. package/dist/api/types.d.ts.map +1 -0
  27. package/dist/api/types.js +20 -0
  28. package/dist/basemap.js +9 -0
  29. package/dist/cartoRasterTile-worker.js +6 -9
  30. package/dist/cartoSpatialTile-worker.js +3 -3
  31. package/dist/cartoVectorTile-worker.js +3 -3
  32. package/dist/constants.d.ts +5 -0
  33. package/dist/constants.d.ts.map +1 -0
  34. package/dist/constants.js +4 -0
  35. package/dist/dist.dev.js +1297 -1101
  36. package/dist/index.cjs +2700 -0
  37. package/dist/index.cjs.map +7 -0
  38. package/dist/index.d.ts +37 -0
  39. package/dist/index.d.ts.map +1 -0
  40. package/dist/index.js +34 -0
  41. package/{typed → dist}/layers/h3-tile-layer.d.ts +2 -2
  42. package/dist/layers/h3-tile-layer.d.ts.map +1 -0
  43. package/dist/layers/h3-tile-layer.js +66 -0
  44. package/dist/layers/h3-tileset-2d.js +99 -0
  45. package/dist/layers/point-label-layer.js +150 -0
  46. package/dist/layers/quadbin-layer.js +21 -0
  47. package/{typed → dist}/layers/quadbin-tile-layer.d.ts +3 -3
  48. package/dist/layers/quadbin-tile-layer.d.ts.map +1 -0
  49. package/dist/layers/quadbin-tile-layer.js +49 -0
  50. package/dist/layers/quadbin-tileset-2d.js +27 -0
  51. package/dist/layers/quadbin-utils.js +21 -0
  52. package/dist/layers/raster-layer-vertex.glsl.d.ts +3 -0
  53. package/dist/layers/raster-layer-vertex.glsl.js +68 -0
  54. package/{typed → dist}/layers/raster-layer.d.ts.map +1 -1
  55. package/dist/layers/raster-layer.js +95 -0
  56. package/{typed → dist}/layers/raster-tile-layer.d.ts +3 -3
  57. package/dist/layers/raster-tile-layer.d.ts.map +1 -0
  58. package/dist/layers/raster-tile-layer.js +45 -0
  59. package/dist/layers/schema/carto-properties-tile-loader.js +21 -0
  60. package/{typed → dist}/layers/schema/carto-properties-tile.d.ts +1 -1
  61. package/dist/layers/schema/carto-properties-tile.d.ts.map +1 -0
  62. package/dist/layers/schema/carto-properties-tile.js +14 -0
  63. package/{typed → dist}/layers/schema/carto-raster-tile-loader.d.ts +3 -3
  64. package/dist/layers/schema/carto-raster-tile-loader.d.ts.map +1 -0
  65. package/dist/layers/schema/carto-raster-tile-loader.js +35 -0
  66. package/{typed → dist}/layers/schema/carto-raster-tile.d.ts.map +1 -1
  67. package/dist/layers/schema/carto-raster-tile.js +44 -0
  68. package/dist/layers/schema/carto-spatial-tile-loader.js +35 -0
  69. package/{typed → dist}/layers/schema/carto-spatial-tile.d.ts +2 -2
  70. package/dist/layers/schema/carto-spatial-tile.d.ts.map +1 -0
  71. package/dist/layers/schema/carto-spatial-tile.js +38 -0
  72. package/dist/layers/schema/carto-tile.js +187 -0
  73. package/dist/layers/schema/carto-vector-tile-loader.js +65 -0
  74. package/dist/layers/schema/fast-pbf.js +7 -0
  75. package/dist/layers/schema/spatialjson-utils.js +15 -0
  76. package/dist/layers/schema/tile-loader-utils.js +6 -0
  77. package/{typed → dist}/layers/spatial-index-tile-layer.d.ts +1 -1
  78. package/{typed → dist}/layers/spatial-index-tile-layer.d.ts.map +1 -1
  79. package/dist/layers/spatial-index-tile-layer.js +67 -0
  80. package/{typed → dist}/layers/utils.d.ts +3 -3
  81. package/dist/layers/utils.d.ts.map +1 -0
  82. package/dist/layers/utils.js +74 -0
  83. package/{typed → dist}/layers/vector-tile-layer.d.ts +6 -5
  84. package/dist/layers/vector-tile-layer.d.ts.map +1 -0
  85. package/dist/layers/vector-tile-layer.js +104 -0
  86. package/{typed → dist}/sources/base-source.d.ts +2 -2
  87. package/dist/sources/base-source.d.ts.map +1 -0
  88. package/dist/sources/base-source.js +53 -0
  89. package/dist/sources/boundary-query-source.d.ts +11 -0
  90. package/dist/sources/boundary-query-source.d.ts.map +1 -0
  91. package/dist/sources/boundary-query-source.js +19 -0
  92. package/{typed → dist}/sources/boundary-table-source.d.ts +2 -2
  93. package/dist/sources/boundary-table-source.d.ts.map +1 -0
  94. package/dist/sources/boundary-table-source.js +16 -0
  95. package/{typed → dist}/sources/h3-query-source.d.ts +1 -1
  96. package/dist/sources/h3-query-source.d.ts.map +1 -0
  97. package/dist/sources/h3-query-source.js +19 -0
  98. package/{typed → dist}/sources/h3-table-source.d.ts +1 -1
  99. package/dist/sources/h3-table-source.d.ts.map +1 -0
  100. package/dist/sources/h3-table-source.js +16 -0
  101. package/{typed → dist}/sources/h3-tileset-source.d.ts +1 -1
  102. package/dist/sources/h3-tileset-source.d.ts.map +1 -0
  103. package/dist/sources/h3-tileset-source.js +6 -0
  104. package/dist/sources/index.d.ts +28 -0
  105. package/dist/sources/index.d.ts.map +1 -0
  106. package/dist/sources/index.js +13 -0
  107. package/{typed → dist}/sources/quadbin-query-source.d.ts +1 -1
  108. package/dist/sources/quadbin-query-source.d.ts.map +1 -0
  109. package/dist/sources/quadbin-query-source.js +19 -0
  110. package/{typed → dist}/sources/quadbin-table-source.d.ts +1 -1
  111. package/dist/sources/quadbin-table-source.d.ts.map +1 -0
  112. package/dist/sources/quadbin-table-source.js +16 -0
  113. package/{typed → dist}/sources/quadbin-tileset-source.d.ts +1 -1
  114. package/{typed → dist}/sources/quadbin-tileset-source.d.ts.map +1 -1
  115. package/dist/sources/quadbin-tileset-source.js +6 -0
  116. package/{typed → dist}/sources/raster-source.d.ts +1 -1
  117. package/dist/sources/raster-source.d.ts.map +1 -0
  118. package/dist/sources/raster-source.js +6 -0
  119. package/{typed → dist}/sources/types.d.ts +45 -7
  120. package/dist/sources/types.d.ts.map +1 -0
  121. package/dist/sources/types.js +1 -0
  122. package/dist/sources/vector-query-source.d.ts +4 -0
  123. package/dist/sources/vector-query-source.d.ts.map +1 -0
  124. package/dist/sources/vector-query-source.js +22 -0
  125. package/dist/sources/vector-table-source.d.ts +4 -0
  126. package/dist/sources/vector-table-source.d.ts.map +1 -0
  127. package/dist/sources/vector-table-source.js +19 -0
  128. package/{typed → dist}/sources/vector-tileset-source.d.ts +1 -1
  129. package/{typed → dist}/sources/vector-tileset-source.d.ts.map +1 -1
  130. package/dist/sources/vector-tileset-source.js +6 -0
  131. package/{typed → dist}/style/color-bins-style.d.ts +2 -2
  132. package/dist/style/color-bins-style.d.ts.map +1 -0
  133. package/dist/style/color-bins-style.js +21 -0
  134. package/{typed → dist}/style/color-categories-style.d.ts +2 -2
  135. package/dist/style/color-categories-style.d.ts.map +1 -0
  136. package/dist/style/color-categories-style.js +25 -0
  137. package/{typed → dist}/style/color-continuous-style.d.ts +2 -2
  138. package/dist/style/color-continuous-style.d.ts.map +1 -0
  139. package/dist/style/color-continuous-style.js +21 -0
  140. package/dist/style/palette.js +62 -0
  141. package/dist/style/utils.js +11 -0
  142. package/{typed → dist}/utils.d.ts +1 -1
  143. package/dist/utils.d.ts.map +1 -0
  144. package/dist/utils.js +45 -0
  145. package/dist/workers/cartoRasterTile.js +3 -0
  146. package/dist/workers/cartoSpatialTile.js +3 -0
  147. package/dist/workers/cartoVectorTile.js +3 -0
  148. package/dist.min.js +49 -93
  149. package/package.json +31 -26
  150. package/src/api/common.ts +1 -2
  151. package/src/api/fetch-map.ts +13 -4
  152. package/src/api/query.ts +1 -1
  153. package/src/api/request-with-parameters.ts +47 -34
  154. package/src/api/types.ts +20 -0
  155. package/src/constants.ts +5 -0
  156. package/src/index.ts +11 -7
  157. package/src/layers/h3-tile-layer.ts +3 -1
  158. package/src/layers/quadbin-tile-layer.ts +3 -1
  159. package/src/layers/raster-layer-vertex.glsl.ts +2 -2
  160. package/src/layers/raster-layer.ts +10 -16
  161. package/src/layers/raster-tile-layer.ts +3 -1
  162. package/src/layers/schema/carto-raster-tile-loader.ts +5 -5
  163. package/src/layers/schema/carto-raster-tile.ts +3 -4
  164. package/src/layers/spatial-index-tile-layer.ts +7 -3
  165. package/src/layers/vector-tile-layer.ts +17 -8
  166. package/src/sources/base-source.ts +4 -3
  167. package/src/sources/boundary-query-source.ts +27 -9
  168. package/src/sources/boundary-table-source.ts +13 -8
  169. package/src/sources/h3-query-source.ts +2 -1
  170. package/src/sources/h3-table-source.ts +2 -6
  171. package/src/sources/index.ts +7 -0
  172. package/src/sources/quadbin-query-source.ts +2 -1
  173. package/src/sources/quadbin-table-source.ts +2 -6
  174. package/src/sources/types.ts +49 -7
  175. package/src/sources/vector-query-source.ts +38 -4
  176. package/src/sources/vector-table-source.ts +32 -4
  177. package/src/utils.ts +5 -1
  178. package/dist/es5/api/carto-api-error.js +0 -83
  179. package/dist/es5/api/carto-api-error.js.map +0 -1
  180. package/dist/es5/api/common.js +0 -25
  181. package/dist/es5/api/common.js.map +0 -1
  182. package/dist/es5/api/endpoints.js +0 -61
  183. package/dist/es5/api/endpoints.js.map +0 -1
  184. package/dist/es5/api/fetch-map.js +0 -566
  185. package/dist/es5/api/fetch-map.js.map +0 -1
  186. package/dist/es5/api/index.js +0 -30
  187. package/dist/es5/api/index.js.map +0 -1
  188. package/dist/es5/api/layer-map.js +0 -634
  189. package/dist/es5/api/layer-map.js.map +0 -1
  190. package/dist/es5/api/parse-map.js +0 -347
  191. package/dist/es5/api/parse-map.js.map +0 -1
  192. package/dist/es5/api/query.js +0 -81
  193. package/dist/es5/api/query.js.map +0 -1
  194. package/dist/es5/api/request-with-parameters.js +0 -150
  195. package/dist/es5/api/request-with-parameters.js.map +0 -1
  196. package/dist/es5/api/types.js +0 -21
  197. package/dist/es5/api/types.js.map +0 -1
  198. package/dist/es5/basemap.js +0 -17
  199. package/dist/es5/basemap.js.map +0 -1
  200. package/dist/es5/index.js +0 -205
  201. package/dist/es5/index.js.map +0 -1
  202. package/dist/es5/layers/h3-tile-layer.js +0 -128
  203. package/dist/es5/layers/h3-tile-layer.js.map +0 -1
  204. package/dist/es5/layers/h3-tileset-2d.js +0 -172
  205. package/dist/es5/layers/h3-tileset-2d.js.map +0 -1
  206. package/dist/es5/layers/point-label-layer.js +0 -263
  207. package/dist/es5/layers/point-label-layer.js.map +0 -1
  208. package/dist/es5/layers/quadbin-layer.js +0 -72
  209. package/dist/es5/layers/quadbin-layer.js.map +0 -1
  210. package/dist/es5/layers/quadbin-tile-layer.js +0 -103
  211. package/dist/es5/layers/quadbin-tile-layer.js.map +0 -1
  212. package/dist/es5/layers/quadbin-tileset-2d.js +0 -76
  213. package/dist/es5/layers/quadbin-tileset-2d.js.map +0 -1
  214. package/dist/es5/layers/quadbin-utils.js +0 -60
  215. package/dist/es5/layers/quadbin-utils.js.map +0 -1
  216. package/dist/es5/layers/raster-layer-vertex.glsl.js +0 -9
  217. package/dist/es5/layers/raster-layer-vertex.glsl.js.map +0 -1
  218. package/dist/es5/layers/raster-layer.js +0 -174
  219. package/dist/es5/layers/raster-layer.js.map +0 -1
  220. package/dist/es5/layers/raster-tile-layer.js +0 -91
  221. package/dist/es5/layers/raster-tile-layer.js.map +0 -1
  222. package/dist/es5/layers/schema/carto-properties-tile-loader.js +0 -60
  223. package/dist/es5/layers/schema/carto-properties-tile-loader.js.map +0 -1
  224. package/dist/es5/layers/schema/carto-properties-tile.js +0 -38
  225. package/dist/es5/layers/schema/carto-properties-tile.js.map +0 -1
  226. package/dist/es5/layers/schema/carto-raster-tile-loader.js +0 -89
  227. package/dist/es5/layers/schema/carto-raster-tile-loader.js.map +0 -1
  228. package/dist/es5/layers/schema/carto-raster-tile.js +0 -79
  229. package/dist/es5/layers/schema/carto-raster-tile.js.map +0 -1
  230. package/dist/es5/layers/schema/carto-spatial-tile-loader.js +0 -81
  231. package/dist/es5/layers/schema/carto-spatial-tile-loader.js.map +0 -1
  232. package/dist/es5/layers/schema/carto-spatial-tile.js +0 -80
  233. package/dist/es5/layers/schema/carto-spatial-tile.js.map +0 -1
  234. package/dist/es5/layers/schema/carto-tile.js +0 -269
  235. package/dist/es5/layers/schema/carto-tile.js.map +0 -1
  236. package/dist/es5/layers/schema/carto-vector-tile-loader.js +0 -120
  237. package/dist/es5/layers/schema/carto-vector-tile-loader.js.map +0 -1
  238. package/dist/es5/layers/schema/fast-pbf.js +0 -14
  239. package/dist/es5/layers/schema/fast-pbf.js.map +0 -1
  240. package/dist/es5/layers/schema/spatialjson-utils.js +0 -42
  241. package/dist/es5/layers/schema/spatialjson-utils.js.map +0 -1
  242. package/dist/es5/layers/schema/tile-loader-utils.js +0 -17
  243. package/dist/es5/layers/schema/tile-loader-utils.js.map +0 -1
  244. package/dist/es5/layers/spatial-index-tile-layer.js +0 -126
  245. package/dist/es5/layers/spatial-index-tile-layer.js.map +0 -1
  246. package/dist/es5/layers/utils.js +0 -131
  247. package/dist/es5/layers/utils.js.map +0 -1
  248. package/dist/es5/layers/vector-tile-layer.js +0 -248
  249. package/dist/es5/layers/vector-tile-layer.js.map +0 -1
  250. package/dist/es5/sources/base-source.js +0 -128
  251. package/dist/es5/sources/base-source.js.map +0 -1
  252. package/dist/es5/sources/boundary-query-source.js +0 -51
  253. package/dist/es5/sources/boundary-query-source.js.map +0 -1
  254. package/dist/es5/sources/boundary-table-source.js +0 -51
  255. package/dist/es5/sources/boundary-table-source.js.map +0 -1
  256. package/dist/es5/sources/h3-query-source.js +0 -56
  257. package/dist/es5/sources/h3-query-source.js.map +0 -1
  258. package/dist/es5/sources/h3-table-source.js +0 -56
  259. package/dist/es5/sources/h3-table-source.js.map +0 -1
  260. package/dist/es5/sources/h3-tileset-source.js +0 -43
  261. package/dist/es5/sources/h3-tileset-source.js.map +0 -1
  262. package/dist/es5/sources/index.js +0 -110
  263. package/dist/es5/sources/index.js.map +0 -1
  264. package/dist/es5/sources/quadbin-query-source.js +0 -56
  265. package/dist/es5/sources/quadbin-query-source.js.map +0 -1
  266. package/dist/es5/sources/quadbin-table-source.js +0 -56
  267. package/dist/es5/sources/quadbin-table-source.js.map +0 -1
  268. package/dist/es5/sources/quadbin-tileset-source.js +0 -43
  269. package/dist/es5/sources/quadbin-tileset-source.js.map +0 -1
  270. package/dist/es5/sources/raster-source.js +0 -43
  271. package/dist/es5/sources/raster-source.js.map +0 -1
  272. package/dist/es5/sources/types.js +0 -2
  273. package/dist/es5/sources/types.js.map +0 -1
  274. package/dist/es5/sources/vector-query-source.js +0 -51
  275. package/dist/es5/sources/vector-query-source.js.map +0 -1
  276. package/dist/es5/sources/vector-table-source.js +0 -51
  277. package/dist/es5/sources/vector-table-source.js.map +0 -1
  278. package/dist/es5/sources/vector-tileset-source.js +0 -43
  279. package/dist/es5/sources/vector-tileset-source.js.map +0 -1
  280. package/dist/es5/style/color-bins-style.js +0 -37
  281. package/dist/es5/style/color-bins-style.js.map +0 -1
  282. package/dist/es5/style/color-categories-style.js +0 -65
  283. package/dist/es5/style/color-categories-style.js.map +0 -1
  284. package/dist/es5/style/color-continuous-style.js +0 -37
  285. package/dist/es5/style/color-continuous-style.js.map +0 -1
  286. package/dist/es5/style/palette.js +0 -81
  287. package/dist/es5/style/palette.js.map +0 -1
  288. package/dist/es5/style/utils.js +0 -28
  289. package/dist/es5/style/utils.js.map +0 -1
  290. package/dist/es5/utils.js +0 -65
  291. package/dist/es5/utils.js.map +0 -1
  292. package/dist/es5/workers/cartoRasterTile.js +0 -10
  293. package/dist/es5/workers/cartoRasterTile.js.map +0 -1
  294. package/dist/es5/workers/cartoSpatialTile.js +0 -10
  295. package/dist/es5/workers/cartoSpatialTile.js.map +0 -1
  296. package/dist/es5/workers/cartoVectorTile.js +0 -10
  297. package/dist/es5/workers/cartoVectorTile.js.map +0 -1
  298. package/dist/esm/api/carto-api-error.js +0 -46
  299. package/dist/esm/api/carto-api-error.js.map +0 -1
  300. package/dist/esm/api/common.js.map +0 -1
  301. package/dist/esm/api/endpoints.js +0 -41
  302. package/dist/esm/api/endpoints.js.map +0 -1
  303. package/dist/esm/api/fetch-map.js +0 -298
  304. package/dist/esm/api/fetch-map.js.map +0 -1
  305. package/dist/esm/api/index.js +0 -4
  306. package/dist/esm/api/index.js.map +0 -1
  307. package/dist/esm/api/layer-map.js +0 -520
  308. package/dist/esm/api/layer-map.js.map +0 -1
  309. package/dist/esm/api/parse-map.js +0 -343
  310. package/dist/esm/api/parse-map.js.map +0 -1
  311. package/dist/esm/api/query.js +0 -40
  312. package/dist/esm/api/query.js.map +0 -1
  313. package/dist/esm/api/request-with-parameters.js +0 -82
  314. package/dist/esm/api/request-with-parameters.js.map +0 -1
  315. package/dist/esm/api/types.js +0 -14
  316. package/dist/esm/api/types.js.map +0 -1
  317. package/dist/esm/basemap.js +0 -10
  318. package/dist/esm/basemap.js.map +0 -1
  319. package/dist/esm/index.js +0 -35
  320. package/dist/esm/index.js.map +0 -1
  321. package/dist/esm/layers/h3-tile-layer.js +0 -77
  322. package/dist/esm/layers/h3-tile-layer.js.map +0 -1
  323. package/dist/esm/layers/h3-tileset-2d.js +0 -119
  324. package/dist/esm/layers/h3-tileset-2d.js.map +0 -1
  325. package/dist/esm/layers/point-label-layer.js +0 -194
  326. package/dist/esm/layers/point-label-layer.js.map +0 -1
  327. package/dist/esm/layers/quadbin-layer.js +0 -31
  328. package/dist/esm/layers/quadbin-layer.js.map +0 -1
  329. package/dist/esm/layers/quadbin-tile-layer.js +0 -51
  330. package/dist/esm/layers/quadbin-tile-layer.js.map +0 -1
  331. package/dist/esm/layers/quadbin-tileset-2d.js +0 -39
  332. package/dist/esm/layers/quadbin-tileset-2d.js.map +0 -1
  333. package/dist/esm/layers/quadbin-utils.js +0 -23
  334. package/dist/esm/layers/quadbin-utils.js.map +0 -1
  335. package/dist/esm/layers/raster-layer-vertex.glsl.js +0 -99
  336. package/dist/esm/layers/raster-layer-vertex.glsl.js.map +0 -1
  337. package/dist/esm/layers/raster-layer.js +0 -108
  338. package/dist/esm/layers/raster-layer.js.map +0 -1
  339. package/dist/esm/layers/raster-tile-layer.js +0 -48
  340. package/dist/esm/layers/raster-tile-layer.js.map +0 -1
  341. package/dist/esm/layers/schema/carto-properties-tile-loader.js +0 -23
  342. package/dist/esm/layers/schema/carto-properties-tile-loader.js.map +0 -1
  343. package/dist/esm/layers/schema/carto-properties-tile.js +0 -18
  344. package/dist/esm/layers/schema/carto-properties-tile.js.map +0 -1
  345. package/dist/esm/layers/schema/carto-raster-tile-loader.js +0 -54
  346. package/dist/esm/layers/schema/carto-raster-tile-loader.js.map +0 -1
  347. package/dist/esm/layers/schema/carto-raster-tile.js +0 -51
  348. package/dist/esm/layers/schema/carto-raster-tile.js.map +0 -1
  349. package/dist/esm/layers/schema/carto-spatial-tile-loader.js +0 -44
  350. package/dist/esm/layers/schema/carto-spatial-tile-loader.js.map +0 -1
  351. package/dist/esm/layers/schema/carto-spatial-tile.js +0 -47
  352. package/dist/esm/layers/schema/carto-spatial-tile.js.map +0 -1
  353. package/dist/esm/layers/schema/carto-tile.js +0 -197
  354. package/dist/esm/layers/schema/carto-tile.js.map +0 -1
  355. package/dist/esm/layers/schema/carto-vector-tile-loader.js +0 -82
  356. package/dist/esm/layers/schema/carto-vector-tile-loader.js.map +0 -1
  357. package/dist/esm/layers/schema/fast-pbf.js +0 -7
  358. package/dist/esm/layers/schema/fast-pbf.js.map +0 -1
  359. package/dist/esm/layers/schema/spatialjson-utils.js +0 -27
  360. package/dist/esm/layers/schema/spatialjson-utils.js.map +0 -1
  361. package/dist/esm/layers/schema/tile-loader-utils.js +0 -7
  362. package/dist/esm/layers/schema/tile-loader-utils.js.map +0 -1
  363. package/dist/esm/layers/spatial-index-tile-layer.js +0 -86
  364. package/dist/esm/layers/spatial-index-tile-layer.js.map +0 -1
  365. package/dist/esm/layers/utils.js +0 -85
  366. package/dist/esm/layers/utils.js.map +0 -1
  367. package/dist/esm/layers/vector-tile-layer.js +0 -143
  368. package/dist/esm/layers/vector-tile-layer.js.map +0 -1
  369. package/dist/esm/sources/base-source.js +0 -72
  370. package/dist/esm/sources/base-source.js.map +0 -1
  371. package/dist/esm/sources/boundary-query-source.js +0 -21
  372. package/dist/esm/sources/boundary-query-source.js.map +0 -1
  373. package/dist/esm/sources/boundary-table-source.js +0 -21
  374. package/dist/esm/sources/boundary-table-source.js.map +0 -1
  375. package/dist/esm/sources/h3-query-source.js +0 -27
  376. package/dist/esm/sources/h3-query-source.js.map +0 -1
  377. package/dist/esm/sources/h3-table-source.js +0 -27
  378. package/dist/esm/sources/h3-table-source.js.map +0 -1
  379. package/dist/esm/sources/h3-tileset-source.js +0 -11
  380. package/dist/esm/sources/h3-tileset-source.js.map +0 -1
  381. package/dist/esm/sources/index.js +0 -14
  382. package/dist/esm/sources/index.js.map +0 -1
  383. package/dist/esm/sources/quadbin-query-source.js +0 -27
  384. package/dist/esm/sources/quadbin-query-source.js.map +0 -1
  385. package/dist/esm/sources/quadbin-table-source.js +0 -27
  386. package/dist/esm/sources/quadbin-table-source.js.map +0 -1
  387. package/dist/esm/sources/quadbin-tileset-source.js +0 -11
  388. package/dist/esm/sources/quadbin-tileset-source.js.map +0 -1
  389. package/dist/esm/sources/raster-source.js +0 -11
  390. package/dist/esm/sources/raster-source.js.map +0 -1
  391. package/dist/esm/sources/types.js +0 -2
  392. package/dist/esm/sources/types.js.map +0 -1
  393. package/dist/esm/sources/vector-query-source.js +0 -20
  394. package/dist/esm/sources/vector-query-source.js.map +0 -1
  395. package/dist/esm/sources/vector-table-source.js +0 -20
  396. package/dist/esm/sources/vector-table-source.js.map +0 -1
  397. package/dist/esm/sources/vector-tileset-source.js +0 -11
  398. package/dist/esm/sources/vector-tileset-source.js.map +0 -1
  399. package/dist/esm/style/color-bins-style.js +0 -19
  400. package/dist/esm/style/color-bins-style.js.map +0 -1
  401. package/dist/esm/style/color-categories-style.js +0 -24
  402. package/dist/esm/style/color-categories-style.js.map +0 -1
  403. package/dist/esm/style/color-continuous-style.js +0 -19
  404. package/dist/esm/style/color-continuous-style.js.map +0 -1
  405. package/dist/esm/style/palette.js +0 -51
  406. package/dist/esm/style/palette.js.map +0 -1
  407. package/dist/esm/style/utils.js +0 -15
  408. package/dist/esm/style/utils.js.map +0 -1
  409. package/dist/esm/utils.js +0 -51
  410. package/dist/esm/utils.js.map +0 -1
  411. package/dist/esm/workers/cartoRasterTile.js +0 -4
  412. package/dist/esm/workers/cartoRasterTile.js.map +0 -1
  413. package/dist/esm/workers/cartoSpatialTile.js +0 -4
  414. package/dist/esm/workers/cartoSpatialTile.js.map +0 -1
  415. package/dist/esm/workers/cartoVectorTile.js +0 -4
  416. package/dist/esm/workers/cartoVectorTile.js.map +0 -1
  417. package/src/.DS_Store +0 -0
  418. package/typed/api/carto-api-error.d.ts.map +0 -1
  419. package/typed/api/endpoints.d.ts.map +0 -1
  420. package/typed/api/index.d.ts +0 -7
  421. package/typed/api/index.d.ts.map +0 -1
  422. package/typed/api/layer-map.d.ts.map +0 -1
  423. package/typed/api/query.d.ts.map +0 -1
  424. package/typed/api/request-with-parameters.d.ts.map +0 -1
  425. package/typed/api/types.d.ts.map +0 -1
  426. package/typed/index.d.ts +0 -37
  427. package/typed/index.d.ts.map +0 -1
  428. package/typed/layers/h3-tile-layer.d.ts.map +0 -1
  429. package/typed/layers/quadbin-tile-layer.d.ts.map +0 -1
  430. package/typed/layers/raster-layer-vertex.glsl.d.ts +0 -3
  431. package/typed/layers/raster-tile-layer.d.ts.map +0 -1
  432. package/typed/layers/schema/carto-properties-tile.d.ts.map +0 -1
  433. package/typed/layers/schema/carto-raster-tile-loader.d.ts.map +0 -1
  434. package/typed/layers/schema/carto-spatial-tile.d.ts.map +0 -1
  435. package/typed/layers/utils.d.ts.map +0 -1
  436. package/typed/layers/vector-tile-layer.d.ts.map +0 -1
  437. package/typed/sources/base-source.d.ts.map +0 -1
  438. package/typed/sources/boundary-query-source.d.ts +0 -10
  439. package/typed/sources/boundary-query-source.d.ts.map +0 -1
  440. package/typed/sources/boundary-table-source.d.ts.map +0 -1
  441. package/typed/sources/h3-query-source.d.ts.map +0 -1
  442. package/typed/sources/h3-table-source.d.ts.map +0 -1
  443. package/typed/sources/h3-tileset-source.d.ts.map +0 -1
  444. package/typed/sources/index.d.ts +0 -27
  445. package/typed/sources/index.d.ts.map +0 -1
  446. package/typed/sources/quadbin-query-source.d.ts.map +0 -1
  447. package/typed/sources/quadbin-table-source.d.ts.map +0 -1
  448. package/typed/sources/raster-source.d.ts.map +0 -1
  449. package/typed/sources/types.d.ts.map +0 -1
  450. package/typed/sources/vector-query-source.d.ts +0 -4
  451. package/typed/sources/vector-query-source.d.ts.map +0 -1
  452. package/typed/sources/vector-table-source.d.ts +0 -4
  453. package/typed/sources/vector-table-source.d.ts.map +0 -1
  454. package/typed/style/color-bins-style.d.ts.map +0 -1
  455. package/typed/style/color-categories-style.d.ts.map +0 -1
  456. package/typed/style/color-continuous-style.d.ts.map +0 -1
  457. package/typed/utils.d.ts.map +0 -1
  458. /package/{typed → dist}/api/fetch-map.d.ts +0 -0
  459. /package/{typed → dist}/api/parse-map.d.ts +0 -0
  460. /package/{typed → dist}/api/parse-map.d.ts.map +0 -0
  461. /package/{typed → dist}/basemap.d.ts +0 -0
  462. /package/{typed → dist}/basemap.d.ts.map +0 -0
  463. /package/{typed → dist}/layers/h3-tileset-2d.d.ts +0 -0
  464. /package/{typed → dist}/layers/h3-tileset-2d.d.ts.map +0 -0
  465. /package/{typed → dist}/layers/point-label-layer.d.ts +0 -0
  466. /package/{typed → dist}/layers/point-label-layer.d.ts.map +0 -0
  467. /package/{typed → dist}/layers/quadbin-layer.d.ts +0 -0
  468. /package/{typed → dist}/layers/quadbin-layer.d.ts.map +0 -0
  469. /package/{typed → dist}/layers/quadbin-tileset-2d.d.ts +0 -0
  470. /package/{typed → dist}/layers/quadbin-tileset-2d.d.ts.map +0 -0
  471. /package/{typed → dist}/layers/quadbin-utils.d.ts +0 -0
  472. /package/{typed → dist}/layers/quadbin-utils.d.ts.map +0 -0
  473. /package/{typed → dist}/layers/raster-layer-vertex.glsl.d.ts.map +0 -0
  474. /package/{typed → dist}/layers/raster-layer.d.ts +0 -0
  475. /package/{typed → dist}/layers/schema/carto-properties-tile-loader.d.ts +0 -0
  476. /package/{typed → dist}/layers/schema/carto-properties-tile-loader.d.ts.map +0 -0
  477. /package/{typed → dist}/layers/schema/carto-raster-tile.d.ts +0 -0
  478. /package/{typed → dist}/layers/schema/carto-spatial-tile-loader.d.ts +0 -0
  479. /package/{typed → dist}/layers/schema/carto-spatial-tile-loader.d.ts.map +0 -0
  480. /package/{typed → dist}/layers/schema/carto-tile.d.ts +0 -0
  481. /package/{typed → dist}/layers/schema/carto-tile.d.ts.map +0 -0
  482. /package/{typed → dist}/layers/schema/carto-vector-tile-loader.d.ts +0 -0
  483. /package/{typed → dist}/layers/schema/carto-vector-tile-loader.d.ts.map +0 -0
  484. /package/{typed → dist}/layers/schema/fast-pbf.d.ts +0 -0
  485. /package/{typed → dist}/layers/schema/fast-pbf.d.ts.map +0 -0
  486. /package/{typed → dist}/layers/schema/spatialjson-utils.d.ts +0 -0
  487. /package/{typed → dist}/layers/schema/spatialjson-utils.d.ts.map +0 -0
  488. /package/{typed → dist}/layers/schema/tile-loader-utils.d.ts +0 -0
  489. /package/{typed → dist}/layers/schema/tile-loader-utils.d.ts.map +0 -0
  490. /package/{typed → dist}/style/palette.d.ts +0 -0
  491. /package/{typed → dist}/style/palette.d.ts.map +0 -0
  492. /package/{typed → dist}/style/utils.d.ts +0 -0
  493. /package/{typed → dist}/style/utils.d.ts.map +0 -0
  494. /package/{typed → dist}/workers/cartoRasterTile.d.ts +0 -0
  495. /package/{typed → dist}/workers/cartoRasterTile.d.ts.map +0 -0
  496. /package/{typed → dist}/workers/cartoSpatialTile.d.ts +0 -0
  497. /package/{typed → dist}/workers/cartoSpatialTile.d.ts.map +0 -0
  498. /package/{typed → dist}/workers/cartoVectorTile.d.ts +0 -0
  499. /package/{typed → dist}/workers/cartoVectorTile.d.ts.map +0 -0
@@ -1,14 +1,18 @@
1
- import {QueryParameters} from '../api';
1
+ import {QueryParameters} from '../api/index';
2
2
  import {baseSource} from './base-source';
3
- import type {SourceOptions, TilejsonResult} from './types';
3
+ import type {FilterOptions, SourceOptions, TilejsonResult} from './types';
4
4
 
5
- export type BoundaryQuerySourceOptions = SourceOptions & {
6
- tilesetTableName: string;
7
- matchingColumn?: string;
8
- propertiesSqlQuery: string;
9
- queryParameters?: QueryParameters;
10
- };
5
+ export type BoundaryQuerySourceOptions = SourceOptions &
6
+ FilterOptions & {
7
+ columns?: string[];
8
+ tilesetTableName: string;
9
+ matchingColumn?: string;
10
+ propertiesSqlQuery: string;
11
+ queryParameters?: QueryParameters;
12
+ };
11
13
  type UrlParameters = {
14
+ columns?: string;
15
+ filters?: string;
12
16
  tilesetTableName: string;
13
17
  matchingColumn: string;
14
18
  propertiesSqlQuery: string;
@@ -18,12 +22,26 @@ type UrlParameters = {
18
22
  export const boundaryQuerySource = async function (
19
23
  options: BoundaryQuerySourceOptions
20
24
  ): Promise<TilejsonResult> {
21
- const {tilesetTableName, matchingColumn = 'id', propertiesSqlQuery, queryParameters} = options;
25
+ const {
26
+ columns,
27
+ filters,
28
+ tilesetTableName,
29
+ matchingColumn = 'id',
30
+ propertiesSqlQuery,
31
+ queryParameters
32
+ } = options;
22
33
  const urlParameters: UrlParameters = {
23
34
  tilesetTableName,
24
35
  matchingColumn,
25
36
  propertiesSqlQuery
26
37
  };
38
+
39
+ if (columns) {
40
+ urlParameters.columns = columns.join(',');
41
+ }
42
+ if (filters) {
43
+ urlParameters.filters = JSON.stringify(filters);
44
+ }
27
45
  if (queryParameters) {
28
46
  urlParameters.queryParameters = JSON.stringify(queryParameters);
29
47
  }
@@ -1,13 +1,15 @@
1
1
  import {baseSource} from './base-source';
2
- import type {SourceOptions, TilejsonResult} from './types';
2
+ import type {FilterOptions, SourceOptions, TilejsonResult} from './types';
3
3
 
4
- export type BoundaryTableSourceOptions = SourceOptions & {
5
- tilesetTableName: string;
6
- columns?: string[];
7
- matchingColumn?: string;
8
- propertiesTableName: string;
9
- };
4
+ export type BoundaryTableSourceOptions = SourceOptions &
5
+ FilterOptions & {
6
+ tilesetTableName: string;
7
+ columns?: string[];
8
+ matchingColumn?: string;
9
+ propertiesTableName: string;
10
+ };
10
11
  type UrlParameters = {
12
+ filters?: string;
11
13
  tilesetTableName: string;
12
14
  columns?: string;
13
15
  matchingColumn: string;
@@ -17,7 +19,7 @@ type UrlParameters = {
17
19
  export const boundaryTableSource = async function (
18
20
  options: BoundaryTableSourceOptions
19
21
  ): Promise<TilejsonResult> {
20
- const {tilesetTableName, columns, matchingColumn = 'id', propertiesTableName} = options;
22
+ const {filters, tilesetTableName, columns, matchingColumn = 'id', propertiesTableName} = options;
21
23
  const urlParameters: UrlParameters = {
22
24
  tilesetTableName,
23
25
  matchingColumn,
@@ -27,5 +29,8 @@ export const boundaryTableSource = async function (
27
29
  if (columns) {
28
30
  urlParameters.columns = columns.join(',');
29
31
  }
32
+ if (filters) {
33
+ urlParameters.filters = JSON.stringify(filters);
34
+ }
30
35
  return baseSource<UrlParameters>('boundary', options, urlParameters) as Promise<TilejsonResult>;
31
36
  };
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable camelcase */
2
+ import {DEFAULT_AGGREGATION_RES_LEVEL_H3} from '../constants';
2
3
  import {baseSource} from './base-source';
3
4
  import type {
4
5
  AggregationOptions,
@@ -23,7 +24,7 @@ export const h3QuerySource = async function (
23
24
  ): Promise<TilejsonResult> {
24
25
  const {
25
26
  aggregationExp,
26
- aggregationResLevel = 4,
27
+ aggregationResLevel = DEFAULT_AGGREGATION_RES_LEVEL_H3,
27
28
  sqlQuery,
28
29
  spatialDataColumn = 'h3',
29
30
  queryParameters
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable camelcase */
2
+ import {DEFAULT_AGGREGATION_RES_LEVEL_H3} from '../constants';
2
3
  import {baseSource} from './base-source';
3
4
  import type {
4
5
  AggregationOptions,
@@ -13,7 +14,6 @@ export type H3TableSourceOptions = SourceOptions & TableSourceOptions & Aggregat
13
14
  type UrlParameters = {
14
15
  aggregationExp: string;
15
16
  aggregationResLevel?: string;
16
- columns?: string;
17
17
  spatialDataType: SpatialDataType;
18
18
  spatialDataColumn?: string;
19
19
  name: string;
@@ -24,8 +24,7 @@ export const h3TableSource = async function (
24
24
  ): Promise<TilejsonResult> {
25
25
  const {
26
26
  aggregationExp,
27
- aggregationResLevel = 4,
28
- columns,
27
+ aggregationResLevel = DEFAULT_AGGREGATION_RES_LEVEL_H3,
29
28
  spatialDataColumn = 'h3',
30
29
  tableName
31
30
  } = options;
@@ -39,8 +38,5 @@ export const h3TableSource = async function (
39
38
  if (aggregationResLevel) {
40
39
  urlParameters.aggregationResLevel = String(aggregationResLevel);
41
40
  }
42
- if (columns) {
43
- urlParameters.columns = columns.join(',');
44
- }
45
41
  return baseSource<UrlParameters>('table', options, urlParameters) as Promise<TilejsonResult>;
46
42
  };
@@ -36,3 +36,10 @@ export type {VectorTableSourceOptions} from './vector-table-source';
36
36
 
37
37
  export {vectorTilesetSource} from './vector-tileset-source';
38
38
  export type {VectorTilesetSourceOptions} from './vector-tileset-source';
39
+
40
+ export type {
41
+ SourceOptions,
42
+ QuerySourceOptions,
43
+ TableSourceOptions,
44
+ TilesetSourceOptions
45
+ } from './types';
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable camelcase */
2
+ import {DEFAULT_AGGREGATION_RES_LEVEL_QUADBIN} from '../constants';
2
3
  import {baseSource} from './base-source';
3
4
  import type {
4
5
  AggregationOptions,
@@ -24,7 +25,7 @@ export const quadbinQuerySource = async function (
24
25
  ): Promise<TilejsonResult> {
25
26
  const {
26
27
  aggregationExp,
27
- aggregationResLevel = 6,
28
+ aggregationResLevel = DEFAULT_AGGREGATION_RES_LEVEL_QUADBIN,
28
29
  sqlQuery,
29
30
  spatialDataColumn = 'quadbin',
30
31
  queryParameters
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable camelcase */
2
+ import {DEFAULT_AGGREGATION_RES_LEVEL_QUADBIN} from '../constants';
2
3
  import {baseSource} from './base-source';
3
4
  import type {
4
5
  AggregationOptions,
@@ -13,7 +14,6 @@ export type QuadbinTableSourceOptions = SourceOptions & TableSourceOptions & Agg
13
14
  type UrlParameters = {
14
15
  aggregationExp: string;
15
16
  aggregationResLevel?: string;
16
- columns?: string;
17
17
  spatialDataType: SpatialDataType;
18
18
  spatialDataColumn?: string;
19
19
  name: string;
@@ -24,8 +24,7 @@ export const quadbinTableSource = async function (
24
24
  ): Promise<TilejsonResult> {
25
25
  const {
26
26
  aggregationExp,
27
- aggregationResLevel = 6,
28
- columns,
27
+ aggregationResLevel = DEFAULT_AGGREGATION_RES_LEVEL_QUADBIN,
29
28
  spatialDataColumn = 'quadbin',
30
29
  tableName
31
30
  } = options;
@@ -40,8 +39,5 @@ export const quadbinTableSource = async function (
40
39
  if (aggregationResLevel) {
41
40
  urlParameters.aggregationResLevel = String(aggregationResLevel);
42
41
  }
43
- if (columns) {
44
- urlParameters.columns = columns.join(',');
45
- }
46
42
  return baseSource<UrlParameters>('table', options, urlParameters) as Promise<TilejsonResult>;
47
43
  };
@@ -1,5 +1,5 @@
1
1
  import type {Feature} from 'geojson';
2
- import type {Format, MapInstantiation, QueryParameters} from '../api/types';
2
+ import type {Filters, Format, MapInstantiation, QueryParameters} from '../api/types';
3
3
 
4
4
  export type SourceRequiredOptions = {
5
5
  /** Carto platform access token. */
@@ -57,6 +57,13 @@ export type AggregationOptions = {
57
57
  aggregationResLevel?: number;
58
58
  };
59
59
 
60
+ export type FilterOptions = {
61
+ /**
62
+ * Filters to apply to the data source on the server
63
+ */
64
+ filters?: Filters;
65
+ };
66
+
60
67
  export type QuerySourceOptions = {
61
68
  /**
62
69
  * The column name and the type of geospatial support.
@@ -68,6 +75,21 @@ export type QuerySourceOptions = {
68
75
  /** SQL query. */
69
76
  sqlQuery: string;
70
77
 
78
+ /**
79
+ * Relative resolution of a tile. Higher values increase density and data size. At `tileResolution = 1`, tile geometry is
80
+ * quantized to a 1024x1024 grid. Increasing or decreasing the resolution will increase or decrease the dimensions of
81
+ * the quantization grid proportionately.
82
+ *
83
+ * Supported `tileResolution` values, with corresponding grid sizes:
84
+ *
85
+ * - 0.25: 256x256
86
+ * - 0.5: 512x512
87
+ * - 1: 1024x1024
88
+ * - 2: 2048x2048
89
+ * - 4: 4096x4096
90
+ */
91
+ tileResolution?: TileResolution;
92
+
71
93
  /**
72
94
  * Values for named or positional paramteres in the query.
73
95
  *
@@ -102,18 +124,26 @@ export type TableSourceOptions = {
102
124
  tableName: string;
103
125
 
104
126
  /**
105
- * Columns to retrieve from the table.
127
+ * The column name and the type of geospatial support.
106
128
  *
107
- * If not present, all columns are returned.
129
+ * If not present, defaults to `'geom'` for generic tables, `'quadbin'` for Quadbin sources and `'h3'` for H3 sources.
108
130
  */
109
- columns?: string[];
131
+ spatialDataColumn?: string;
110
132
 
111
133
  /**
112
- * The column name and the type of geospatial support.
134
+ * Relative resolution of a tile. Higher values increase density and data size. At `tileResolution = 1`, tile geometry is
135
+ * quantized to a 1024x1024 grid. Increasing or decreasing the resolution will increase or decrease the dimensions of
136
+ * the quantization grid proportionately.
113
137
  *
114
- * If not present, defaults to `'geom'` for generic tables, `'quadbin'` for Quadbin sources and `'h3'` for H3 sources.
138
+ * Supported `tileResolution` values, with corresponding grid sizes:
139
+ *
140
+ * - 0.25: 256x256
141
+ * - 0.5: 512x512
142
+ * - 1: 1024x1024
143
+ * - 2: 2048x2048
144
+ * - 4: 4096x4096
115
145
  */
116
- spatialDataColumn?: string;
146
+ tileResolution?: TileResolution;
117
147
  };
118
148
 
119
149
  export type TilesetSourceOptions = {
@@ -123,12 +153,23 @@ export type TilesetSourceOptions = {
123
153
  tableName: string;
124
154
  };
125
155
 
156
+ export type ColumnsOption = {
157
+ /**
158
+ * Columns to retrieve from the table.
159
+ *
160
+ * If not present, all columns are returned.
161
+ */
162
+ columns?: string[];
163
+ };
164
+
126
165
  export type SpatialDataType = 'geo' | 'h3' | 'quadbin';
127
166
 
128
167
  export type TilejsonMapInstantiation = MapInstantiation & {
129
168
  tilejson: {url: string[]};
130
169
  };
131
170
 
171
+ export type TileResolution = 0.25 | 0.5 | 1 | 2 | 4;
172
+
132
173
  export interface Tilejson {
133
174
  tilejson: string;
134
175
  name: string;
@@ -146,6 +187,7 @@ export interface Tilejson {
146
187
  center: [number, number, number];
147
188
  vector_layers: VectorLayer[];
148
189
  tilestats: Tilestats;
190
+ tileResolution?: TileResolution;
149
191
  }
150
192
 
151
193
  export interface Tilestats {
@@ -1,11 +1,26 @@
1
1
  /* eslint-disable camelcase */
2
+ import {DEFAULT_TILE_RESOLUTION} from '../constants';
2
3
  import {baseSource} from './base-source';
3
- import type {SourceOptions, QuerySourceOptions, SpatialDataType, TilejsonResult} from './types';
4
+ import type {
5
+ FilterOptions,
6
+ SourceOptions,
7
+ QuerySourceOptions,
8
+ SpatialDataType,
9
+ TilejsonResult,
10
+ ColumnsOption
11
+ } from './types';
12
+
13
+ export type VectorQuerySourceOptions = SourceOptions &
14
+ QuerySourceOptions &
15
+ FilterOptions &
16
+ ColumnsOption;
4
17
 
5
- export type VectorQuerySourceOptions = SourceOptions & QuerySourceOptions;
6
18
  type UrlParameters = {
19
+ columns?: string;
20
+ filters?: string;
7
21
  spatialDataType: SpatialDataType;
8
22
  spatialDataColumn?: string;
23
+ tileResolution?: string;
9
24
  q: string;
10
25
  queryParameters?: string;
11
26
  };
@@ -13,9 +28,28 @@ type UrlParameters = {
13
28
  export const vectorQuerySource = async function (
14
29
  options: VectorQuerySourceOptions
15
30
  ): Promise<TilejsonResult> {
16
- const {spatialDataColumn = 'geom', sqlQuery, queryParameters} = options;
17
- const urlParameters: UrlParameters = {spatialDataColumn, spatialDataType: 'geo', q: sqlQuery};
31
+ const {
32
+ columns,
33
+ filters,
34
+ spatialDataColumn = 'geom',
35
+ sqlQuery,
36
+ tileResolution = DEFAULT_TILE_RESOLUTION,
37
+ queryParameters
38
+ } = options;
39
+
40
+ const urlParameters: UrlParameters = {
41
+ spatialDataColumn,
42
+ spatialDataType: 'geo',
43
+ tileResolution: tileResolution.toString(),
44
+ q: sqlQuery
45
+ };
18
46
 
47
+ if (columns) {
48
+ urlParameters.columns = columns.join(',');
49
+ }
50
+ if (filters) {
51
+ urlParameters.filters = JSON.stringify(filters);
52
+ }
19
53
  if (queryParameters) {
20
54
  urlParameters.queryParameters = JSON.stringify(queryParameters);
21
55
  }
@@ -1,23 +1,51 @@
1
1
  /* eslint-disable camelcase */
2
+ import {DEFAULT_TILE_RESOLUTION} from '../constants';
2
3
  import {baseSource} from './base-source';
3
- import type {SourceOptions, SpatialDataType, TableSourceOptions, TilejsonResult} from './types';
4
+ import type {
5
+ FilterOptions,
6
+ ColumnsOption,
7
+ SourceOptions,
8
+ SpatialDataType,
9
+ TableSourceOptions,
10
+ TilejsonResult
11
+ } from './types';
4
12
 
5
- export type VectorTableSourceOptions = SourceOptions & TableSourceOptions;
13
+ export type VectorTableSourceOptions = SourceOptions &
14
+ TableSourceOptions &
15
+ FilterOptions &
16
+ ColumnsOption;
6
17
  type UrlParameters = {
7
18
  columns?: string;
19
+ filters?: string;
8
20
  spatialDataType: SpatialDataType;
9
21
  spatialDataColumn?: string;
22
+ tileResolution?: string;
10
23
  name: string;
11
24
  };
12
25
 
13
26
  export const vectorTableSource = async function (
14
27
  options: VectorTableSourceOptions
15
28
  ): Promise<TilejsonResult> {
16
- const {columns, spatialDataColumn = 'geom', tableName} = options;
17
- const urlParameters: UrlParameters = {name: tableName, spatialDataColumn, spatialDataType: 'geo'};
29
+ const {
30
+ columns,
31
+ filters,
32
+ spatialDataColumn = 'geom',
33
+ tableName,
34
+ tileResolution = DEFAULT_TILE_RESOLUTION
35
+ } = options;
36
+
37
+ const urlParameters: UrlParameters = {
38
+ name: tableName,
39
+ spatialDataColumn,
40
+ spatialDataType: 'geo',
41
+ tileResolution: tileResolution.toString()
42
+ };
18
43
 
19
44
  if (columns) {
20
45
  urlParameters.columns = columns.join(',');
21
46
  }
47
+ if (filters) {
48
+ urlParameters.filters = JSON.stringify(filters);
49
+ }
22
50
  return baseSource<UrlParameters>('table', options, urlParameters) as Promise<TilejsonResult>;
23
51
  };
package/src/utils.ts CHANGED
@@ -51,7 +51,11 @@ export function scaleIdentity() {
51
51
  return unknown;
52
52
  };
53
53
 
54
- scale.copy = () => scaleIdentity().unknown(unknown);
54
+ scale.copy = () => {
55
+ const scaleCopy = scaleIdentity();
56
+ scaleCopy.unknown(unknown);
57
+ return scaleCopy;
58
+ };
55
59
 
56
60
  return scale;
57
61
  }
@@ -1,83 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.CartoAPIError = void 0;
9
-
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
-
14
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
15
-
16
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
17
-
18
- var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
19
-
20
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
21
-
22
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
23
-
24
- var CartoAPIError = function (_Error) {
25
- (0, _inherits2.default)(CartoAPIError, _Error);
26
-
27
- var _super = _createSuper(CartoAPIError);
28
-
29
- function CartoAPIError(error, errorContext, response) {
30
- var _this;
31
-
32
- (0, _classCallCheck2.default)(this, CartoAPIError);
33
- var responseString = 'Failed to connect';
34
-
35
- if (response) {
36
- responseString = 'Server returned: ';
37
-
38
- if (response.status === 400) {
39
- responseString += 'Bad request';
40
- } else if (response.status === 401 || response.status === 403) {
41
- responseString += 'Unauthorized access';
42
- } else if (response.status === 404) {
43
- responseString += 'Not found';
44
- } else {
45
- responseString += 'Error';
46
- }
47
-
48
- responseString += " (".concat(response.status, "):");
49
- }
50
-
51
- responseString += " ".concat(error.message || error);
52
- var message = "".concat(errorContext.requestType, " API request failed");
53
- message += "\n".concat(responseString);
54
-
55
- for (var _i = 0, _Object$keys = Object.keys(errorContext); _i < _Object$keys.length; _i++) {
56
- var key = _Object$keys[_i];
57
- if (key === 'requestType') continue;
58
- message += "\n".concat(formatErrorKey(key), ": ").concat(errorContext[key]);
59
- }
60
-
61
- message += '\n';
62
- _this = _super.call(this, message);
63
- _this.error = void 0;
64
- _this.errorContext = void 0;
65
- _this.response = void 0;
66
- _this.name = 'CartoAPIError';
67
- _this.response = response;
68
- _this.error = error;
69
- _this.errorContext = errorContext;
70
- return _this;
71
- }
72
-
73
- return CartoAPIError;
74
- }((0, _wrapNativeSuper2.default)(Error));
75
-
76
- exports.CartoAPIError = CartoAPIError;
77
-
78
- function formatErrorKey(key) {
79
- return key.replace(/([A-Z])/g, ' $1').replace(/^./, function (s) {
80
- return s.toUpperCase();
81
- });
82
- }
83
- //# sourceMappingURL=carto-api-error.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/api/carto-api-error.ts"],"names":["CartoAPIError","error","errorContext","response","responseString","status","message","requestType","Object","keys","key","formatErrorKey","name","Error","replace","s","toUpperCase"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;IAQaA,a;;;;;AAUX,yBAAYC,KAAZ,EAA0BC,YAA1B,EAAyDC,QAAzD,EAA8E;AAAA;;AAAA;AAC5E,QAAIC,cAAc,GAAG,mBAArB;;AACA,QAAID,QAAJ,EAAc;AACZC,MAAAA,cAAc,GAAG,mBAAjB;;AACA,UAAID,QAAQ,CAACE,MAAT,KAAoB,GAAxB,EAA6B;AAC3BD,QAAAA,cAAc,IAAI,aAAlB;AACD,OAFD,MAEO,IAAID,QAAQ,CAACE,MAAT,KAAoB,GAApB,IAA2BF,QAAQ,CAACE,MAAT,KAAoB,GAAnD,EAAwD;AAC7DD,QAAAA,cAAc,IAAI,qBAAlB;AACD,OAFM,MAEA,IAAID,QAAQ,CAACE,MAAT,KAAoB,GAAxB,EAA6B;AAClCD,QAAAA,cAAc,IAAI,WAAlB;AACD,OAFM,MAEA;AACLA,QAAAA,cAAc,IAAI,OAAlB;AACD;;AAEDA,MAAAA,cAAc,gBAASD,QAAQ,CAACE,MAAlB,OAAd;AACD;;AACDD,IAAAA,cAAc,eAAQH,KAAK,CAACK,OAAN,IAAiBL,KAAzB,CAAd;AAEA,QAAIK,OAAO,aAAMJ,YAAY,CAACK,WAAnB,wBAAX;AACAD,IAAAA,OAAO,gBAASF,cAAT,CAAP;;AACA,oCAAkBI,MAAM,CAACC,IAAP,CAAYP,YAAZ,CAAlB,kCAA6C;AAAxC,UAAMQ,GAAG,mBAAT;AACH,UAAIA,GAAG,KAAK,aAAZ,EAA2B;AAC3BJ,MAAAA,OAAO,gBAASK,cAAc,CAACD,GAAD,CAAvB,eAAiCR,YAAY,CAACQ,GAAD,CAA7C,CAAP;AACD;;AACDJ,IAAAA,OAAO,IAAI,IAAX;AAEA,8BAAMA,OAAN;AA1B4E,UAR9EL,KAQ8E;AAAA,UAL9EC,YAK8E;AAAA,UAF9EC,QAE8E;AA4B5E,UAAKS,IAAL,GAAY,eAAZ;AACA,UAAKT,QAAL,GAAgBA,QAAhB;AACA,UAAKF,KAAL,GAAaA,KAAb;AACA,UAAKC,YAAL,GAAoBA,YAApB;AA/B4E;AAgC7E;;;iCA1CgCW,K;;;;AAgDnC,SAASF,cAAT,CAAwBD,GAAxB,EAA6B;AAC3B,SAAOA,GAAG,CAACI,OAAJ,CAAY,UAAZ,EAAwB,KAAxB,EAA+BA,OAA/B,CAAuC,IAAvC,EAA6C,UAAAC,CAAC;AAAA,WAAIA,CAAC,CAACC,WAAF,EAAJ;AAAA,GAA9C,CAAP;AACD","sourcesContent":["import type {APIErrorContext} from './types';\n\n/**\n *\n * Custom error for reported errors in CARTO Maps API.\n * Provides useful debugging information in console and context for applications.\n *\n */\nexport class CartoAPIError extends Error {\n /** Source error from server */\n error: Error;\n\n /** Context (API call & parameters) in which error occured */\n errorContext: APIErrorContext;\n\n /** Response from server */\n response?: Response;\n\n constructor(error: Error, errorContext: APIErrorContext, response?: Response) {\n let responseString = 'Failed to connect';\n if (response) {\n responseString = 'Server returned: ';\n if (response.status === 400) {\n responseString += 'Bad request';\n } else if (response.status === 401 || response.status === 403) {\n responseString += 'Unauthorized access';\n } else if (response.status === 404) {\n responseString += 'Not found';\n } else {\n responseString += 'Error';\n }\n\n responseString += ` (${response.status}):`;\n }\n responseString += ` ${error.message || error}`;\n\n let message = `${errorContext.requestType} API request failed`;\n message += `\\n${responseString}`;\n for (const key of Object.keys(errorContext)) {\n if (key === 'requestType') continue; // eslint-disable-line no-continue\n message += `\\n${formatErrorKey(key)}: ${errorContext[key]}`;\n }\n message += '\\n';\n\n super(message);\n\n this.name = 'CartoAPIError';\n this.response = response;\n this.error = error;\n this.errorContext = errorContext;\n }\n}\n\n/**\n * Converts camelCase to Camel Case\n */\nfunction formatErrorKey(key) {\n return key.replace(/([A-Z])/g, ' $1').replace(/^./, s => s.toUpperCase());\n}\n"],"file":"carto-api-error.js"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DEFAULT_HEADERS = exports.DEFAULT_PARAMETERS = exports.MAX_GET_LENGTH = exports.V3_MINOR_VERSION = exports.DEFAULT_CLIENT = exports.DEFAULT_API_BASE_URL = void 0;
7
- var DEFAULT_API_BASE_URL = 'https://gcp-us-east1.api.carto.com';
8
- exports.DEFAULT_API_BASE_URL = DEFAULT_API_BASE_URL;
9
- var DEFAULT_CLIENT = 'deck-gl-carto';
10
- exports.DEFAULT_CLIENT = DEFAULT_CLIENT;
11
- var V3_MINOR_VERSION = '3.3';
12
- exports.V3_MINOR_VERSION = V3_MINOR_VERSION;
13
- var MAX_GET_LENGTH = 8192;
14
- exports.MAX_GET_LENGTH = MAX_GET_LENGTH;
15
- var DEFAULT_PARAMETERS = {
16
- client: DEFAULT_CLIENT,
17
- v: V3_MINOR_VERSION
18
- };
19
- exports.DEFAULT_PARAMETERS = DEFAULT_PARAMETERS;
20
- var DEFAULT_HEADERS = {
21
- Accept: 'application/json',
22
- 'Content-Type': 'application/json'
23
- };
24
- exports.DEFAULT_HEADERS = DEFAULT_HEADERS;
25
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/api/common.ts"],"names":["DEFAULT_API_BASE_URL","DEFAULT_CLIENT","V3_MINOR_VERSION","MAX_GET_LENGTH","DEFAULT_PARAMETERS","client","v","DEFAULT_HEADERS","Accept"],"mappings":";;;;;;AAAO,IAAMA,oBAAoB,GAAG,oCAA7B;;AACA,IAAMC,cAAc,GAAG,eAAvB;;AACA,IAAMC,gBAAgB,GAAG,KAAzB;;AACA,IAAMC,cAAc,GAAG,IAAvB;;AAEA,IAAMC,kBAAkB,GAAG;AAChCC,EAAAA,MAAM,EAAEJ,cADwB;AAEhCK,EAAAA,CAAC,EAAEJ;AAF6B,CAA3B;;AAKA,IAAMK,eAAe,GAAG;AAC7BC,EAAAA,MAAM,EAAE,kBADqB;AAE7B,kBAAgB;AAFa,CAAxB","sourcesContent":["export const DEFAULT_API_BASE_URL = 'https://gcp-us-east1.api.carto.com';\nexport const DEFAULT_CLIENT = 'deck-gl-carto';\nexport const V3_MINOR_VERSION = '3.3';\nexport const MAX_GET_LENGTH = 8192;\n\nexport const DEFAULT_PARAMETERS = {\n client: DEFAULT_CLIENT,\n v: V3_MINOR_VERSION\n};\n\nexport const DEFAULT_HEADERS = {\n Accept: 'application/json',\n 'Content-Type': 'application/json'\n};\n"],"file":"common.js"}
@@ -1,61 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.buildPublicMapUrl = buildPublicMapUrl;
7
- exports.buildStatsUrl = buildStatsUrl;
8
- exports.buildSourceUrl = buildSourceUrl;
9
- exports.buildQueryUrl = buildQueryUrl;
10
-
11
- function joinPath() {
12
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
13
- args[_key] = arguments[_key];
14
- }
15
-
16
- return args.map(function (part) {
17
- return part.endsWith('/') ? part.slice(0, -1) : part;
18
- }).join('/');
19
- }
20
-
21
- function buildV3Path(apiBaseUrl, version, endpoint) {
22
- for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
23
- rest[_key2 - 3] = arguments[_key2];
24
- }
25
-
26
- return joinPath.apply(void 0, [apiBaseUrl, version, endpoint].concat(rest));
27
- }
28
-
29
- function buildPublicMapUrl(_ref) {
30
- var apiBaseUrl = _ref.apiBaseUrl,
31
- cartoMapId = _ref.cartoMapId;
32
- return buildV3Path(apiBaseUrl, 'v3', 'maps', 'public', cartoMapId);
33
- }
34
-
35
- function buildStatsUrl(_ref2) {
36
- var attribute = _ref2.attribute,
37
- apiBaseUrl = _ref2.apiBaseUrl,
38
- connectionName = _ref2.connectionName,
39
- source = _ref2.source,
40
- type = _ref2.type;
41
-
42
- if (type === 'query') {
43
- return buildV3Path(apiBaseUrl, 'v3', 'stats', connectionName, attribute);
44
- }
45
-
46
- return buildV3Path(apiBaseUrl, 'v3', 'stats', connectionName, source, attribute);
47
- }
48
-
49
- function buildSourceUrl(_ref3) {
50
- var apiBaseUrl = _ref3.apiBaseUrl,
51
- connectionName = _ref3.connectionName,
52
- endpoint = _ref3.endpoint;
53
- return buildV3Path(apiBaseUrl, 'v3', 'maps', connectionName, endpoint);
54
- }
55
-
56
- function buildQueryUrl(_ref4) {
57
- var apiBaseUrl = _ref4.apiBaseUrl,
58
- connectionName = _ref4.connectionName;
59
- return buildV3Path(apiBaseUrl, 'v3', 'sql', connectionName, 'query');
60
- }
61
- //# sourceMappingURL=endpoints.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/api/endpoints.ts"],"names":["joinPath","args","map","part","endsWith","slice","join","buildV3Path","apiBaseUrl","version","endpoint","rest","buildPublicMapUrl","cartoMapId","buildStatsUrl","attribute","connectionName","source","type","buildSourceUrl","buildQueryUrl"],"mappings":";;;;;;;;;;AAIA,SAASA,QAAT,GAA6C;AAAA,oCAAxBC,IAAwB;AAAxBA,IAAAA,IAAwB;AAAA;;AAC3C,SAAOA,IAAI,CAACC,GAAL,CAAS,UAAAC,IAAI;AAAA,WAAKA,IAAI,CAACC,QAAL,CAAc,GAAd,IAAqBD,IAAI,CAACE,KAAL,CAAW,CAAX,EAAc,CAAC,CAAf,CAArB,GAAyCF,IAA9C;AAAA,GAAb,EAAkEG,IAAlE,CAAuE,GAAvE,CAAP;AACD;;AAED,SAASC,WAAT,CACEC,UADF,EAEEC,OAFF,EAGEC,QAHF,EAKU;AAAA,qCADLC,IACK;AADLA,IAAAA,IACK;AAAA;;AACR,SAAOX,QAAQ,MAAR,UAASQ,UAAT,EAAqBC,OAArB,EAA8BC,QAA9B,SAA2CC,IAA3C,EAAP;AACD;;AAEM,SAASC,iBAAT,OAMI;AAAA,MALTJ,UAKS,QALTA,UAKS;AAAA,MAJTK,UAIS,QAJTA,UAIS;AACT,SAAON,WAAW,CAACC,UAAD,EAAa,IAAb,EAAmB,MAAnB,EAA2B,QAA3B,EAAqCK,UAArC,CAAlB;AACD;;AAEM,SAASC,aAAT,QAYI;AAAA,MAXTC,SAWS,SAXTA,SAWS;AAAA,MAVTP,UAUS,SAVTA,UAUS;AAAA,MATTQ,cASS,SATTA,cASS;AAAA,MARTC,MAQS,SARTA,MAQS;AAAA,MAPTC,IAOS,SAPTA,IAOS;;AACT,MAAIA,IAAI,KAAK,OAAb,EAAsB;AACpB,WAAOX,WAAW,CAACC,UAAD,EAAa,IAAb,EAAmB,OAAnB,EAA4BQ,cAA5B,EAA4CD,SAA5C,CAAlB;AACD;;AAGD,SAAOR,WAAW,CAACC,UAAD,EAAa,IAAb,EAAmB,OAAnB,EAA4BQ,cAA5B,EAA4CC,MAA5C,EAAoDF,SAApD,CAAlB;AACD;;AAEM,SAASI,cAAT,QAQI;AAAA,MAPTX,UAOS,SAPTA,UAOS;AAAA,MANTQ,cAMS,SANTA,cAMS;AAAA,MALTN,QAKS,SALTA,QAKS;AACT,SAAOH,WAAW,CAACC,UAAD,EAAa,IAAb,EAAmB,MAAnB,EAA2BQ,cAA3B,EAA2CN,QAA3C,CAAlB;AACD;;AAEM,SAASU,aAAT,QAMI;AAAA,MALTZ,UAKS,SALTA,UAKS;AAAA,MAJTQ,cAIS,SAJTA,cAIS;AACT,SAAOT,WAAW,CAACC,UAAD,EAAa,IAAb,EAAmB,KAAnB,EAA0BQ,cAA1B,EAA0C,OAA1C,CAAlB;AACD","sourcesContent":["import {MapType} from './types';\n\nexport type V3Endpoint = 'maps' | 'stats' | 'sql';\n\nfunction joinPath(...args: string[]): string {\n return args.map(part => (part.endsWith('/') ? part.slice(0, -1) : part)).join('/');\n}\n\nfunction buildV3Path(\n apiBaseUrl: string,\n version: 'v3',\n endpoint: V3Endpoint,\n ...rest: string[]\n): string {\n return joinPath(apiBaseUrl, version, endpoint, ...rest);\n}\n\nexport function buildPublicMapUrl({\n apiBaseUrl,\n cartoMapId\n}: {\n apiBaseUrl: string;\n cartoMapId: string;\n}): string {\n return buildV3Path(apiBaseUrl, 'v3', 'maps', 'public', cartoMapId);\n}\n\nexport function buildStatsUrl({\n attribute,\n apiBaseUrl,\n connectionName,\n source,\n type\n}: {\n attribute: string;\n apiBaseUrl: string;\n connectionName: string;\n source: string;\n type: MapType;\n}): string {\n if (type === 'query') {\n return buildV3Path(apiBaseUrl, 'v3', 'stats', connectionName, attribute);\n }\n\n // type === 'table'\n return buildV3Path(apiBaseUrl, 'v3', 'stats', connectionName, source, attribute);\n}\n\nexport function buildSourceUrl({\n apiBaseUrl,\n connectionName,\n endpoint\n}: {\n apiBaseUrl: string;\n connectionName: string;\n endpoint: MapType;\n}): string {\n return buildV3Path(apiBaseUrl, 'v3', 'maps', connectionName, endpoint);\n}\n\nexport function buildQueryUrl({\n apiBaseUrl,\n connectionName\n}: {\n apiBaseUrl: string;\n connectionName: string;\n}): string {\n return buildV3Path(apiBaseUrl, 'v3', 'sql', connectionName, 'query');\n}\n"],"file":"endpoints.js"}