@deck.gl/carto 8.10.0-alpha.6 → 9.0.0-alpha.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 (365) hide show
  1. package/dist/cartoRasterTile-worker.js +38 -30
  2. package/dist/cartoSpatialTile-worker.js +38 -30
  3. package/dist/cartoVectorTile-worker.js +75 -69
  4. package/dist/dist.dev.js +14001 -14522
  5. package/dist/es5/api/carto-api-error.js.map +1 -1
  6. package/dist/es5/api/common.js +25 -0
  7. package/dist/es5/api/common.js.map +1 -0
  8. package/dist/es5/api/endpoints.js +40 -0
  9. package/dist/es5/api/endpoints.js.map +1 -0
  10. package/dist/es5/api/fetch-map.js +560 -0
  11. package/dist/es5/api/fetch-map.js.map +1 -0
  12. package/dist/es5/api/index.js +5 -49
  13. package/dist/es5/api/index.js.map +1 -1
  14. package/dist/es5/api/layer-map.js +43 -45
  15. package/dist/es5/api/layer-map.js.map +1 -1
  16. package/dist/es5/api/{parseMap.js → parse-map.js} +5 -3
  17. package/dist/es5/api/parse-map.js.map +1 -0
  18. package/dist/es5/api/query.js +78 -0
  19. package/dist/es5/api/query.js.map +1 -0
  20. package/dist/es5/{sources/utils.js → api/request-with-parameters.js} +60 -46
  21. package/dist/es5/api/request-with-parameters.js.map +1 -0
  22. package/dist/es5/api/types.js +19 -0
  23. package/dist/es5/api/types.js.map +1 -1
  24. package/dist/es5/index.js +66 -80
  25. package/dist/es5/index.js.map +1 -1
  26. package/dist/es5/layers/h3-tile-layer.js +3 -5
  27. package/dist/es5/layers/h3-tile-layer.js.map +1 -1
  28. package/dist/es5/layers/point-label-layer.js.map +1 -1
  29. package/dist/es5/layers/quadbin-layer.js.map +1 -1
  30. package/dist/es5/layers/quadbin-tile-layer.js +1 -4
  31. package/dist/es5/layers/quadbin-tile-layer.js.map +1 -1
  32. package/dist/es5/layers/raster-layer.js +2 -0
  33. package/dist/es5/layers/raster-layer.js.map +1 -1
  34. package/dist/es5/layers/raster-tile-layer.js +1 -3
  35. package/dist/es5/layers/raster-tile-layer.js.map +1 -1
  36. package/dist/es5/layers/schema/carto-properties-tile-loader.js +60 -0
  37. package/dist/es5/layers/schema/carto-properties-tile-loader.js.map +1 -0
  38. package/dist/es5/layers/schema/carto-properties-tile.js +38 -0
  39. package/dist/es5/layers/schema/carto-properties-tile.js.map +1 -0
  40. package/dist/es5/layers/schema/carto-raster-tile-loader.js +1 -1
  41. package/dist/es5/layers/schema/carto-raster-tile-loader.js.map +1 -1
  42. package/dist/es5/layers/schema/carto-spatial-tile-loader.js +1 -1
  43. package/dist/es5/layers/schema/carto-spatial-tile-loader.js.map +1 -1
  44. package/dist/es5/layers/schema/carto-vector-tile-loader.js +1 -2
  45. package/dist/es5/layers/schema/carto-vector-tile-loader.js.map +1 -1
  46. package/dist/es5/layers/spatial-index-tile-layer.js +16 -26
  47. package/dist/es5/layers/spatial-index-tile-layer.js.map +1 -1
  48. package/dist/es5/layers/utils.js +102 -0
  49. package/dist/es5/layers/utils.js.map +1 -1
  50. package/dist/es5/layers/vector-tile-layer.js +112 -27
  51. package/dist/es5/layers/vector-tile-layer.js.map +1 -1
  52. package/dist/es5/sources/base-source.js +56 -28
  53. package/dist/es5/sources/base-source.js.map +1 -1
  54. package/dist/es5/sources/boundary-query-source.js +51 -0
  55. package/dist/es5/sources/boundary-query-source.js.map +1 -0
  56. package/dist/es5/sources/boundary-table-source.js +51 -0
  57. package/dist/es5/sources/boundary-table-source.js.map +1 -0
  58. package/dist/es5/sources/boundary-tileset-source.js +43 -0
  59. package/dist/es5/sources/boundary-tileset-source.js.map +1 -0
  60. package/dist/es5/sources/h3-query-source.js +9 -11
  61. package/dist/es5/sources/h3-query-source.js.map +1 -1
  62. package/dist/es5/sources/h3-table-source.js +10 -12
  63. package/dist/es5/sources/h3-table-source.js.map +1 -1
  64. package/dist/es5/sources/h3-tileset-source.js +5 -5
  65. package/dist/es5/sources/h3-tileset-source.js.map +1 -1
  66. package/dist/es5/sources/index.js +46 -22
  67. package/dist/es5/sources/index.js.map +1 -1
  68. package/dist/es5/sources/quadbin-query-source.js +10 -12
  69. package/dist/es5/sources/quadbin-query-source.js.map +1 -1
  70. package/dist/es5/sources/quadbin-table-source.js +10 -12
  71. package/dist/es5/sources/quadbin-table-source.js.map +1 -1
  72. package/dist/es5/sources/quadbin-tileset-source.js +5 -5
  73. package/dist/es5/sources/quadbin-tileset-source.js.map +1 -1
  74. package/dist/es5/sources/raster-source.js +5 -5
  75. package/dist/es5/sources/raster-source.js.map +1 -1
  76. package/dist/es5/sources/types.js +2 -0
  77. package/dist/es5/sources/types.js.map +1 -0
  78. package/dist/es5/sources/vector-query-source.js +11 -12
  79. package/dist/es5/sources/vector-query-source.js.map +1 -1
  80. package/dist/es5/sources/vector-table-source.js +12 -13
  81. package/dist/es5/sources/vector-table-source.js.map +1 -1
  82. package/dist/es5/sources/vector-tileset-source.js +5 -5
  83. package/dist/es5/sources/vector-tileset-source.js.map +1 -1
  84. package/dist/es5/style/color-bins-style.js +4 -2
  85. package/dist/es5/style/color-bins-style.js.map +1 -1
  86. package/dist/es5/style/color-categories-style.js +4 -2
  87. package/dist/es5/style/color-categories-style.js.map +1 -1
  88. package/dist/es5/style/color-continuous-style.js +4 -2
  89. package/dist/es5/style/color-continuous-style.js.map +1 -1
  90. package/dist/es5/style/palette.js +1 -1
  91. package/dist/es5/style/palette.js.map +1 -1
  92. package/dist/es5/style/utils.js +4 -11
  93. package/dist/es5/style/utils.js.map +1 -1
  94. package/dist/es5/utils.js +30 -1
  95. package/dist/es5/utils.js.map +1 -1
  96. package/dist/esm/api/carto-api-error.js.map +1 -1
  97. package/dist/esm/api/common.js +13 -0
  98. package/dist/esm/api/common.js.map +1 -0
  99. package/dist/esm/api/endpoints.js +28 -0
  100. package/dist/esm/api/endpoints.js.map +1 -0
  101. package/dist/esm/api/fetch-map.js +291 -0
  102. package/dist/esm/api/fetch-map.js.map +1 -0
  103. package/dist/esm/api/index.js +2 -3
  104. package/dist/esm/api/index.js.map +1 -1
  105. package/dist/esm/api/layer-map.js +43 -35
  106. package/dist/esm/api/layer-map.js.map +1 -1
  107. package/dist/esm/api/{parseMap.js → parse-map.js} +3 -2
  108. package/dist/esm/api/parse-map.js.map +1 -0
  109. package/dist/esm/api/query.js +38 -0
  110. package/dist/esm/api/query.js.map +1 -0
  111. package/dist/esm/{sources/utils.js → api/request-with-parameters.js} +25 -12
  112. package/dist/esm/api/request-with-parameters.js.map +1 -0
  113. package/dist/esm/api/types.js +13 -1
  114. package/dist/esm/api/types.js.map +1 -1
  115. package/dist/esm/index.js +31 -9
  116. package/dist/esm/index.js.map +1 -1
  117. package/dist/esm/layers/h3-tile-layer.js +2 -6
  118. package/dist/esm/layers/h3-tile-layer.js.map +1 -1
  119. package/dist/esm/layers/point-label-layer.js.map +1 -1
  120. package/dist/esm/layers/quadbin-layer.js.map +1 -1
  121. package/dist/esm/layers/quadbin-tile-layer.js +1 -3
  122. package/dist/esm/layers/quadbin-tile-layer.js.map +1 -1
  123. package/dist/esm/layers/raster-layer.js +1 -0
  124. package/dist/esm/layers/raster-layer.js.map +1 -1
  125. package/dist/esm/layers/raster-tile-layer.js +1 -2
  126. package/dist/esm/layers/raster-tile-layer.js.map +1 -1
  127. package/dist/esm/layers/schema/carto-properties-tile-loader.js +23 -0
  128. package/dist/esm/layers/schema/carto-properties-tile-loader.js.map +1 -0
  129. package/dist/esm/layers/schema/carto-properties-tile.js +18 -0
  130. package/dist/esm/layers/schema/carto-properties-tile.js.map +1 -0
  131. package/dist/esm/layers/schema/carto-raster-tile-loader.js +1 -1
  132. package/dist/esm/layers/schema/carto-raster-tile-loader.js.map +1 -1
  133. package/dist/esm/layers/schema/carto-spatial-tile-loader.js +1 -1
  134. package/dist/esm/layers/schema/carto-spatial-tile-loader.js.map +1 -1
  135. package/dist/esm/layers/schema/carto-vector-tile-loader.js +1 -2
  136. package/dist/esm/layers/schema/carto-vector-tile-loader.js.map +1 -1
  137. package/dist/esm/layers/spatial-index-tile-layer.js +9 -24
  138. package/dist/esm/layers/spatial-index-tile-layer.js.map +1 -1
  139. package/dist/esm/layers/utils.js +70 -0
  140. package/dist/esm/layers/utils.js.map +1 -1
  141. package/dist/esm/layers/vector-tile-layer.js +40 -12
  142. package/dist/esm/layers/vector-tile-layer.js.map +1 -1
  143. package/dist/esm/sources/base-source.js +33 -10
  144. package/dist/esm/sources/base-source.js.map +1 -1
  145. package/dist/esm/sources/boundary-query-source.js +21 -0
  146. package/dist/esm/sources/boundary-query-source.js.map +1 -0
  147. package/dist/esm/sources/boundary-table-source.js +21 -0
  148. package/dist/esm/sources/boundary-table-source.js.map +1 -0
  149. package/dist/esm/sources/boundary-tileset-source.js +11 -0
  150. package/dist/esm/sources/boundary-tileset-source.js.map +1 -0
  151. package/dist/esm/sources/h3-query-source.js +6 -11
  152. package/dist/esm/sources/h3-query-source.js.map +1 -1
  153. package/dist/esm/sources/h3-table-source.js +7 -12
  154. package/dist/esm/sources/h3-table-source.js.map +1 -1
  155. package/dist/esm/sources/h3-tileset-source.js +3 -6
  156. package/dist/esm/sources/h3-tileset-source.js.map +1 -1
  157. package/dist/esm/sources/index.js +14 -11
  158. package/dist/esm/sources/index.js.map +1 -1
  159. package/dist/esm/sources/quadbin-query-source.js +7 -12
  160. package/dist/esm/sources/quadbin-query-source.js.map +1 -1
  161. package/dist/esm/sources/quadbin-table-source.js +7 -12
  162. package/dist/esm/sources/quadbin-table-source.js.map +1 -1
  163. package/dist/esm/sources/quadbin-tileset-source.js +3 -6
  164. package/dist/esm/sources/quadbin-tileset-source.js.map +1 -1
  165. package/dist/esm/sources/raster-source.js +3 -6
  166. package/dist/esm/sources/raster-source.js.map +1 -1
  167. package/dist/esm/sources/types.js +2 -0
  168. package/dist/esm/sources/types.js.map +1 -0
  169. package/dist/esm/sources/vector-query-source.js +6 -11
  170. package/dist/esm/sources/vector-query-source.js.map +1 -1
  171. package/dist/esm/sources/vector-table-source.js +7 -12
  172. package/dist/esm/sources/vector-table-source.js.map +1 -1
  173. package/dist/esm/sources/vector-tileset-source.js +3 -6
  174. package/dist/esm/sources/vector-tileset-source.js.map +1 -1
  175. package/dist/esm/style/color-bins-style.js +2 -1
  176. package/dist/esm/style/color-bins-style.js.map +1 -1
  177. package/dist/esm/style/color-categories-style.js +2 -1
  178. package/dist/esm/style/color-categories-style.js.map +1 -1
  179. package/dist/esm/style/color-continuous-style.js +2 -1
  180. package/dist/esm/style/color-continuous-style.js.map +1 -1
  181. package/dist/esm/style/palette.js +1 -1
  182. package/dist/esm/style/palette.js.map +1 -1
  183. package/dist/esm/style/utils.js +1 -5
  184. package/dist/esm/style/utils.js.map +1 -1
  185. package/dist/esm/utils.js +24 -1
  186. package/dist/esm/utils.js.map +1 -1
  187. package/dist.min.js +42 -46
  188. package/package.json +11 -10
  189. package/src/.DS_Store +0 -0
  190. package/src/api/carto-api-error.ts +1 -9
  191. package/src/api/common.ts +14 -0
  192. package/src/api/endpoints.ts +38 -0
  193. package/src/api/fetch-map.ts +287 -0
  194. package/src/api/index.ts +5 -5
  195. package/src/api/layer-map.ts +40 -36
  196. package/src/api/{parseMap.ts → parse-map.ts} +2 -2
  197. package/src/api/query.ts +34 -0
  198. package/src/{sources/utils.ts → api/request-with-parameters.ts} +22 -17
  199. package/src/api/types.ts +49 -0
  200. package/src/index.ts +93 -41
  201. package/src/layers/h3-tile-layer.ts +13 -18
  202. package/src/layers/point-label-layer.ts +1 -1
  203. package/src/layers/quadbin-layer.ts +3 -2
  204. package/src/layers/quadbin-tile-layer.ts +10 -11
  205. package/src/layers/raster-layer.ts +2 -2
  206. package/src/layers/raster-tile-layer.ts +11 -9
  207. package/src/layers/schema/carto-properties-tile-loader.ts +25 -0
  208. package/src/layers/schema/carto-properties-tile.ts +21 -0
  209. package/src/layers/schema/carto-vector-tile-loader.ts +5 -5
  210. package/src/layers/spatial-index-tile-layer.ts +18 -26
  211. package/src/layers/utils.ts +71 -0
  212. package/src/layers/vector-tile-layer.ts +42 -23
  213. package/src/sources/base-source.ts +35 -18
  214. package/src/sources/boundary-query-source.ts +31 -0
  215. package/src/sources/boundary-table-source.ts +31 -0
  216. package/src/sources/boundary-tileset-source.ts +14 -0
  217. package/src/sources/h3-query-source.ts +22 -22
  218. package/src/sources/h3-table-source.ts +22 -22
  219. package/src/sources/h3-tileset-source.ts +7 -9
  220. package/src/sources/index.ts +31 -22
  221. package/src/sources/quadbin-query-source.ts +22 -22
  222. package/src/sources/quadbin-table-source.ts +23 -22
  223. package/src/sources/quadbin-tileset-source.ts +7 -9
  224. package/src/sources/raster-source.ts +5 -9
  225. package/src/sources/types.ts +98 -0
  226. package/src/sources/vector-query-source.ts +15 -15
  227. package/src/sources/vector-table-source.ts +15 -15
  228. package/src/sources/vector-tileset-source.ts +7 -9
  229. package/src/style/color-bins-style.ts +2 -1
  230. package/src/style/color-categories-style.ts +2 -1
  231. package/src/style/color-continuous-style.ts +2 -1
  232. package/src/style/palette.ts +1 -1
  233. package/src/style/utils.ts +1 -6
  234. package/src/utils.ts +25 -1
  235. package/typed/api/carto-api-error.d.ts +1 -8
  236. package/typed/api/carto-api-error.d.ts.map +1 -1
  237. package/typed/api/common.d.ts +13 -0
  238. package/typed/api/common.d.ts.map +1 -0
  239. package/typed/api/endpoints.d.ts +12 -0
  240. package/typed/api/endpoints.d.ts.map +1 -0
  241. package/typed/api/fetch-map.d.ts +22 -0
  242. package/typed/api/fetch-map.d.ts.map +1 -0
  243. package/typed/api/index.d.ts +5 -5
  244. package/typed/api/index.d.ts.map +1 -1
  245. package/typed/api/layer-map.d.ts +6 -9
  246. package/typed/api/layer-map.d.ts.map +1 -1
  247. package/typed/api/{parseMap.d.ts → parse-map.d.ts} +1 -1
  248. package/typed/api/parse-map.d.ts.map +1 -0
  249. package/typed/api/query.d.ts +4 -0
  250. package/typed/api/query.d.ts.map +1 -0
  251. package/typed/api/request-with-parameters.d.ts +9 -0
  252. package/typed/api/request-with-parameters.d.ts.map +1 -0
  253. package/typed/api/types.d.ts +40 -0
  254. package/typed/api/types.d.ts.map +1 -1
  255. package/typed/index.d.ts +33 -12
  256. package/typed/index.d.ts.map +1 -1
  257. package/typed/layers/h3-tile-layer.d.ts +12 -7
  258. package/typed/layers/h3-tile-layer.d.ts.map +1 -1
  259. package/typed/layers/point-label-layer.d.ts +2 -2
  260. package/typed/layers/point-label-layer.d.ts.map +1 -1
  261. package/typed/layers/quadbin-layer.d.ts +2 -2
  262. package/typed/layers/quadbin-layer.d.ts.map +1 -1
  263. package/typed/layers/quadbin-tile-layer.d.ts +6 -6
  264. package/typed/layers/quadbin-tile-layer.d.ts.map +1 -1
  265. package/typed/layers/raster-layer.d.ts +2 -2
  266. package/typed/layers/raster-layer.d.ts.map +1 -1
  267. package/typed/layers/raster-tile-layer.d.ts +6 -5
  268. package/typed/layers/raster-tile-layer.d.ts.map +1 -1
  269. package/typed/layers/schema/carto-properties-tile-loader.d.ts +4 -0
  270. package/typed/layers/schema/carto-properties-tile-loader.d.ts.map +1 -0
  271. package/typed/layers/schema/carto-properties-tile.d.ts +10 -0
  272. package/typed/layers/schema/carto-properties-tile.d.ts.map +1 -0
  273. package/typed/layers/spatial-index-tile-layer.d.ts +10 -9
  274. package/typed/layers/spatial-index-tile-layer.d.ts.map +1 -1
  275. package/typed/layers/utils.d.ts +11 -0
  276. package/typed/layers/utils.d.ts.map +1 -1
  277. package/typed/layers/vector-tile-layer.d.ts +6 -11
  278. package/typed/layers/vector-tile-layer.d.ts.map +1 -1
  279. package/typed/sources/base-source.d.ts +4 -3
  280. package/typed/sources/base-source.d.ts.map +1 -1
  281. package/typed/sources/boundary-query-source.d.ts +10 -0
  282. package/typed/sources/boundary-query-source.d.ts.map +1 -0
  283. package/typed/sources/boundary-table-source.d.ts +9 -0
  284. package/typed/sources/boundary-table-source.d.ts.map +1 -0
  285. package/typed/sources/boundary-tileset-source.d.ts +6 -0
  286. package/typed/sources/boundary-tileset-source.d.ts.map +1 -0
  287. package/typed/sources/h3-query-source.d.ts +3 -4
  288. package/typed/sources/h3-query-source.d.ts.map +1 -1
  289. package/typed/sources/h3-table-source.d.ts +3 -4
  290. package/typed/sources/h3-table-source.d.ts.map +1 -1
  291. package/typed/sources/h3-tileset-source.d.ts +3 -4
  292. package/typed/sources/h3-tileset-source.d.ts.map +1 -1
  293. package/typed/sources/index.d.ts +28 -22
  294. package/typed/sources/index.d.ts.map +1 -1
  295. package/typed/sources/quadbin-query-source.d.ts +3 -4
  296. package/typed/sources/quadbin-query-source.d.ts.map +1 -1
  297. package/typed/sources/quadbin-table-source.d.ts +3 -4
  298. package/typed/sources/quadbin-table-source.d.ts.map +1 -1
  299. package/typed/sources/quadbin-tileset-source.d.ts +3 -4
  300. package/typed/sources/quadbin-tileset-source.d.ts.map +1 -1
  301. package/typed/sources/raster-source.d.ts +3 -4
  302. package/typed/sources/raster-source.d.ts.map +1 -1
  303. package/typed/sources/{common.d.ts → types.d.ts} +26 -42
  304. package/typed/sources/types.d.ts.map +1 -0
  305. package/typed/sources/vector-query-source.d.ts +3 -4
  306. package/typed/sources/vector-query-source.d.ts.map +1 -1
  307. package/typed/sources/vector-table-source.d.ts +3 -4
  308. package/typed/sources/vector-table-source.d.ts.map +1 -1
  309. package/typed/sources/vector-tileset-source.d.ts +3 -4
  310. package/typed/sources/vector-tileset-source.d.ts.map +1 -1
  311. package/typed/style/color-bins-style.d.ts.map +1 -1
  312. package/typed/style/color-categories-style.d.ts.map +1 -1
  313. package/typed/style/color-continuous-style.d.ts.map +1 -1
  314. package/typed/style/utils.d.ts +0 -1
  315. package/typed/style/utils.d.ts.map +1 -1
  316. package/typed/utils.d.ts +8 -0
  317. package/typed/utils.d.ts.map +1 -1
  318. package/dist/es5/api/maps-api-common.js +0 -77
  319. package/dist/es5/api/maps-api-common.js.map +0 -1
  320. package/dist/es5/api/maps-client.js +0 -220
  321. package/dist/es5/api/maps-client.js.map +0 -1
  322. package/dist/es5/api/maps-v3-client.js +0 -959
  323. package/dist/es5/api/maps-v3-client.js.map +0 -1
  324. package/dist/es5/api/parseMap.js.map +0 -1
  325. package/dist/es5/config.js +0 -84
  326. package/dist/es5/config.js.map +0 -1
  327. package/dist/es5/layers/carto-layer.js +0 -329
  328. package/dist/es5/layers/carto-layer.js.map +0 -1
  329. package/dist/es5/sources/common.js +0 -48
  330. package/dist/es5/sources/common.js.map +0 -1
  331. package/dist/es5/sources/utils.js.map +0 -1
  332. package/dist/esm/api/maps-api-common.js +0 -54
  333. package/dist/esm/api/maps-api-common.js.map +0 -1
  334. package/dist/esm/api/maps-client.js +0 -148
  335. package/dist/esm/api/maps-client.js.map +0 -1
  336. package/dist/esm/api/maps-v3-client.js +0 -638
  337. package/dist/esm/api/maps-v3-client.js.map +0 -1
  338. package/dist/esm/api/parseMap.js.map +0 -1
  339. package/dist/esm/config.js +0 -60
  340. package/dist/esm/config.js.map +0 -1
  341. package/dist/esm/layers/carto-layer.js +0 -233
  342. package/dist/esm/layers/carto-layer.js.map +0 -1
  343. package/dist/esm/sources/common.js +0 -26
  344. package/dist/esm/sources/common.js.map +0 -1
  345. package/dist/esm/sources/utils.js.map +0 -1
  346. package/src/api/maps-api-common.ts +0 -95
  347. package/src/api/maps-client.ts +0 -196
  348. package/src/api/maps-v3-client.ts +0 -659
  349. package/src/config.ts +0 -70
  350. package/src/layers/carto-layer.ts +0 -340
  351. package/src/sources/common.ts +0 -132
  352. package/typed/api/maps-api-common.d.ts +0 -76
  353. package/typed/api/maps-api-common.d.ts.map +0 -1
  354. package/typed/api/maps-client.d.ts +0 -18
  355. package/typed/api/maps-client.d.ts.map +0 -1
  356. package/typed/api/maps-v3-client.d.ts +0 -49
  357. package/typed/api/maps-v3-client.d.ts.map +0 -1
  358. package/typed/api/parseMap.d.ts.map +0 -1
  359. package/typed/config.d.ts +0 -28
  360. package/typed/config.d.ts.map +0 -1
  361. package/typed/layers/carto-layer.d.ts +0 -126
  362. package/typed/layers/carto-layer.d.ts.map +0 -1
  363. package/typed/sources/common.d.ts.map +0 -1
  364. package/typed/sources/utils.d.ts +0 -15
  365. package/typed/sources/utils.d.ts.map +0 -1
@@ -1,5 +1,4 @@
1
- import { CartoAggregationOptions, CartoQuerySourceOptions, CartoSourceOptions, TilejsonSource } from './common';
2
- export declare type CartoQuadbinQuerySourceOptions = CartoSourceOptions & CartoQuerySourceOptions & CartoAggregationOptions;
3
- declare const cartoQuadbinQuerySource: TilejsonSource<CartoQuadbinQuerySourceOptions>;
4
- export { cartoQuadbinQuerySource };
1
+ import type { AggregationOptions, QuerySourceOptions, SourceOptions, TilejsonResult } from './types';
2
+ export declare type QuadbinQuerySourceOptions = SourceOptions & QuerySourceOptions & AggregationOptions;
3
+ export declare const quadbinQuerySource: (options: QuadbinQuerySourceOptions) => Promise<TilejsonResult>;
5
4
  //# sourceMappingURL=quadbin-query-source.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"quadbin-query-source.d.ts","sourceRoot":"","sources":["../../src/sources/quadbin-query-source.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,oBAAY,8BAA8B,GAAG,kBAAkB,GAC7D,uBAAuB,GACvB,uBAAuB,CAAC;AAU1B,QAAA,MAAM,uBAAuB,EAAE,cAAc,CAAC,8BAA8B,CAsB3E,CAAC;AAEF,OAAO,EAAC,uBAAuB,EAAC,CAAC"}
1
+ {"version":3,"file":"quadbin-query-source.d.ts","sourceRoot":"","sources":["../../src/sources/quadbin-query-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EAEb,cAAc,EACf,MAAM,SAAS,CAAC;AAEjB,oBAAY,yBAAyB,GAAG,aAAa,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAWhG,eAAO,MAAM,kBAAkB,YACpB,yBAAyB,KACjC,QAAQ,cAAc,CAsBxB,CAAC"}
@@ -1,5 +1,4 @@
1
- import { CartoAggregationOptions, CartoSourceOptions, CartoTableSourceOptions, TilejsonSource } from './common';
2
- export declare type CartoQuadbinTableSourceOptions = CartoSourceOptions & CartoTableSourceOptions & CartoAggregationOptions;
3
- declare const cartoQuadbinTableSource: TilejsonSource<CartoQuadbinTableSourceOptions>;
4
- export { cartoQuadbinTableSource };
1
+ import type { AggregationOptions, SourceOptions, TableSourceOptions, TilejsonResult } from './types';
2
+ export declare type QuadbinTableSourceOptions = SourceOptions & TableSourceOptions & AggregationOptions;
3
+ export declare const quadbinTableSource: (options: QuadbinTableSourceOptions) => Promise<TilejsonResult>;
5
4
  //# sourceMappingURL=quadbin-table-source.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"quadbin-table-source.d.ts","sourceRoot":"","sources":["../../src/sources/quadbin-table-source.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,oBAAY,8BAA8B,GAAG,kBAAkB,GAC7D,uBAAuB,GACvB,uBAAuB,CAAC;AAU1B,QAAA,MAAM,uBAAuB,EAAE,cAAc,CAAC,8BAA8B,CAsB3E,CAAC;AAEF,OAAO,EAAC,uBAAuB,EAAC,CAAC"}
1
+ {"version":3,"file":"quadbin-table-source.d.ts","sourceRoot":"","sources":["../../src/sources/quadbin-table-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EAEb,kBAAkB,EAClB,cAAc,EACf,MAAM,SAAS,CAAC;AAEjB,oBAAY,yBAAyB,GAAG,aAAa,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAWhG,eAAO,MAAM,kBAAkB,YACpB,yBAAyB,KACjC,QAAQ,cAAc,CAuBxB,CAAC"}
@@ -1,5 +1,4 @@
1
- import { CartoSourceOptions, CartoTilesetSourceOptions, TilejsonSource } from './common';
2
- export declare type CartoQuadbinTilesetSourceOptions = CartoSourceOptions & CartoTilesetSourceOptions;
3
- declare const cartoQuadbinTilesetSource: TilejsonSource<CartoQuadbinTilesetSourceOptions>;
4
- export { cartoQuadbinTilesetSource };
1
+ import type { SourceOptions, TilejsonResult, TilesetSourceOptions } from './types';
2
+ export declare type QuadbinTilesetSourceOptions = SourceOptions & TilesetSourceOptions;
3
+ export declare const quadbinTilesetSource: (options: QuadbinTilesetSourceOptions) => Promise<TilejsonResult>;
5
4
  //# sourceMappingURL=quadbin-tileset-source.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"quadbin-tileset-source.d.ts","sourceRoot":"","sources":["../../src/sources/quadbin-tileset-source.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAE,yBAAyB,EAAE,cAAc,EAAC,MAAM,UAAU,CAAC;AAEvF,oBAAY,gCAAgC,GAAG,kBAAkB,GAAG,yBAAyB,CAAC;AAG9F,QAAA,MAAM,yBAAyB,EAAE,cAAc,CAAC,gCAAgC,CAO/E,CAAC;AAEF,OAAO,EAAC,yBAAyB,EAAC,CAAC"}
1
+ {"version":3,"file":"quadbin-tileset-source.d.ts","sourceRoot":"","sources":["../../src/sources/quadbin-tileset-source.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,aAAa,EAAE,cAAc,EAAE,oBAAoB,EAAC,MAAM,SAAS,CAAC;AAEjF,oBAAY,2BAA2B,GAAG,aAAa,GAAG,oBAAoB,CAAC;AAG/E,eAAO,MAAM,oBAAoB,YACtB,2BAA2B,KACnC,QAAQ,cAAc,CAKxB,CAAC"}
@@ -1,5 +1,4 @@
1
- import { CartoSourceOptions, CartoTilesetSourceOptions, TypedSource } from './common';
2
- export declare type CartoRasterSourceOptions = CartoSourceOptions & CartoTilesetSourceOptions;
3
- declare const cartoRasterSource: TypedSource<CartoRasterSourceOptions>;
4
- export { cartoRasterSource };
1
+ import type { SourceOptions, TilejsonResult, TilesetSourceOptions } from './types';
2
+ export declare type RasterSourceOptions = SourceOptions & TilesetSourceOptions;
3
+ export declare const rasterSource: (options: RasterSourceOptions) => Promise<TilejsonResult>;
5
4
  //# sourceMappingURL=raster-source.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"raster-source.d.ts","sourceRoot":"","sources":["../../src/sources/raster-source.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAE,yBAAyB,EAAE,WAAW,EAAC,MAAM,UAAU,CAAC;AAEpF,oBAAY,wBAAwB,GAAG,kBAAkB,GAAG,yBAAyB,CAAC;AAGtF,QAAA,MAAM,iBAAiB,EAAE,WAAW,CAAC,wBAAwB,CAO5D,CAAC;AAEF,OAAO,EAAC,iBAAiB,EAAC,CAAC"}
1
+ {"version":3,"file":"raster-source.d.ts","sourceRoot":"","sources":["../../src/sources/raster-source.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,aAAa,EAAE,cAAc,EAAE,oBAAoB,EAAC,MAAM,SAAS,CAAC;AAEjF,oBAAY,mBAAmB,GAAG,aAAa,GAAG,oBAAoB,CAAC;AAGvE,eAAO,MAAM,YAAY,YAA4B,mBAAmB,KAAG,QAAQ,cAAc,CAKhG,CAAC"}
@@ -1,36 +1,39 @@
1
1
  import type { Feature } from 'geojson';
2
- import { Format, MapInstantiation, TileFormat, QueryParameters } from '../api/maps-api-common';
3
- export declare type CartoSourceRequiredOptions = {
2
+ import type { Format, MapInstantiation, QueryParameters } from '../api/types';
3
+ export declare type SourceRequiredOptions = {
4
4
  accessToken: string;
5
5
  connectionName: string;
6
6
  };
7
- export declare type CartoSourceOptionalOptions = {
7
+ export declare type SourceOptionalOptions = {
8
8
  apiBaseUrl: string;
9
+ cache?: {
10
+ value?: number;
11
+ };
9
12
  clientId: string;
13
+ /** @deprecated use `query` instead **/
10
14
  format: Format;
11
- formatTiles: TileFormat;
12
15
  headers: Record<string, string>;
13
16
  mapsUrl?: string;
14
17
  };
15
- export declare type CartoSourceOptions = CartoSourceRequiredOptions & Partial<CartoSourceOptionalOptions>;
16
- export declare type CartoAggregationOptions = {
18
+ export declare type SourceOptions = SourceRequiredOptions & Partial<SourceOptionalOptions>;
19
+ export declare type AggregationOptions = {
17
20
  aggregationExp: string;
18
21
  aggregationResLevel?: number;
19
22
  };
20
- export declare type CartoQuerySourceOptions = {
23
+ export declare type QuerySourceOptions = {
21
24
  spatialDataColumn?: string;
22
25
  sqlQuery: string;
23
26
  queryParameters?: QueryParameters;
24
27
  };
25
- export declare type CartoTableSourceOptions = {
28
+ export declare type TableSourceOptions = {
26
29
  columns?: string[];
27
30
  spatialDataColumn?: string;
28
31
  tableName: string;
29
32
  };
30
- export declare type CartoTilesetSourceOptions = {
33
+ export declare type TilesetSourceOptions = {
31
34
  tableName: string;
32
35
  };
33
- export declare const SOURCE_DEFAULTS: CartoSourceOptionalOptions;
36
+ export declare type SpatialDataType = 'geo' | 'h3' | 'quadbin';
34
37
  export declare type TilejsonMapInstantiation = MapInstantiation & {
35
38
  tilejson: {
36
39
  url: string[];
@@ -74,7 +77,7 @@ export interface VectorLayer {
74
77
  maxzoom: number;
75
78
  fields: Record<string, string>;
76
79
  }
77
- export declare type CartoTilejsonResult = Tilejson & {
80
+ export declare type TilejsonResult = Tilejson & {
78
81
  accessToken: string;
79
82
  };
80
83
  export declare type GeojsonResult = {
@@ -82,35 +85,16 @@ export declare type GeojsonResult = {
82
85
  features: Feature[];
83
86
  };
84
87
  export declare type JsonResult = any[];
85
- export interface TilejsonSource<T> {
86
- (options: T & {
87
- format?: 'tilejson';
88
- }): Promise<CartoTilejsonResult>;
89
- }
90
- export interface TypedSource<T> extends TilejsonSource<T> {
91
- (options: T & {
92
- format: 'geojson';
93
- }): Promise<GeojsonResult>;
94
- (options: T & {
95
- format: 'json';
96
- }): Promise<JsonResult>;
97
- }
98
- export declare const DEFAULT_CLIENT = "deck-gl-carto";
99
- export declare const V3_MINOR_VERSION = "3.2";
100
- export declare const MAX_GET_LENGTH = 8192;
101
- export declare const DEFAULT_PARAMETERS: {
102
- client: string;
103
- v: string;
104
- };
105
- export declare const DEFAULT_HEADERS: {
106
- Accept: string;
107
- 'Content-Type': string;
108
- };
109
- export declare const TilejsonPropType: {
110
- type: "object";
111
- value: CartoTilejsonResult | null;
112
- validate: (value: CartoTilejsonResult, propType: any) => any;
113
- compare: number;
114
- async: boolean;
88
+ export declare type QueryResult = {
89
+ meta: {
90
+ cacheHit: boolean;
91
+ location: string;
92
+ totalBytesProcessed: string;
93
+ };
94
+ rows: Record<string, any>[];
95
+ schema: {
96
+ name: string;
97
+ type: string;
98
+ }[];
115
99
  };
116
- //# sourceMappingURL=common.d.ts.map
100
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sources/types.ts"],"names":[],"mappings":"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"}
@@ -1,5 +1,4 @@
1
- import { CartoSourceOptions, CartoQuerySourceOptions, TypedSource } from './common';
2
- export declare type CartoVectorQuerySourceOptions = CartoSourceOptions & CartoQuerySourceOptions;
3
- declare const cartoVectorQuerySource: TypedSource<CartoVectorQuerySourceOptions>;
4
- export { cartoVectorQuerySource };
1
+ import type { SourceOptions, QuerySourceOptions, TilejsonResult } from './types';
2
+ export declare type VectorQuerySourceOptions = SourceOptions & QuerySourceOptions;
3
+ export declare const vectorQuerySource: (options: VectorQuerySourceOptions) => Promise<TilejsonResult>;
5
4
  //# sourceMappingURL=vector-query-source.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vector-query-source.d.ts","sourceRoot":"","sources":["../../src/sources/vector-query-source.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,kBAAkB,EAAE,uBAAuB,EAAE,WAAW,EAAC,MAAM,UAAU,CAAC;AAElF,oBAAY,6BAA6B,GAAG,kBAAkB,GAAG,uBAAuB,CAAC;AAGzF,QAAA,MAAM,sBAAsB,EAAE,WAAW,CAAC,6BAA6B,CAatE,CAAC;AAEF,OAAO,EAAC,sBAAsB,EAAC,CAAC"}
1
+ {"version":3,"file":"vector-query-source.d.ts","sourceRoot":"","sources":["../../src/sources/vector-query-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,aAAa,EAAE,kBAAkB,EAAmB,cAAc,EAAC,MAAM,SAAS,CAAC;AAEhG,oBAAY,wBAAwB,GAAG,aAAa,GAAG,kBAAkB,CAAC;AAQ1E,eAAO,MAAM,iBAAiB,YACnB,wBAAwB,KAChC,QAAQ,cAAc,CAQxB,CAAC"}
@@ -1,5 +1,4 @@
1
- import { CartoSourceOptions, CartoTableSourceOptions, TypedSource } from './common';
2
- export declare type CartoVectorTableSourceOptions = CartoSourceOptions & CartoTableSourceOptions;
3
- declare const cartoVectorTableSource: TypedSource<CartoVectorTableSourceOptions>;
4
- export { cartoVectorTableSource };
1
+ import type { SourceOptions, TableSourceOptions, TilejsonResult } from './types';
2
+ export declare type VectorTableSourceOptions = SourceOptions & TableSourceOptions;
3
+ export declare const vectorTableSource: (options: VectorTableSourceOptions) => Promise<TilejsonResult>;
5
4
  //# sourceMappingURL=vector-table-source.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vector-table-source.d.ts","sourceRoot":"","sources":["../../src/sources/vector-table-source.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,kBAAkB,EAAE,uBAAuB,EAAE,WAAW,EAAC,MAAM,UAAU,CAAC;AAElF,oBAAY,6BAA6B,GAAG,kBAAkB,GAAG,uBAAuB,CAAC;AAGzF,QAAA,MAAM,sBAAsB,EAAE,WAAW,CAAC,6BAA6B,CAatE,CAAC;AAEF,OAAO,EAAC,sBAAsB,EAAC,CAAC"}
1
+ {"version":3,"file":"vector-table-source.d.ts","sourceRoot":"","sources":["../../src/sources/vector-table-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,aAAa,EAAmB,kBAAkB,EAAE,cAAc,EAAC,MAAM,SAAS,CAAC;AAEhG,oBAAY,wBAAwB,GAAG,aAAa,GAAG,kBAAkB,CAAC;AAQ1E,eAAO,MAAM,iBAAiB,YACnB,wBAAwB,KAChC,QAAQ,cAAc,CAQxB,CAAC"}
@@ -1,5 +1,4 @@
1
- import { CartoSourceOptions, CartoTilesetSourceOptions, TilejsonSource } from './common';
2
- export declare type CartoVectorTilesetSourceOptions = CartoSourceOptions & CartoTilesetSourceOptions;
3
- declare const cartoVectorTilesetSource: TilejsonSource<CartoVectorTilesetSourceOptions>;
4
- export { cartoVectorTilesetSource };
1
+ import type { SourceOptions, TilesetSourceOptions, TilejsonResult } from './types';
2
+ export declare type VectorTilesetSourceOptions = SourceOptions & TilesetSourceOptions;
3
+ export declare const vectorTilesetSource: (options: VectorTilesetSourceOptions) => Promise<TilejsonResult>;
5
4
  //# sourceMappingURL=vector-tileset-source.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vector-tileset-source.d.ts","sourceRoot":"","sources":["../../src/sources/vector-tileset-source.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAE,yBAAyB,EAAE,cAAc,EAAC,MAAM,UAAU,CAAC;AAEvF,oBAAY,+BAA+B,GAAG,kBAAkB,GAAG,yBAAyB,CAAC;AAG7F,QAAA,MAAM,wBAAwB,EAAE,cAAc,CAAC,+BAA+B,CAO7E,CAAC;AAEF,OAAO,EAAC,wBAAwB,EAAC,CAAC"}
1
+ {"version":3,"file":"vector-tileset-source.d.ts","sourceRoot":"","sources":["../../src/sources/vector-tileset-source.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,aAAa,EAAE,oBAAoB,EAAE,cAAc,EAAC,MAAM,SAAS,CAAC;AAEjF,oBAAY,0BAA0B,GAAG,aAAa,GAAG,oBAAoB,CAAC;AAG9E,eAAO,MAAM,mBAAmB,YACrB,0BAA0B,KAClC,QAAQ,cAAc,CAKxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"color-bins-style.d.ts","sourceRoot":"","sources":["../../src/style/color-bins-style.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAmB,EAAC,KAAK,EAA8B,MAAM,WAAW,CAAC;AACzE,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,GAAG,OAAO,EAAE,EACjD,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACvB,EAAE;IACD,2CAA2C;IAC3C,IAAI,EAAE,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEvC,yDAAyD;IACzD,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAE1B,uDAAuD;IACvD,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAWjC"}
1
+ {"version":3,"file":"color-bins-style.d.ts","sourceRoot":"","sources":["../../src/style/color-bins-style.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAmB,EAAC,KAAK,EAA8B,MAAM,WAAW,CAAC;AAEzE,OAAO,EAAC,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,GAAG,OAAO,EAAE,EACjD,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACvB,EAAE;IACD,2CAA2C;IAC3C,IAAI,EAAE,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEvC,yDAAyD;IACzD,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAE1B,uDAAuD;IACvD,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAWjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"color-categories-style.d.ts","sourceRoot":"","sources":["../../src/style/color-categories-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAmB,EAAC,KAAK,EAA4C,MAAM,WAAW,CAAC;AACvF,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,GAAG,OAAO,EAAE,EACvD,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACtB,WAA0B,EAC3B,EAAE;IACD,0CAA0C;IAC1C,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAEzD,yDAAyD;IACzD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAE5B;;;;;OAKG;IACH,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAEzB,uDAAuD;IACvD,SAAS,CAAC,EAAE,KAAK,CAAC;IAElB,sFAAsF;IACtF,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAgBjC"}
1
+ {"version":3,"file":"color-categories-style.d.ts","sourceRoot":"","sources":["../../src/style/color-categories-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAmB,EAAC,KAAK,EAA4C,MAAM,WAAW,CAAC;AAEvF,OAAO,EAAC,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,GAAG,OAAO,EAAE,EACvD,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACtB,WAA0B,EAC3B,EAAE;IACD,0CAA0C;IAC1C,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAEzD,yDAAyD;IACzD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAE5B;;;;;OAKG;IACH,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAEzB,uDAAuD;IACvD,SAAS,CAAC,EAAE,KAAK,CAAC;IAElB,sFAAsF;IACtF,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAgBjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"color-continuous-style.d.ts","sourceRoot":"","sources":["../../src/style/color-continuous-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAmB,EAAC,KAAK,EAA8B,MAAM,WAAW,CAAC;AACzE,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,GAAG,OAAO,EAAE,EACvD,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACvB,EAAE;IACD,2CAA2C;IAC3C,IAAI,EAAE,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEvC,iDAAiD;IACjD,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAE1B,sDAAsD;IACtD,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAUjC"}
1
+ {"version":3,"file":"color-continuous-style.d.ts","sourceRoot":"","sources":["../../src/style/color-continuous-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAmB,EAAC,KAAK,EAA8B,MAAM,WAAW,CAAC;AAEzE,OAAO,EAAC,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,GAAG,OAAO,EAAE,EACvD,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACvB,EAAE;IACD,2CAA2C;IAC3C,IAAI,EAAE,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEvC,iDAAiD;IACjD,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAE1B,sDAAsD;IACtD,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAUjC"}
@@ -1,5 +1,4 @@
1
1
  import { Feature } from 'geojson';
2
2
  export declare type AttributeSelector<DataT = Feature, OutT = any> = string | ((d: DataT) => OutT);
3
3
  export declare function getAttrValue<DataT = Feature, OutT = any>(attr: string | AttributeSelector<DataT, OutT>, d: DataT): OutT;
4
- export declare function assert(condition: any, message?: string): asserts condition;
5
4
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/style/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAIhC,oBAAY,iBAAiB,CAAC,KAAK,GAAG,OAAO,EAAE,IAAI,GAAG,GAAG,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC;AAE3F,wBAAgB,YAAY,CAAC,KAAK,GAAG,OAAO,EAAE,IAAI,GAAG,GAAG,EACtD,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC,EAC7C,CAAC,EAAE,KAAK,GACP,IAAI,CASN;AAED,wBAAgB,MAAM,CAAC,SAAS,KAAA,EAAE,OAAO,SAAK,GAAG,OAAO,CAAC,SAAS,CAIjE"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/style/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAKhC,oBAAY,iBAAiB,CAAC,KAAK,GAAG,OAAO,EAAE,IAAI,GAAG,GAAG,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC;AAE3F,wBAAgB,YAAY,CAAC,KAAK,GAAG,OAAO,EAAE,IAAI,GAAG,GAAG,EACtD,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC,EAC7C,CAAC,EAAE,KAAK,GACP,IAAI,CASN"}
package/typed/utils.d.ts CHANGED
@@ -5,4 +5,12 @@ export declare function createBinaryProxy(data: {
5
5
  properties: Properties[];
6
6
  }, index: number): Properties;
7
7
  export declare function getWorkerUrl(id: string, version: string): string;
8
+ export declare function scaleIdentity(): {
9
+ (x: any): any;
10
+ invert: any;
11
+ domain: (d: any) => any;
12
+ range(d: any): any;
13
+ unknown(u: any): any;
14
+ copy(): any;
15
+ };
8
16
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAEhF,wBAAgB,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAE9E;AAID,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE;IAAC,YAAY,EAAE,YAAY,CAAC;IAAC,UAAU,EAAE,UAAU,EAAE,CAAA;CAAC,EAC5D,KAAK,EAAE,MAAM,cAed;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAIvD"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAEhF,wBAAgB,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAE9E;AAID,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE;IAAC,YAAY,EAAE,YAAY,CAAC;IAAC,UAAU,EAAE,UAAU,EAAE,CAAA;CAAC,EAC5D,KAAK,EAAE,MAAM,cAed;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAIvD;AAED,wBAAgB,aAAa;;;;;;;EAsB5B"}
@@ -1,77 +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.encodeParameter = encodeParameter;
9
- exports.REQUEST_TYPES = exports.SchemaFieldType = exports.TILE_FORMATS = exports.FORMATS = exports.GEO_COLUMN_SUPPORT = exports.COLUMNS_SUPPORT = exports.MAP_TYPES = exports.DEFAULT_MAPS_URL_FORMAT = exports.API_VERSIONS = exports.DEFAULT_REGION_COMPONENT_IN_URL = exports.DEFAULT_USER_COMPONENT_IN_URL = void 0;
10
-
11
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
-
13
- var _DEFAULT_MAPS_URL_FOR;
14
-
15
- var DEFAULT_USER_COMPONENT_IN_URL = '{user}';
16
- exports.DEFAULT_USER_COMPONENT_IN_URL = DEFAULT_USER_COMPONENT_IN_URL;
17
- var DEFAULT_REGION_COMPONENT_IN_URL = '{region}';
18
- exports.DEFAULT_REGION_COMPONENT_IN_URL = DEFAULT_REGION_COMPONENT_IN_URL;
19
- var API_VERSIONS = {
20
- V1: 'v1',
21
- V2: 'v2',
22
- V3: 'v3'
23
- };
24
- exports.API_VERSIONS = API_VERSIONS;
25
- var DEFAULT_MAPS_URL_FORMAT = (_DEFAULT_MAPS_URL_FOR = {}, (0, _defineProperty2.default)(_DEFAULT_MAPS_URL_FOR, API_VERSIONS.V1, "https://".concat(DEFAULT_USER_COMPONENT_IN_URL, ".carto.com/api/v1/map")), (0, _defineProperty2.default)(_DEFAULT_MAPS_URL_FOR, API_VERSIONS.V2, "https://maps-api-v2.".concat(DEFAULT_REGION_COMPONENT_IN_URL, ".carto.com/user/").concat(DEFAULT_USER_COMPONENT_IN_URL)), _DEFAULT_MAPS_URL_FOR);
26
- exports.DEFAULT_MAPS_URL_FORMAT = DEFAULT_MAPS_URL_FORMAT;
27
- var MAP_TYPES = {
28
- QUERY: 'query',
29
- TABLE: 'table',
30
- TILESET: 'tileset',
31
- RASTER: 'raster'
32
- };
33
- exports.MAP_TYPES = MAP_TYPES;
34
- var COLUMNS_SUPPORT = [MAP_TYPES.TABLE];
35
- exports.COLUMNS_SUPPORT = COLUMNS_SUPPORT;
36
- var GEO_COLUMN_SUPPORT = [MAP_TYPES.QUERY, MAP_TYPES.TABLE];
37
- exports.GEO_COLUMN_SUPPORT = GEO_COLUMN_SUPPORT;
38
- var FORMATS = {
39
- GEOJSON: 'geojson',
40
- TILEJSON: 'tilejson',
41
- JSON: 'json'
42
- };
43
- exports.FORMATS = FORMATS;
44
- var TILE_FORMATS = {
45
- MVT: 'mvt',
46
- JSON: 'json',
47
- GEOJSON: 'geojson',
48
- BINARY: 'binary'
49
- };
50
- exports.TILE_FORMATS = TILE_FORMATS;
51
- var SchemaFieldType;
52
- exports.SchemaFieldType = SchemaFieldType;
53
-
54
- (function (SchemaFieldType) {
55
- SchemaFieldType["Number"] = "number";
56
- SchemaFieldType["Bigint"] = "bigint";
57
- SchemaFieldType["String"] = "string";
58
- SchemaFieldType["Geometry"] = "geometry";
59
- SchemaFieldType["Timestamp"] = "timestamp";
60
- SchemaFieldType["Object"] = "object";
61
- SchemaFieldType["Boolean"] = "boolean";
62
- SchemaFieldType["Variant"] = "variant";
63
- SchemaFieldType["Unknown"] = "unknown";
64
- })(SchemaFieldType || (exports.SchemaFieldType = SchemaFieldType = {}));
65
-
66
- var REQUEST_TYPES = {
67
- DATA: 'Map data',
68
- INSTANTIATION: 'Map instantiation',
69
- PUBLIC_MAP: 'Public map',
70
- TILE_STATS: 'Tile stats'
71
- };
72
- exports.REQUEST_TYPES = REQUEST_TYPES;
73
-
74
- function encodeParameter(name, value) {
75
- return "".concat(name, "=").concat(encodeURIComponent(value));
76
- }
77
- //# sourceMappingURL=maps-api-common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/api/maps-api-common.ts"],"names":["DEFAULT_USER_COMPONENT_IN_URL","DEFAULT_REGION_COMPONENT_IN_URL","API_VERSIONS","V1","V2","V3","DEFAULT_MAPS_URL_FORMAT","MAP_TYPES","QUERY","TABLE","TILESET","RASTER","COLUMNS_SUPPORT","GEO_COLUMN_SUPPORT","FORMATS","GEOJSON","TILEJSON","JSON","TILE_FORMATS","MVT","BINARY","SchemaFieldType","REQUEST_TYPES","DATA","INSTANTIATION","PUBLIC_MAP","TILE_STATS","encodeParameter","name","value","encodeURIComponent"],"mappings":";;;;;;;;;;;;;;AAAO,IAAMA,6BAA6B,GAAG,QAAtC;;AACA,IAAMC,+BAA+B,GAAG,UAAxC;;AAGA,IAAMC,YAAY,GAAG;AAC1BC,EAAAA,EAAE,EAAE,IADsB;AAE1BC,EAAAA,EAAE,EAAE,IAFsB;AAG1BC,EAAAA,EAAE,EAAE;AAHsB,CAArB;;AAOA,IAAMC,uBAAuB,qFACjCJ,YAAY,CAACC,EADoB,oBACJH,6BADI,kFAEjCE,YAAY,CAACE,EAFoB,gCAEQH,+BAFR,6BAE0DD,6BAF1D,0BAA7B;;AAKA,IAAMO,SAAS,GAAG;AACvBC,EAAAA,KAAK,EAAE,OADgB;AAEvBC,EAAAA,KAAK,EAAE,OAFgB;AAGvBC,EAAAA,OAAO,EAAE,SAHc;AAIvBC,EAAAA,MAAM,EAAE;AAJe,CAAlB;;AAOA,IAAMC,eAA0B,GAAG,CAACL,SAAS,CAACE,KAAX,CAAnC;;AACA,IAAMI,kBAA6B,GAAG,CAACN,SAAS,CAACC,KAAX,EAAkBD,SAAS,CAACE,KAA5B,CAAtC;;AAGA,IAAMK,OAAO,GAAG;AACrBC,EAAAA,OAAO,EAAE,SADY;AAErBC,EAAAA,QAAQ,EAAE,UAFW;AAGrBC,EAAAA,IAAI,EAAE;AAHe,CAAhB;;AAQA,IAAMC,YAAY,GAAG;AAC1BC,EAAAA,GAAG,EAAE,KADqB;AAE1BF,EAAAA,IAAI,EAAE,MAFoB;AAG1BF,EAAAA,OAAO,EAAE,SAHiB;AAI1BK,EAAAA,MAAM,EAAE;AAJkB,CAArB;;IAQKC,e;;;WAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;GAAAA,e,+BAAAA,e;;AA8BL,IAAMC,aAAa,GAAG;AAC3BC,EAAAA,IAAI,EAAE,UADqB;AAE3BC,EAAAA,aAAa,EAAE,mBAFY;AAG3BC,EAAAA,UAAU,EAAE,YAHe;AAI3BC,EAAAA,UAAU,EAAE;AAJe,CAAtB;;;AAWA,SAASC,eAAT,CAAyBC,IAAzB,EAAuCC,KAAvC,EAAiF;AACtF,mBAAUD,IAAV,cAAkBE,kBAAkB,CAACD,KAAD,CAApC;AACD","sourcesContent":["export const DEFAULT_USER_COMPONENT_IN_URL = '{user}';\nexport const DEFAULT_REGION_COMPONENT_IN_URL = '{region}';\n\nexport type ValuesOf<T extends {}> = T[keyof T];\nexport const API_VERSIONS = {\n V1: 'v1',\n V2: 'v2',\n V3: 'v3'\n} as const;\nexport type ApiVersion = ValuesOf<typeof API_VERSIONS>;\n\nexport const DEFAULT_MAPS_URL_FORMAT = {\n [API_VERSIONS.V1]: `https://${DEFAULT_USER_COMPONENT_IN_URL}.carto.com/api/v1/map`,\n [API_VERSIONS.V2]: `https://maps-api-v2.${DEFAULT_REGION_COMPONENT_IN_URL}.carto.com/user/${DEFAULT_USER_COMPONENT_IN_URL}`\n} as const;\n\nexport const MAP_TYPES = {\n QUERY: 'query',\n TABLE: 'table',\n TILESET: 'tileset',\n RASTER: 'raster'\n} as const;\nexport type MapType = ValuesOf<typeof MAP_TYPES>;\nexport const COLUMNS_SUPPORT: MapType[] = [MAP_TYPES.TABLE];\nexport const GEO_COLUMN_SUPPORT: MapType[] = [MAP_TYPES.QUERY, MAP_TYPES.TABLE];\n\n// AVAILABLE FORMATS\nexport const FORMATS = {\n GEOJSON: 'geojson',\n TILEJSON: 'tilejson',\n JSON: 'json'\n} as const;\nexport type Format = ValuesOf<typeof FORMATS>;\n\n// AVAILABLE FORMATS FOR TILES\nexport const TILE_FORMATS = {\n MVT: 'mvt',\n JSON: 'json',\n GEOJSON: 'geojson',\n BINARY: 'binary'\n} as const;\nexport type TileFormat = ValuesOf<typeof TILE_FORMATS>;\n\nexport enum SchemaFieldType {\n Number = 'number',\n Bigint = 'bigint',\n String = 'string',\n Geometry = 'geometry',\n Timestamp = 'timestamp',\n Object = 'object',\n Boolean = 'boolean',\n Variant = 'variant',\n Unknown = 'unknown'\n}\nexport interface SchemaField {\n name: string;\n type: SchemaFieldType; // Field type in the CARTO stack, common for all providers\n}\n\nexport interface MapInstantiation extends MapInstantiationFormats {\n nrows: number;\n size?: number;\n schema: SchemaField[];\n}\n\ntype MapInstantiationFormats = Record<\n Format,\n {\n url: string[];\n error?: any;\n }\n>;\n\nexport const REQUEST_TYPES = {\n DATA: 'Map data',\n INSTANTIATION: 'Map instantiation',\n PUBLIC_MAP: 'Public map',\n TILE_STATS: 'Tile stats'\n} as const;\nexport type RequestType = ValuesOf<typeof REQUEST_TYPES>;\n\n/**\n * Simple encode parameter\n */\nexport function encodeParameter(name: string, value: string | boolean | number): string {\n return `${name}=${encodeURIComponent(value)}`;\n}\n\nexport type QueryParameterValue = string | number | boolean | Array<QueryParameterValue> | object;\n\nexport type NamedQueryParameter = Record<string, QueryParameterValue>;\n\nexport type PositionalQueryParameter = QueryParameterValue[];\n\nexport type QueryParameters = NamedQueryParameter | PositionalQueryParameter;\n"],"file":"maps-api-common.js"}
@@ -1,220 +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.getDataV2 = getDataV2;
9
- exports.CONNECTIONS = void 0;
10
-
11
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
12
-
13
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
-
15
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
16
-
17
- var _config = require("../config");
18
-
19
- var _mapsApiCommon = require("./maps-api-common");
20
-
21
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
22
-
23
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
24
-
25
- var CONNECTIONS = {
26
- BIGQUERY: 'bigquery',
27
- CARTO: 'carto'
28
- };
29
- exports.CONNECTIONS = CONNECTIONS;
30
- var BUFFER_SIZE = 16;
31
- var TILE_EXTENT = 4096;
32
-
33
- function getDataV2(_x) {
34
- return _getDataV.apply(this, arguments);
35
- }
36
-
37
- function _getDataV() {
38
- _getDataV = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(_ref) {
39
- var type, source, credentials, defaultCredentials, apiVersion, localCreds, url, connection, mapConfig, layergroup;
40
- return _regenerator.default.wrap(function _callee$(_context) {
41
- while (1) {
42
- switch (_context.prev = _context.next) {
43
- case 0:
44
- type = _ref.type, source = _ref.source, credentials = _ref.credentials;
45
- defaultCredentials = (0, _config.getDefaultCredentials)();
46
- apiVersion = (credentials === null || credentials === void 0 ? void 0 : credentials.apiVersion) || defaultCredentials.apiVersion;
47
- localCreds = _objectSpread(_objectSpread(_objectSpread({}, apiVersion === _mapsApiCommon.API_VERSIONS.V3 ? _config.defaultCloudNativeCredentials : _config.defaultClassicCredentials), {}, {
48
- mapsUrl: _mapsApiCommon.DEFAULT_MAPS_URL_FORMAT[apiVersion]
49
- }, defaultCredentials.apiVersion === apiVersion && defaultCredentials), credentials);
50
- connection = type === _mapsApiCommon.MAP_TYPES.TILESET ? CONNECTIONS.BIGQUERY : CONNECTIONS.CARTO;
51
- _context.t0 = apiVersion;
52
- _context.next = _context.t0 === _mapsApiCommon.API_VERSIONS.V1 ? 8 : _context.t0 === _mapsApiCommon.API_VERSIONS.V2 ? 14 : 18;
53
- break;
54
-
55
- case 8:
56
- mapConfig = createMapConfig(source);
57
- url = buildURLMapsAPIv1({
58
- mapConfig: mapConfig,
59
- credentials: localCreds
60
- });
61
- _context.next = 12;
62
- return request({
63
- url: url,
64
- credentials: localCreds
65
- });
66
-
67
- case 12:
68
- layergroup = _context.sent;
69
- return _context.abrupt("return", layergroup.metadata.tilejson.vector);
70
-
71
- case 14:
72
- url = buildURLMapsAPIv2({
73
- connection: connection,
74
- type: type,
75
- source: source,
76
- credentials: localCreds
77
- });
78
- _context.next = 17;
79
- return request({
80
- url: url,
81
- credentials: localCreds
82
- });
83
-
84
- case 17:
85
- return _context.abrupt("return", _context.sent);
86
-
87
- case 18:
88
- throw new Error("Invalid maps API version. It should be ".concat(_mapsApiCommon.API_VERSIONS.V1, " or ").concat(_mapsApiCommon.API_VERSIONS.V2));
89
-
90
- case 19:
91
- case "end":
92
- return _context.stop();
93
- }
94
- }
95
- }, _callee);
96
- }));
97
- return _getDataV.apply(this, arguments);
98
- }
99
-
100
- function request(_x2) {
101
- return _request.apply(this, arguments);
102
- }
103
-
104
- function _request() {
105
- _request = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(_ref2) {
106
- var url, credentials, response, json;
107
- return _regenerator.default.wrap(function _callee2$(_context2) {
108
- while (1) {
109
- switch (_context2.prev = _context2.next) {
110
- case 0:
111
- url = _ref2.url, credentials = _ref2.credentials;
112
- _context2.prev = 1;
113
- _context2.next = 4;
114
- return fetch(url, {
115
- headers: {
116
- Accept: 'application/json'
117
- }
118
- });
119
-
120
- case 4:
121
- response = _context2.sent;
122
- _context2.next = 10;
123
- break;
124
-
125
- case 7:
126
- _context2.prev = 7;
127
- _context2.t0 = _context2["catch"](1);
128
- throw new Error("Failed to connect to Maps API: ".concat(_context2.t0));
129
-
130
- case 10:
131
- _context2.next = 12;
132
- return response.json();
133
-
134
- case 12:
135
- json = _context2.sent;
136
-
137
- if (!response.ok) {
138
- dealWithError({
139
- response: response,
140
- json: json,
141
- credentials: credentials
142
- });
143
- }
144
-
145
- return _context2.abrupt("return", json);
146
-
147
- case 15:
148
- case "end":
149
- return _context2.stop();
150
- }
151
- }
152
- }, _callee2, null, [[1, 7]]);
153
- }));
154
- return _request.apply(this, arguments);
155
- }
156
-
157
- function dealWithError(_ref3) {
158
- var response = _ref3.response,
159
- json = _ref3.json,
160
- credentials = _ref3.credentials;
161
-
162
- switch (response.status) {
163
- case 401:
164
- throw new Error("Unauthorized access to Maps API: invalid combination of user ('".concat(credentials.username, "') and apiKey ('").concat(credentials.apiKey, "')"));
165
-
166
- case 403:
167
- throw new Error("Unauthorized access to dataset: the provided apiKey('".concat(credentials.apiKey, "') doesn't provide access to the requested data"));
168
-
169
- default:
170
- var e = credentials.apiVersion === _mapsApiCommon.API_VERSIONS.V1 ? JSON.stringify(json.errors) : json.error;
171
- throw new Error(e);
172
- }
173
- }
174
-
175
- function initURLParameters(credentials) {
176
- var encodedApiKey = (0, _mapsApiCommon.encodeParameter)('api_key', credentials.apiKey);
177
- var encodedClient = (0, _mapsApiCommon.encodeParameter)('client', 'deck-gl-carto');
178
- return [encodedApiKey, encodedClient];
179
- }
180
-
181
- function buildURLMapsAPIv1(_ref4) {
182
- var mapConfig = _ref4.mapConfig,
183
- credentials = _ref4.credentials;
184
- var parameters = initURLParameters(credentials);
185
- var cfg = JSON.stringify(mapConfig);
186
- return "".concat(mapsUrl(credentials), "?").concat(parameters.join('&'), "&").concat((0, _mapsApiCommon.encodeParameter)('config', cfg));
187
- }
188
-
189
- function buildURLMapsAPIv2(_ref5) {
190
- var connection = _ref5.connection,
191
- type = _ref5.type,
192
- source = _ref5.source,
193
- credentials = _ref5.credentials;
194
- var parameters = initURLParameters(credentials);
195
- var mapsApiType = type === _mapsApiCommon.MAP_TYPES.QUERY ? 'sql' : type;
196
- var url = "".concat(mapsUrl(credentials), "/").concat(connection, "/").concat(mapsApiType, "?");
197
- url += "".concat((0, _mapsApiCommon.encodeParameter)('source', source), "&format=tilejson&").concat(parameters.join('&'));
198
- return url;
199
- }
200
-
201
- function mapsUrl(credentials) {
202
- return credentials.mapsUrl.replace(_mapsApiCommon.DEFAULT_USER_COMPONENT_IN_URL, credentials.username).replace(_mapsApiCommon.DEFAULT_REGION_COMPONENT_IN_URL, credentials.region);
203
- }
204
-
205
- function createMapConfig(sql) {
206
- return {
207
- version: '1.3.1',
208
- buffersize: {
209
- mvt: BUFFER_SIZE
210
- },
211
- layers: [{
212
- type: 'mapnik',
213
- options: {
214
- sql: sql,
215
- vector_extent: TILE_EXTENT
216
- }
217
- }]
218
- };
219
- }
220
- //# sourceMappingURL=maps-client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/api/maps-client.ts"],"names":["CONNECTIONS","BIGQUERY","CARTO","BUFFER_SIZE","TILE_EXTENT","getDataV2","type","source","credentials","defaultCredentials","apiVersion","localCreds","API_VERSIONS","V3","defaultCloudNativeCredentials","defaultClassicCredentials","mapsUrl","DEFAULT_MAPS_URL_FORMAT","connection","MAP_TYPES","TILESET","V1","V2","mapConfig","createMapConfig","url","buildURLMapsAPIv1","request","layergroup","metadata","tilejson","vector","buildURLMapsAPIv2","Error","fetch","headers","Accept","response","json","ok","dealWithError","status","username","apiKey","e","JSON","stringify","errors","error","initURLParameters","encodedApiKey","encodedClient","parameters","cfg","join","mapsApiType","QUERY","replace","DEFAULT_USER_COMPONENT_IN_URL","DEFAULT_REGION_COMPONENT_IN_URL","region","sql","version","buffersize","mvt","layers","options","vector_extent"],"mappings":"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","sourcesContent":["/**\n * Maps API Client for Maps API v1 and Maps API v2\n */\nimport {\n ClassicCredentials,\n defaultClassicCredentials,\n defaultCloudNativeCredentials,\n getDefaultCredentials\n} from '../config';\nimport {\n API_VERSIONS,\n DEFAULT_MAPS_URL_FORMAT,\n DEFAULT_REGION_COMPONENT_IN_URL,\n DEFAULT_USER_COMPONENT_IN_URL,\n encodeParameter,\n MapType,\n MAP_TYPES\n} from './maps-api-common';\n\nexport const CONNECTIONS = {\n BIGQUERY: 'bigquery',\n CARTO: 'carto'\n};\n\nconst BUFFER_SIZE = 16;\nconst TILE_EXTENT = 4096;\n\n/**\n * Obtain a TileJson from Maps API v1 and v2\n */\nexport async function getDataV2({\n type,\n source,\n credentials\n}: {\n type: MapType;\n source: string;\n credentials?: Partial<ClassicCredentials>;\n}) {\n const defaultCredentials = getDefaultCredentials();\n const apiVersion = credentials?.apiVersion || defaultCredentials.apiVersion;\n // Only pick up default credentials if they have been defined for\n // correct API version\n const localCreds = {\n ...(apiVersion === API_VERSIONS.V3 ? defaultCloudNativeCredentials : defaultClassicCredentials),\n mapsUrl: DEFAULT_MAPS_URL_FORMAT[apiVersion],\n ...(defaultCredentials.apiVersion === apiVersion && defaultCredentials),\n ...credentials\n } as unknown as Required<ClassicCredentials>;\n\n let url: string;\n\n const connection = type === MAP_TYPES.TILESET ? CONNECTIONS.BIGQUERY : CONNECTIONS.CARTO;\n\n switch (apiVersion) {\n case API_VERSIONS.V1:\n // Maps API v1\n const mapConfig = createMapConfig(source);\n url = buildURLMapsAPIv1({mapConfig, credentials: localCreds});\n const layergroup = await request({url, credentials: localCreds});\n return layergroup.metadata.tilejson.vector;\n\n case API_VERSIONS.V2:\n // Maps API v2\n url = buildURLMapsAPIv2({connection, type, source, credentials: localCreds});\n return await request({url, credentials: localCreds});\n\n default:\n throw new Error(\n `Invalid maps API version. It should be ${API_VERSIONS.V1} or ${API_VERSIONS.V2}`\n );\n }\n}\n\n/**\n * Request against Maps API\n */\nasync function request({url, credentials}: {url: string; credentials: ClassicCredentials}) {\n let response;\n\n try {\n /* global fetch */\n response = await fetch(url, {\n headers: {\n Accept: 'application/json'\n }\n });\n } catch (error) {\n throw new Error(`Failed to connect to Maps API: ${error}`);\n }\n\n const json = await response.json();\n\n if (!response.ok) {\n dealWithError({response, json, credentials});\n }\n\n return json;\n}\n\n/**\n * Display proper message from Maps API error\n */\nfunction dealWithError({\n response,\n json,\n credentials\n}: {\n response: Response;\n json: any;\n credentials: ClassicCredentials;\n}) {\n switch (response.status) {\n case 401:\n throw new Error(\n `Unauthorized access to Maps API: invalid combination of user ('${credentials.username}') and apiKey ('${credentials.apiKey}')`\n );\n case 403:\n throw new Error(\n `Unauthorized access to dataset: the provided apiKey('${credentials.apiKey}') doesn't provide access to the requested data`\n );\n\n default:\n const e =\n credentials.apiVersion === API_VERSIONS.V1 ? JSON.stringify(json.errors) : json.error;\n throw new Error(e);\n }\n}\n\nfunction initURLParameters(credentials: ClassicCredentials): string[] {\n const encodedApiKey = encodeParameter('api_key', credentials.apiKey);\n const encodedClient = encodeParameter('client', 'deck-gl-carto');\n return [encodedApiKey, encodedClient];\n}\n\n/**\n * Build a URL with all required parameters\n */\nfunction buildURLMapsAPIv1({\n mapConfig,\n credentials\n}: {\n mapConfig: unknown;\n credentials: Required<ClassicCredentials>;\n}): string {\n const parameters = initURLParameters(credentials);\n const cfg = JSON.stringify(mapConfig);\n return `${mapsUrl(credentials)}?${parameters.join('&')}&${encodeParameter('config', cfg)}`;\n}\n\nfunction buildURLMapsAPIv2({\n connection,\n type,\n source,\n credentials\n}: {\n connection: string;\n type: MapType;\n source: string;\n credentials: Required<ClassicCredentials>;\n}): string {\n const parameters = initURLParameters(credentials);\n // Query type is mapped to 'sql' at maps api v1\n const mapsApiType = type === MAP_TYPES.QUERY ? 'sql' : type;\n let url = `${mapsUrl(credentials)}/${connection}/${mapsApiType}?`;\n url += `${encodeParameter('source', source)}&format=tilejson&${parameters.join('&')}`;\n return url;\n}\n\n/**\n * Prepare a url valid for the specified user\n */\nfunction mapsUrl(credentials: Required<ClassicCredentials>) {\n return credentials.mapsUrl\n .replace(DEFAULT_USER_COMPONENT_IN_URL, credentials.username)\n .replace(DEFAULT_REGION_COMPONENT_IN_URL, credentials.region);\n}\n\nfunction createMapConfig(sql: string) {\n return {\n version: '1.3.1',\n buffersize: {\n mvt: BUFFER_SIZE\n },\n layers: [\n {\n type: 'mapnik',\n options: {\n sql,\n // eslint-disable-next-line camelcase\n vector_extent: TILE_EXTENT\n }\n }\n ]\n };\n}\n"],"file":"maps-client.js"}