@deck.gl/carto 8.10.0-alpha.1 → 8.10.0-alpha.4

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 (261) hide show
  1. package/LICENSE +1 -1
  2. package/dist/cartoRasterTile-worker.js +1084 -0
  3. package/dist/cartoSpatialTile-worker.js +1469 -0
  4. package/dist/cartoVectorTile-worker.js +1727 -0
  5. package/dist/dist.dev.js +1740 -883
  6. package/dist/es5/api/layer-map.js +3 -7
  7. package/dist/es5/api/layer-map.js.map +1 -1
  8. package/dist/es5/api/maps-api-common.js +0 -1
  9. package/dist/es5/api/maps-api-common.js.map +1 -1
  10. package/dist/es5/api/maps-v3-client.js +5 -20
  11. package/dist/es5/api/maps-v3-client.js.map +1 -1
  12. package/dist/es5/index.js +74 -6
  13. package/dist/es5/index.js.map +1 -1
  14. package/dist/es5/layers/carto-layer.js +7 -5
  15. package/dist/es5/layers/carto-layer.js.map +1 -1
  16. package/dist/es5/layers/h3-tile-layer.js +23 -41
  17. package/dist/es5/layers/h3-tile-layer.js.map +1 -1
  18. package/dist/es5/layers/quadbin-layer.js +3 -0
  19. package/dist/es5/layers/quadbin-layer.js.map +1 -1
  20. package/dist/es5/layers/quadbin-tile-layer.js +21 -42
  21. package/dist/es5/layers/quadbin-tile-layer.js.map +1 -1
  22. package/dist/es5/layers/raster-tile-layer.js +23 -39
  23. package/dist/es5/layers/raster-tile-layer.js.map +1 -1
  24. package/dist/es5/layers/schema/carto-raster-tile-loader.js +13 -4
  25. package/dist/es5/layers/schema/carto-raster-tile-loader.js.map +1 -1
  26. package/dist/es5/layers/schema/carto-spatial-tile-loader.js +14 -8
  27. package/dist/es5/layers/schema/carto-spatial-tile-loader.js.map +1 -1
  28. package/dist/es5/layers/schema/carto-tile.js +1 -1
  29. package/dist/es5/layers/schema/carto-tile.js.map +1 -1
  30. package/dist/es5/layers/schema/carto-vector-tile-loader.js +64 -4
  31. package/dist/es5/layers/schema/carto-vector-tile-loader.js.map +1 -1
  32. package/dist/es5/layers/utils.js +29 -0
  33. package/dist/es5/layers/utils.js.map +1 -0
  34. package/dist/es5/layers/{carto-tile-layer.js → vector-tile-layer.js} +49 -24
  35. package/dist/es5/layers/vector-tile-layer.js.map +1 -0
  36. package/dist/es5/sources/base-source.js +100 -0
  37. package/dist/es5/sources/base-source.js.map +1 -0
  38. package/dist/es5/sources/common.js +48 -0
  39. package/dist/es5/sources/common.js.map +1 -0
  40. package/dist/es5/sources/h3-query-source.js +58 -0
  41. package/dist/es5/sources/h3-query-source.js.map +1 -0
  42. package/dist/es5/sources/h3-table-source.js +58 -0
  43. package/dist/es5/sources/h3-table-source.js.map +1 -0
  44. package/dist/es5/sources/h3-tileset-source.js +43 -0
  45. package/dist/es5/sources/h3-tileset-source.js.map +1 -0
  46. package/dist/es5/sources/index.js +94 -0
  47. package/dist/es5/sources/index.js.map +1 -0
  48. package/dist/es5/sources/quadbin-query-source.js +58 -0
  49. package/dist/es5/sources/quadbin-query-source.js.map +1 -0
  50. package/dist/es5/sources/quadbin-table-source.js +58 -0
  51. package/dist/es5/sources/quadbin-table-source.js.map +1 -0
  52. package/dist/es5/sources/quadbin-tileset-source.js +43 -0
  53. package/dist/es5/sources/quadbin-tileset-source.js.map +1 -0
  54. package/dist/es5/sources/raster-source.js +43 -0
  55. package/dist/es5/sources/raster-source.js.map +1 -0
  56. package/dist/es5/sources/utils.js +136 -0
  57. package/dist/es5/sources/utils.js.map +1 -0
  58. package/dist/es5/sources/vector-query-source.js +52 -0
  59. package/dist/es5/sources/vector-query-source.js.map +1 -0
  60. package/dist/es5/sources/vector-table-source.js +52 -0
  61. package/dist/es5/sources/vector-table-source.js.map +1 -0
  62. package/dist/es5/sources/vector-tileset-source.js +43 -0
  63. package/dist/es5/sources/vector-tileset-source.js.map +1 -0
  64. package/dist/es5/utils.js +5 -0
  65. package/dist/es5/utils.js.map +1 -1
  66. package/dist/es5/workers/cartoRasterTile.js +10 -0
  67. package/dist/es5/workers/cartoRasterTile.js.map +1 -0
  68. package/dist/es5/workers/cartoSpatialTile.js +10 -0
  69. package/dist/es5/workers/cartoSpatialTile.js.map +1 -0
  70. package/dist/es5/workers/cartoVectorTile.js +10 -0
  71. package/dist/es5/workers/cartoVectorTile.js.map +1 -0
  72. package/dist/esm/api/layer-map.js +3 -7
  73. package/dist/esm/api/layer-map.js.map +1 -1
  74. package/dist/esm/api/maps-api-common.js +0 -1
  75. package/dist/esm/api/maps-api-common.js.map +1 -1
  76. package/dist/esm/api/maps-v3-client.js +2 -12
  77. package/dist/esm/api/maps-v3-client.js.map +1 -1
  78. package/dist/esm/index.js +5 -4
  79. package/dist/esm/index.js.map +1 -1
  80. package/dist/esm/layers/carto-layer.js +5 -3
  81. package/dist/esm/layers/carto-layer.js.map +1 -1
  82. package/dist/esm/layers/h3-tile-layer.js +21 -37
  83. package/dist/esm/layers/h3-tile-layer.js.map +1 -1
  84. package/dist/esm/layers/quadbin-layer.js +4 -1
  85. package/dist/esm/layers/quadbin-layer.js.map +1 -1
  86. package/dist/esm/layers/quadbin-tile-layer.js +18 -38
  87. package/dist/esm/layers/quadbin-tile-layer.js.map +1 -1
  88. package/dist/esm/layers/raster-tile-layer.js +19 -34
  89. package/dist/esm/layers/raster-tile-layer.js.map +1 -1
  90. package/dist/esm/layers/schema/carto-raster-tile-loader.js +12 -4
  91. package/dist/esm/layers/schema/carto-raster-tile-loader.js.map +1 -1
  92. package/dist/esm/layers/schema/carto-spatial-tile-loader.js +13 -8
  93. package/dist/esm/layers/schema/carto-spatial-tile-loader.js.map +1 -1
  94. package/dist/esm/layers/schema/carto-tile.js +1 -1
  95. package/dist/esm/layers/schema/carto-tile.js.map +1 -1
  96. package/dist/esm/layers/schema/carto-vector-tile-loader.js +63 -4
  97. package/dist/esm/layers/schema/carto-vector-tile-loader.js.map +1 -1
  98. package/dist/esm/layers/utils.js +14 -0
  99. package/dist/esm/layers/utils.js.map +1 -0
  100. package/dist/esm/layers/{carto-tile-layer.js → vector-tile-layer.js} +39 -15
  101. package/dist/esm/layers/vector-tile-layer.js.map +1 -0
  102. package/dist/esm/sources/base-source.js +49 -0
  103. package/dist/esm/sources/base-source.js.map +1 -0
  104. package/dist/esm/sources/common.js +26 -0
  105. package/dist/esm/sources/common.js.map +1 -0
  106. package/dist/esm/sources/h3-query-source.js +32 -0
  107. package/dist/esm/sources/h3-query-source.js.map +1 -0
  108. package/dist/esm/sources/h3-table-source.js +32 -0
  109. package/dist/esm/sources/h3-table-source.js.map +1 -0
  110. package/dist/esm/sources/h3-tileset-source.js +14 -0
  111. package/dist/esm/sources/h3-tileset-source.js.map +1 -0
  112. package/dist/esm/sources/index.js +12 -0
  113. package/dist/esm/sources/index.js.map +1 -0
  114. package/dist/esm/sources/quadbin-query-source.js +32 -0
  115. package/dist/esm/sources/quadbin-query-source.js.map +1 -0
  116. package/dist/esm/sources/quadbin-table-source.js +32 -0
  117. package/dist/esm/sources/quadbin-table-source.js.map +1 -0
  118. package/dist/esm/sources/quadbin-tileset-source.js +14 -0
  119. package/dist/esm/sources/quadbin-tileset-source.js.map +1 -0
  120. package/dist/esm/sources/raster-source.js +14 -0
  121. package/dist/esm/sources/raster-source.js.map +1 -0
  122. package/dist/esm/sources/utils.js +69 -0
  123. package/dist/esm/sources/utils.js.map +1 -0
  124. package/dist/esm/sources/vector-query-source.js +25 -0
  125. package/dist/esm/sources/vector-query-source.js.map +1 -0
  126. package/dist/esm/sources/vector-table-source.js +25 -0
  127. package/dist/esm/sources/vector-table-source.js.map +1 -0
  128. package/dist/esm/sources/vector-tileset-source.js +14 -0
  129. package/dist/esm/sources/vector-tileset-source.js.map +1 -0
  130. package/dist/esm/utils.js +3 -0
  131. package/dist/esm/utils.js.map +1 -1
  132. package/dist/esm/workers/cartoRasterTile.js +4 -0
  133. package/dist/esm/workers/cartoRasterTile.js.map +1 -0
  134. package/dist/esm/workers/cartoSpatialTile.js +4 -0
  135. package/dist/esm/workers/cartoSpatialTile.js.map +1 -0
  136. package/dist/esm/workers/cartoVectorTile.js +4 -0
  137. package/dist/esm/workers/cartoVectorTile.js.map +1 -0
  138. package/dist.min.js +25 -25
  139. package/package.json +12 -9
  140. package/src/api/layer-map.ts +4 -8
  141. package/src/api/maps-api-common.ts +0 -1
  142. package/src/api/maps-v3-client.ts +6 -5
  143. package/src/index.ts +34 -5
  144. package/src/layers/carto-layer.ts +8 -2
  145. package/src/layers/h3-tile-layer.ts +22 -35
  146. package/src/layers/quadbin-layer.ts +2 -1
  147. package/src/layers/quadbin-tile-layer.ts +19 -33
  148. package/src/layers/raster-tile-layer.ts +22 -26
  149. package/src/layers/schema/carto-raster-tile-loader.ts +26 -6
  150. package/src/layers/schema/carto-spatial-tile-loader.ts +25 -11
  151. package/src/layers/schema/carto-tile.ts +1 -1
  152. package/src/layers/schema/carto-vector-tile-loader.ts +79 -9
  153. package/src/layers/utils.ts +11 -0
  154. package/src/layers/{carto-tile-layer.ts → vector-tile-layer.ts} +40 -21
  155. package/src/sources/base-source.ts +55 -0
  156. package/src/sources/common.ts +132 -0
  157. package/src/sources/h3-query-source.ts +45 -0
  158. package/src/sources/h3-table-source.ts +46 -0
  159. package/src/sources/h3-tileset-source.ts +16 -0
  160. package/src/sources/index.ts +32 -0
  161. package/src/sources/quadbin-query-source.ts +46 -0
  162. package/src/sources/quadbin-table-source.ts +46 -0
  163. package/src/sources/quadbin-tileset-source.ts +16 -0
  164. package/src/sources/raster-source.ts +16 -0
  165. package/src/sources/utils.ts +63 -0
  166. package/src/sources/vector-query-source.ts +23 -0
  167. package/src/sources/vector-table-source.ts +23 -0
  168. package/src/sources/vector-tileset-source.ts +16 -0
  169. package/src/utils.ts +6 -0
  170. package/src/workers/cartoRasterTile.ts +4 -0
  171. package/src/workers/cartoSpatialTile.ts +4 -0
  172. package/src/workers/cartoVectorTile.ts +4 -0
  173. package/typed/api/layer-map.d.ts +2 -3
  174. package/typed/api/layer-map.d.ts.map +1 -1
  175. package/typed/api/maps-api-common.d.ts +0 -1
  176. package/typed/api/maps-api-common.d.ts.map +1 -1
  177. package/typed/api/maps-v3-client.d.ts +0 -3
  178. package/typed/api/maps-v3-client.d.ts.map +1 -1
  179. package/typed/index.d.ts +6 -4
  180. package/typed/index.d.ts.map +1 -1
  181. package/typed/layers/carto-layer.d.ts.map +1 -1
  182. package/typed/layers/h3-tile-layer.d.ts +5 -8
  183. package/typed/layers/h3-tile-layer.d.ts.map +1 -1
  184. package/typed/layers/quadbin-layer.d.ts.map +1 -1
  185. package/typed/layers/quadbin-tile-layer.d.ts +5 -9
  186. package/typed/layers/quadbin-tile-layer.d.ts.map +1 -1
  187. package/typed/layers/raster-tile-layer.d.ts +6 -10
  188. package/typed/layers/raster-tile-layer.d.ts.map +1 -1
  189. package/typed/layers/schema/carto-raster-tile-loader.d.ts.map +1 -1
  190. package/typed/layers/schema/carto-spatial-tile-loader.d.ts.map +1 -1
  191. package/typed/layers/schema/carto-vector-tile-loader.d.ts.map +1 -1
  192. package/typed/layers/utils.d.ts +5 -0
  193. package/typed/layers/utils.d.ts.map +1 -0
  194. package/typed/layers/{carto-tile-layer.d.ts → vector-tile-layer.d.ts} +11 -7
  195. package/typed/layers/vector-tile-layer.d.ts.map +1 -0
  196. package/typed/sources/base-source.d.ts +4 -0
  197. package/typed/sources/base-source.d.ts.map +1 -0
  198. package/typed/sources/common.d.ts +116 -0
  199. package/typed/sources/common.d.ts.map +1 -0
  200. package/typed/sources/h3-query-source.d.ts +5 -0
  201. package/typed/sources/h3-query-source.d.ts.map +1 -0
  202. package/typed/sources/h3-table-source.d.ts +5 -0
  203. package/typed/sources/h3-table-source.d.ts.map +1 -0
  204. package/typed/sources/h3-tileset-source.d.ts +5 -0
  205. package/typed/sources/h3-tileset-source.d.ts.map +1 -0
  206. package/typed/sources/index.d.ts +23 -0
  207. package/typed/sources/index.d.ts.map +1 -0
  208. package/typed/sources/quadbin-query-source.d.ts +5 -0
  209. package/typed/sources/quadbin-query-source.d.ts.map +1 -0
  210. package/typed/sources/quadbin-table-source.d.ts +5 -0
  211. package/typed/sources/quadbin-table-source.d.ts.map +1 -0
  212. package/typed/sources/quadbin-tileset-source.d.ts +5 -0
  213. package/typed/sources/quadbin-tileset-source.d.ts.map +1 -0
  214. package/typed/sources/raster-source.d.ts +5 -0
  215. package/typed/sources/raster-source.d.ts.map +1 -0
  216. package/typed/sources/utils.d.ts +15 -0
  217. package/typed/sources/utils.d.ts.map +1 -0
  218. package/typed/sources/vector-query-source.d.ts +5 -0
  219. package/typed/sources/vector-query-source.d.ts.map +1 -0
  220. package/typed/sources/vector-table-source.d.ts +5 -0
  221. package/typed/sources/vector-table-source.d.ts.map +1 -0
  222. package/typed/sources/vector-tileset-source.d.ts +5 -0
  223. package/typed/sources/vector-tileset-source.d.ts.map +1 -0
  224. package/typed/utils.d.ts +1 -0
  225. package/typed/utils.d.ts.map +1 -1
  226. package/typed/workers/cartoRasterTile.d.ts +2 -0
  227. package/typed/workers/cartoRasterTile.d.ts.map +1 -0
  228. package/typed/workers/cartoSpatialTile.d.ts +2 -0
  229. package/typed/workers/cartoSpatialTile.d.ts.map +1 -0
  230. package/typed/workers/cartoVectorTile.d.ts +2 -0
  231. package/typed/workers/cartoVectorTile.d.ts.map +1 -0
  232. package/dist/es5/layers/carto-tile-layer.js.map +0 -1
  233. package/dist/esm/layers/carto-tile-layer.js.map +0 -1
  234. package/typed/api/index.js +0 -3
  235. package/typed/api/layer-map.js +0 -264
  236. package/typed/api/maps-api-common.js +0 -50
  237. package/typed/api/maps-client.js +0 -125
  238. package/typed/api/maps-v3-client.js +0 -304
  239. package/typed/api/parseMap.js +0 -178
  240. package/typed/basemap.js +0 -9
  241. package/typed/config.js +0 -35
  242. package/typed/index.js +0 -10
  243. package/typed/layers/carto-layer.js +0 -173
  244. package/typed/layers/carto-tile-layer.d.ts.map +0 -1
  245. package/typed/layers/carto-tile-layer.js +0 -105
  246. package/typed/layers/h3-tile-layer.js +0 -47
  247. package/typed/layers/h3-tileset-2d.js +0 -85
  248. package/typed/layers/quadkey-tile-layer.d.ts +0 -21
  249. package/typed/layers/quadkey-tile-layer.d.ts.map +0 -1
  250. package/typed/layers/quadkey-tile-layer.js +0 -42
  251. package/typed/layers/quadkey-tileset-2d.d.ts +0 -15
  252. package/typed/layers/quadkey-tileset-2d.d.ts.map +0 -1
  253. package/typed/layers/quadkey-tileset-2d.js +0 -36
  254. package/typed/layers/schema/carto-tile.js +0 -161
  255. package/typed/layers/spatial-index-tile-layer.js +0 -40
  256. package/typed/style/color-bins-style.js +0 -12
  257. package/typed/style/color-categories-style.js +0 -16
  258. package/typed/style/color-continuous-style.js +0 -12
  259. package/typed/style/palette.js +0 -62
  260. package/typed/style/utils.js +0 -15
  261. package/typed/utils.js +0 -4
@@ -0,0 +1,49 @@
1
+ import { SOURCE_DEFAULTS } from './common';
2
+ import { buildApiEndpoint, requestWithParameters } from './utils';
3
+ export async function cartoBaseSource(endpoint, options, urlParameters) {
4
+ const mergedOptions = { ...SOURCE_DEFAULTS,
5
+ ...options,
6
+ endpoint
7
+ };
8
+ const baseUrl = buildApiEndpoint(mergedOptions);
9
+ const {
10
+ accessToken,
11
+ format
12
+ } = mergedOptions;
13
+ const headers = {
14
+ Authorization: "Bearer ".concat(options.accessToken),
15
+ ...options.headers
16
+ };
17
+ const errorContext = {
18
+ requestType: 'Map instantiation',
19
+ connection: options.connectionName,
20
+ type: endpoint,
21
+ source: JSON.stringify(urlParameters, undefined, 2)
22
+ };
23
+ const mapInstantiation = await requestWithParameters({
24
+ baseUrl,
25
+ parameters: urlParameters,
26
+ headers,
27
+ errorContext
28
+ });
29
+ const dataUrl = mapInstantiation[format].url[0];
30
+ errorContext.requestType = 'Map data';
31
+
32
+ if (format === 'tilejson') {
33
+ const tilejson = await requestWithParameters({
34
+ baseUrl: dataUrl,
35
+ headers,
36
+ errorContext
37
+ });
38
+ return { ...tilejson,
39
+ accessToken
40
+ };
41
+ }
42
+
43
+ return await requestWithParameters({
44
+ baseUrl: dataUrl,
45
+ headers,
46
+ errorContext
47
+ });
48
+ }
49
+ //# sourceMappingURL=base-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/sources/base-source.ts"],"names":["SOURCE_DEFAULTS","buildApiEndpoint","requestWithParameters","cartoBaseSource","endpoint","options","urlParameters","mergedOptions","baseUrl","accessToken","format","headers","Authorization","errorContext","requestType","connection","connectionName","type","source","JSON","stringify","undefined","mapInstantiation","parameters","dataUrl","url","tilejson"],"mappings":"AAEA,SAMEA,eANF,QASO,UATP;AAUA,SAAQC,gBAAR,EAA0BC,qBAA1B,QAAsD,SAAtD;AAEA,OAAO,eAAeC,eAAf,CACLC,QADK,EAELC,OAFK,EAGLC,aAHK,EAIsD;AAC3D,QAAMC,aAAa,GAAG,EAAC,GAAGP,eAAJ;AAAqB,OAAGK,OAAxB;AAAiCD,IAAAA;AAAjC,GAAtB;AACA,QAAMI,OAAO,GAAGP,gBAAgB,CAACM,aAAD,CAAhC;AACA,QAAM;AAACE,IAAAA,WAAD;AAAcC,IAAAA;AAAd,MAAwBH,aAA9B;AACA,QAAMI,OAAO,GAAG;AAACC,IAAAA,aAAa,mBAAYP,OAAO,CAACI,WAApB,CAAd;AAAiD,OAAGJ,OAAO,CAACM;AAA5D,GAAhB;AAEA,QAAME,YAA6B,GAAG;AACpCC,IAAAA,WAAW,EAAE,mBADuB;AAEpCC,IAAAA,UAAU,EAAEV,OAAO,CAACW,cAFgB;AAGpCC,IAAAA,IAAI,EAAEb,QAH8B;AAIpCc,IAAAA,MAAM,EAAEC,IAAI,CAACC,SAAL,CAAed,aAAf,EAA8Be,SAA9B,EAAyC,CAAzC;AAJ4B,GAAtC;AAMA,QAAMC,gBAAgB,GAAG,MAAMpB,qBAAqB,CAA2B;AAC7EM,IAAAA,OAD6E;AAE7Ee,IAAAA,UAAU,EAAEjB,aAFiE;AAG7EK,IAAAA,OAH6E;AAI7EE,IAAAA;AAJ6E,GAA3B,CAApD;AAOA,QAAMW,OAAO,GAAGF,gBAAgB,CAACZ,MAAD,CAAhB,CAAyBe,GAAzB,CAA6B,CAA7B,CAAhB;AACAZ,EAAAA,YAAY,CAACC,WAAb,GAA2B,UAA3B;;AAEA,MAAIJ,MAAM,KAAK,UAAf,EAA2B;AACzB,UAAMgB,QAAQ,GAAG,MAAMxB,qBAAqB,CAAW;AACrDM,MAAAA,OAAO,EAAEgB,OAD4C;AAErDb,MAAAA,OAFqD;AAGrDE,MAAAA;AAHqD,KAAX,CAA5C;AAKA,WAAO,EAAC,GAAGa,QAAJ;AAAcjB,MAAAA;AAAd,KAAP;AACD;;AAED,SAAO,MAAMP,qBAAqB,CAA6B;AAC7DM,IAAAA,OAAO,EAAEgB,OADoD;AAE7Db,IAAAA,OAF6D;AAG7DE,IAAAA;AAH6D,GAA7B,CAAlC;AAKD","sourcesContent":["import type {MapType} from '../api/maps-api-common';\nimport {APIErrorContext} from '../api/carto-api-error';\nimport {\n CartoSourceOptionalOptions,\n CartoSourceRequiredOptions,\n CartoTilejsonResult,\n GeojsonResult,\n JsonResult,\n SOURCE_DEFAULTS,\n Tilejson,\n TilejsonMapInstantiation\n} from './common';\nimport {buildApiEndpoint, requestWithParameters} from './utils';\n\nexport async function cartoBaseSource<UrlParameters extends Record<string, string>>(\n endpoint: MapType,\n options: Partial<CartoSourceOptionalOptions> & CartoSourceRequiredOptions,\n urlParameters: UrlParameters\n): Promise<CartoTilejsonResult | GeojsonResult | JsonResult> {\n const mergedOptions = {...SOURCE_DEFAULTS, ...options, endpoint};\n const baseUrl = buildApiEndpoint(mergedOptions);\n const {accessToken, format} = mergedOptions;\n const headers = {Authorization: `Bearer ${options.accessToken}`, ...options.headers};\n\n const errorContext: APIErrorContext = {\n requestType: 'Map instantiation',\n connection: options.connectionName,\n type: endpoint,\n source: JSON.stringify(urlParameters, undefined, 2)\n };\n const mapInstantiation = await requestWithParameters<TilejsonMapInstantiation>({\n baseUrl,\n parameters: urlParameters,\n headers,\n errorContext\n });\n\n const dataUrl = mapInstantiation[format].url[0];\n errorContext.requestType = 'Map data';\n\n if (format === 'tilejson') {\n const tilejson = await requestWithParameters<Tilejson>({\n baseUrl: dataUrl,\n headers,\n errorContext\n });\n return {...tilejson, accessToken};\n }\n\n return await requestWithParameters<GeojsonResult | JsonResult>({\n baseUrl: dataUrl,\n headers,\n errorContext\n });\n}\n"],"file":"base-source.js"}
@@ -0,0 +1,26 @@
1
+ export const SOURCE_DEFAULTS = {
2
+ apiBaseUrl: 'https://gcp-us-east1.api.carto.com',
3
+ clientId: 'deck-gl-carto',
4
+ format: 'tilejson',
5
+ formatTiles: 'binary',
6
+ headers: {}
7
+ };
8
+ export const DEFAULT_CLIENT = 'deck-gl-carto';
9
+ export const V3_MINOR_VERSION = '3.2';
10
+ export const MAX_GET_LENGTH = 8192;
11
+ export const DEFAULT_PARAMETERS = {
12
+ client: DEFAULT_CLIENT,
13
+ v: V3_MINOR_VERSION
14
+ };
15
+ export const DEFAULT_HEADERS = {
16
+ Accept: 'application/json',
17
+ 'Content-Type': 'application/json'
18
+ };
19
+ export const TilejsonPropType = {
20
+ type: 'object',
21
+ value: null,
22
+ validate: (value, propType) => propType.optional && value === null || typeof value === 'object' && Array.isArray(value.tiles) && value.tiles.every(url => typeof url === 'string'),
23
+ compare: 2,
24
+ async: true
25
+ };
26
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/sources/common.ts"],"names":["SOURCE_DEFAULTS","apiBaseUrl","clientId","format","formatTiles","headers","DEFAULT_CLIENT","V3_MINOR_VERSION","MAX_GET_LENGTH","DEFAULT_PARAMETERS","client","v","DEFAULT_HEADERS","Accept","TilejsonPropType","type","value","validate","propType","optional","Array","isArray","tiles","every","url","compare","async"],"mappings":"AAyCA,OAAO,MAAMA,eAA2C,GAAG;AACzDC,EAAAA,UAAU,EAAE,oCAD6C;AAEzDC,EAAAA,QAAQ,EAAE,eAF+C;AAGzDC,EAAAA,MAAM,EAAE,UAHiD;AAIzDC,EAAAA,WAAW,EAAE,QAJ4C;AAKzDC,EAAAA,OAAO,EAAE;AALgD,CAApD;AAkEP,OAAO,MAAMC,cAAc,GAAG,eAAvB;AACP,OAAO,MAAMC,gBAAgB,GAAG,KAAzB;AACP,OAAO,MAAMC,cAAc,GAAG,IAAvB;AAEP,OAAO,MAAMC,kBAAkB,GAAG;AAChCC,EAAAA,MAAM,EAAEJ,cADwB;AAEhCK,EAAAA,CAAC,EAAEJ;AAF6B,CAA3B;AAKP,OAAO,MAAMK,eAAe,GAAG;AAC7BC,EAAAA,MAAM,EAAE,kBADqB;AAE7B,kBAAgB;AAFa,CAAxB;AAKP,OAAO,MAAMC,gBAAgB,GAAG;AAC9BC,EAAAA,IAAI,EAAE,QADwB;AAE9BC,EAAAA,KAAK,EAAE,IAFuB;AAG9BC,EAAAA,QAAQ,EAAE,CAACD,KAAD,EAA6BE,QAA7B,KACPA,QAAQ,CAACC,QAAT,IAAqBH,KAAK,KAAK,IAAhC,IACC,OAAOA,KAAP,KAAiB,QAAjB,IACCI,KAAK,CAACC,OAAN,CAAcL,KAAK,CAACM,KAApB,CADD,IAECN,KAAK,CAACM,KAAN,CAAYC,KAAZ,CAAkBC,GAAG,IAAI,OAAOA,GAAP,KAAe,QAAxC,CAP0B;AAQ9BC,EAAAA,OAAO,EAAE,CARqB;AAS9BC,EAAAA,KAAK,EAAE;AATuB,CAAzB","sourcesContent":["/* eslint-disable camelcase */\nimport type {Feature} from 'geojson';\nimport {Format, MapInstantiation, TileFormat, QueryParameters} from '../api/maps-api-common';\n\nexport type CartoSourceRequiredOptions = {\n accessToken: string;\n connectionName: string;\n};\n\nexport type CartoSourceOptionalOptions = {\n apiBaseUrl: string;\n clientId: string;\n format: Format;\n formatTiles: TileFormat;\n headers: Record<string, string>;\n mapsUrl?: string;\n};\n\nexport type CartoSourceOptions = CartoSourceRequiredOptions & Partial<CartoSourceOptionalOptions>;\n\nexport type CartoAggregationOptions = {\n aggregationExp: string;\n aggregationResLevel?: number;\n};\n\nexport type CartoQuerySourceOptions = {\n spatialDataColumn?: string;\n sqlQuery: string;\n queryParameters?: QueryParameters;\n};\n\nexport type CartoTableSourceOptions = {\n columns?: string[];\n spatialDataColumn?: string;\n tableName: string;\n};\n\nexport type CartoTilesetSourceOptions = {\n tableName: string;\n};\n\nexport const SOURCE_DEFAULTS: CartoSourceOptionalOptions = {\n apiBaseUrl: 'https://gcp-us-east1.api.carto.com',\n clientId: 'deck-gl-carto',\n format: 'tilejson',\n formatTiles: 'binary',\n headers: {}\n};\n\nexport type TilejsonMapInstantiation = MapInstantiation & {\n tilejson: {url: string[]};\n};\n\nexport interface Tilejson {\n tilejson: string;\n name: string;\n description: string;\n version: string;\n attribution: string;\n scheme: string;\n tiles: string[];\n properties_tiles: string[];\n minresolution: number;\n maxresolution: number;\n minzoom: number;\n maxzoom: number;\n bounds: [number, number, number, number];\n center: [number, number, number];\n vector_layers: VectorLayer[];\n tilestats: Tilestats;\n}\n\nexport interface Tilestats {\n layerCount: number;\n layers: Layer[];\n}\n\nexport interface Layer {\n layer: string;\n count: number;\n attributeCount: number;\n attributes: Attribute[];\n}\n\nexport interface Attribute {\n attribute: string;\n type: string;\n}\n\nexport interface VectorLayer {\n id: string;\n minzoom: number;\n maxzoom: number;\n fields: Record<string, string>;\n}\n\nexport type CartoTilejsonResult = Tilejson & {accessToken: string};\nexport type GeojsonResult = {type: 'FeatureCollection'; features: Feature[]};\nexport type JsonResult = any[];\nexport interface TilejsonSource<T> {\n (options: T & {format?: 'tilejson'}): Promise<CartoTilejsonResult>;\n}\nexport interface TypedSource<T> extends TilejsonSource<T> {\n (options: T & {format: 'geojson'}): Promise<GeojsonResult>;\n (options: T & {format: 'json'}): Promise<JsonResult>;\n}\n\nexport const DEFAULT_CLIENT = 'deck-gl-carto';\nexport const V3_MINOR_VERSION = '3.2';\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\nexport const TilejsonPropType = {\n type: 'object' as const,\n value: null as null | CartoTilejsonResult,\n validate: (value: CartoTilejsonResult, propType) =>\n (propType.optional && value === null) ||\n (typeof value === 'object' &&\n Array.isArray(value.tiles) &&\n value.tiles.every(url => typeof url === 'string')),\n compare: 2,\n async: true\n};\n"],"file":"common.js"}
@@ -0,0 +1,32 @@
1
+ import { cartoBaseSource } from './base-source';
2
+
3
+ const cartoH3QuerySource = async function (options) {
4
+ const {
5
+ aggregationExp,
6
+ aggregationResLevel = 4,
7
+ sqlQuery,
8
+ spatialDataColumn = 'h3:h3',
9
+ queryParameters
10
+ } = options;
11
+ const urlParameters = {
12
+ aggregationExp,
13
+ q: sqlQuery
14
+ };
15
+
16
+ if (aggregationResLevel) {
17
+ urlParameters.aggregationResLevel = String(aggregationResLevel);
18
+ }
19
+
20
+ if (spatialDataColumn) {
21
+ urlParameters.geo_column = spatialDataColumn;
22
+ }
23
+
24
+ if (queryParameters) {
25
+ urlParameters.queryParameters = JSON.stringify(queryParameters);
26
+ }
27
+
28
+ return cartoBaseSource('query', options, urlParameters);
29
+ };
30
+
31
+ export { cartoH3QuerySource };
32
+ //# sourceMappingURL=h3-query-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/sources/h3-query-source.ts"],"names":["cartoBaseSource","cartoH3QuerySource","options","aggregationExp","aggregationResLevel","sqlQuery","spatialDataColumn","queryParameters","urlParameters","q","String","geo_column","JSON","stringify"],"mappings":"AACA,SAAQA,eAAR,QAA8B,eAA9B;;AAmBA,MAAMC,kBAA6D,GAAG,gBACpEC,OADoE,EAEtD;AACd,QAAM;AACJC,IAAAA,cADI;AAEJC,IAAAA,mBAAmB,GAAG,CAFlB;AAGJC,IAAAA,QAHI;AAIJC,IAAAA,iBAAiB,GAAG,OAJhB;AAKJC,IAAAA;AALI,MAMFL,OANJ;AAOA,QAAMM,aAA4B,GAAG;AAACL,IAAAA,cAAD;AAAiBM,IAAAA,CAAC,EAAEJ;AAApB,GAArC;;AAEA,MAAID,mBAAJ,EAAyB;AACvBI,IAAAA,aAAa,CAACJ,mBAAd,GAAoCM,MAAM,CAACN,mBAAD,CAA1C;AACD;;AACD,MAAIE,iBAAJ,EAAuB;AACrBE,IAAAA,aAAa,CAACG,UAAd,GAA2BL,iBAA3B;AACD;;AACD,MAAIC,eAAJ,EAAqB;AACnBC,IAAAA,aAAa,CAACD,eAAd,GAAgCK,IAAI,CAACC,SAAL,CAAeN,eAAf,CAAhC;AACD;;AACD,SAAOP,eAAe,CAAgB,OAAhB,EAAyBE,OAAzB,EAAkCM,aAAlC,CAAtB;AACD,CAtBD;;AAwBA,SAAQP,kBAAR","sourcesContent":["/* eslint-disable camelcase */\nimport {cartoBaseSource} from './base-source';\nimport {\n CartoAggregationOptions,\n CartoQuerySourceOptions,\n CartoSourceOptions,\n TilejsonSource\n} from './common';\n\nexport type CartoH3QuerySourceOptions = CartoSourceOptions &\n CartoQuerySourceOptions &\n CartoAggregationOptions;\ntype UrlParameters = {\n aggregationExp: string;\n aggregationResLevel?: string;\n geo_column?: string;\n q: string;\n queryParameters?: string;\n};\n\nconst cartoH3QuerySource: TilejsonSource<CartoH3QuerySourceOptions> = async function (\n options: CartoH3QuerySourceOptions\n): Promise<any> {\n const {\n aggregationExp,\n aggregationResLevel = 4,\n sqlQuery,\n spatialDataColumn = 'h3:h3',\n queryParameters\n } = options;\n const urlParameters: UrlParameters = {aggregationExp, q: sqlQuery};\n\n if (aggregationResLevel) {\n urlParameters.aggregationResLevel = String(aggregationResLevel);\n }\n if (spatialDataColumn) {\n urlParameters.geo_column = spatialDataColumn;\n }\n if (queryParameters) {\n urlParameters.queryParameters = JSON.stringify(queryParameters);\n }\n return cartoBaseSource<UrlParameters>('query', options, urlParameters);\n};\n\nexport {cartoH3QuerySource};\n"],"file":"h3-query-source.js"}
@@ -0,0 +1,32 @@
1
+ import { cartoBaseSource } from './base-source';
2
+
3
+ const cartoH3TableSource = async function (options) {
4
+ const {
5
+ aggregationExp,
6
+ aggregationResLevel = 4,
7
+ columns,
8
+ spatialDataColumn = 'h3:h3',
9
+ tableName
10
+ } = options;
11
+ const urlParameters = {
12
+ aggregationExp,
13
+ name: tableName
14
+ };
15
+
16
+ if (aggregationResLevel) {
17
+ urlParameters.aggregationResLevel = String(aggregationResLevel);
18
+ }
19
+
20
+ if (columns) {
21
+ urlParameters.columns = columns.join(',');
22
+ }
23
+
24
+ if (spatialDataColumn) {
25
+ urlParameters.geo_column = spatialDataColumn;
26
+ }
27
+
28
+ return cartoBaseSource('table', options, urlParameters);
29
+ };
30
+
31
+ export { cartoH3TableSource };
32
+ //# sourceMappingURL=h3-table-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/sources/h3-table-source.ts"],"names":["cartoBaseSource","cartoH3TableSource","options","aggregationExp","aggregationResLevel","columns","spatialDataColumn","tableName","urlParameters","name","String","join","geo_column"],"mappings":"AACA,SAAQA,eAAR,QAA8B,eAA9B;;AAoBA,MAAMC,kBAA6D,GAAG,gBACpEC,OADoE,EAEtD;AACd,QAAM;AACJC,IAAAA,cADI;AAEJC,IAAAA,mBAAmB,GAAG,CAFlB;AAGJC,IAAAA,OAHI;AAIJC,IAAAA,iBAAiB,GAAG,OAJhB;AAKJC,IAAAA;AALI,MAMFL,OANJ;AAOA,QAAMM,aAA4B,GAAG;AAACL,IAAAA,cAAD;AAAiBM,IAAAA,IAAI,EAAEF;AAAvB,GAArC;;AAEA,MAAIH,mBAAJ,EAAyB;AACvBI,IAAAA,aAAa,CAACJ,mBAAd,GAAoCM,MAAM,CAACN,mBAAD,CAA1C;AACD;;AACD,MAAIC,OAAJ,EAAa;AACXG,IAAAA,aAAa,CAACH,OAAd,GAAwBA,OAAO,CAACM,IAAR,CAAa,GAAb,CAAxB;AACD;;AACD,MAAIL,iBAAJ,EAAuB;AACrBE,IAAAA,aAAa,CAACI,UAAd,GAA2BN,iBAA3B;AACD;;AACD,SAAON,eAAe,CAAgB,OAAhB,EAAyBE,OAAzB,EAAkCM,aAAlC,CAAtB;AACD,CAtBD;;AAwBA,SAAQP,kBAAR","sourcesContent":["/* eslint-disable camelcase */\nimport {cartoBaseSource} from './base-source';\nimport {\n CartoAggregationOptions,\n CartoSourceOptions,\n CartoTableSourceOptions,\n TilejsonSource\n} from './common';\n\nexport type CartoH3TableSourceOptions = CartoSourceOptions &\n CartoTableSourceOptions &\n CartoAggregationOptions;\n\ntype UrlParameters = {\n aggregationExp: string;\n aggregationResLevel?: string;\n columns?: string;\n geo_column?: string;\n name: string;\n};\n\nconst cartoH3TableSource: TilejsonSource<CartoH3TableSourceOptions> = async function (\n options: CartoH3TableSourceOptions\n): Promise<any> {\n const {\n aggregationExp,\n aggregationResLevel = 4,\n columns,\n spatialDataColumn = 'h3:h3',\n tableName\n } = options;\n const urlParameters: UrlParameters = {aggregationExp, name: tableName};\n\n if (aggregationResLevel) {\n urlParameters.aggregationResLevel = String(aggregationResLevel);\n }\n if (columns) {\n urlParameters.columns = columns.join(',');\n }\n if (spatialDataColumn) {\n urlParameters.geo_column = spatialDataColumn;\n }\n return cartoBaseSource<UrlParameters>('table', options, urlParameters);\n};\n\nexport {cartoH3TableSource};\n"],"file":"h3-table-source.js"}
@@ -0,0 +1,14 @@
1
+ import { cartoBaseSource } from './base-source';
2
+
3
+ const cartoH3TilesetSource = async function (options) {
4
+ const {
5
+ tableName
6
+ } = options;
7
+ const urlParameters = {
8
+ name: tableName
9
+ };
10
+ return cartoBaseSource('tileset', options, urlParameters);
11
+ };
12
+
13
+ export { cartoH3TilesetSource };
14
+ //# sourceMappingURL=h3-tileset-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/sources/h3-tileset-source.ts"],"names":["cartoBaseSource","cartoH3TilesetSource","options","tableName","urlParameters","name"],"mappings":"AAAA,SAAQA,eAAR,QAA8B,eAA9B;;AAMA,MAAMC,oBAAiE,GAAG,gBACxEC,OADwE,EAE1D;AACd,QAAM;AAACC,IAAAA;AAAD,MAAcD,OAApB;AACA,QAAME,aAA4B,GAAG;AAACC,IAAAA,IAAI,EAAEF;AAAP,GAArC;AAEA,SAAOH,eAAe,CAAgB,SAAhB,EAA2BE,OAA3B,EAAoCE,aAApC,CAAtB;AACD,CAPD;;AASA,SAAQH,oBAAR","sourcesContent":["import {cartoBaseSource} from './base-source';\nimport {CartoSourceOptions, CartoTilesetSourceOptions, TilejsonSource} from './common';\n\nexport type CartoH3TilesetSourceOptions = CartoSourceOptions & CartoTilesetSourceOptions;\ntype UrlParameters = {name: string};\n\nconst cartoH3TilesetSource: TilejsonSource<CartoH3TilesetSourceOptions> = async function (\n options: CartoH3TilesetSourceOptions\n): Promise<any> {\n const {tableName} = options;\n const urlParameters: UrlParameters = {name: tableName};\n\n return cartoBaseSource<UrlParameters>('tileset', options, urlParameters);\n};\n\nexport {cartoH3TilesetSource};\n"],"file":"h3-tileset-source.js"}
@@ -0,0 +1,12 @@
1
+ export { SOURCE_DEFAULTS } from './common';
2
+ export { cartoH3QuerySource } from './h3-query-source';
3
+ export { cartoH3TableSource } from './h3-table-source';
4
+ export { cartoH3TilesetSource } from './h3-tileset-source';
5
+ export { cartoRasterSource } from './raster-source';
6
+ export { cartoQuadbinQuerySource } from './quadbin-query-source';
7
+ export { cartoQuadbinTableSource } from './quadbin-table-source';
8
+ export { cartoQuadbinTilesetSource } from './quadbin-tileset-source';
9
+ export { cartoVectorQuerySource } from './vector-query-source';
10
+ export { cartoVectorTableSource } from './vector-table-source';
11
+ export { cartoVectorTilesetSource } from './vector-tileset-source';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/sources/index.ts"],"names":["SOURCE_DEFAULTS","cartoH3QuerySource","cartoH3TableSource","cartoH3TilesetSource","cartoRasterSource","cartoQuadbinQuerySource","cartoQuadbinTableSource","cartoQuadbinTilesetSource","cartoVectorQuerySource","cartoVectorTableSource","cartoVectorTilesetSource"],"mappings":"AAAA,SAAQA,eAAR,QAA8B,UAA9B;AAGA,SAAQC,kBAAR,QAAiC,mBAAjC;AAGA,SAAQC,kBAAR,QAAiC,mBAAjC;AAGA,SAAQC,oBAAR,QAAmC,qBAAnC;AAGA,SAAQC,iBAAR,QAAgC,iBAAhC;AAGA,SAAQC,uBAAR,QAAsC,wBAAtC;AAGA,SAAQC,uBAAR,QAAsC,wBAAtC;AAGA,SAAQC,yBAAR,QAAwC,0BAAxC;AAGA,SAAQC,sBAAR,QAAqC,uBAArC;AAGA,SAAQC,sBAAR,QAAqC,uBAArC;AAGA,SAAQC,wBAAR,QAAuC,yBAAvC","sourcesContent":["export {SOURCE_DEFAULTS} from './common';\nexport type {CartoTilejsonResult, GeojsonResult, JsonResult} from './common';\n\nexport {cartoH3QuerySource} from './h3-query-source';\nexport type {CartoH3QuerySourceOptions} from './h3-query-source';\n\nexport {cartoH3TableSource} from './h3-table-source';\nexport type {CartoH3TableSourceOptions} from './h3-table-source';\n\nexport {cartoH3TilesetSource} from './h3-tileset-source';\nexport type {CartoH3TilesetSourceOptions} from './h3-tileset-source';\n\nexport {cartoRasterSource} from './raster-source';\nexport type {CartoRasterSourceOptions} from './raster-source';\n\nexport {cartoQuadbinQuerySource} from './quadbin-query-source';\nexport type {CartoQuadbinQuerySourceOptions} from './quadbin-query-source';\n\nexport {cartoQuadbinTableSource} from './quadbin-table-source';\nexport type {CartoQuadbinTableSourceOptions} from './quadbin-table-source';\n\nexport {cartoQuadbinTilesetSource} from './quadbin-tileset-source';\nexport type {CartoQuadbinTilesetSourceOptions} from './quadbin-tileset-source';\n\nexport {cartoVectorQuerySource} from './vector-query-source';\nexport type {CartoVectorQuerySourceOptions} from './vector-query-source';\n\nexport {cartoVectorTableSource} from './vector-table-source';\nexport type {CartoVectorTableSourceOptions} from './vector-table-source';\n\nexport {cartoVectorTilesetSource} from './vector-tileset-source';\nexport type {CartoVectorTilesetSourceOptions} from './vector-tileset-source';\n"],"file":"index.js"}
@@ -0,0 +1,32 @@
1
+ import { cartoBaseSource } from './base-source';
2
+
3
+ const cartoQuadbinQuerySource = async function (options) {
4
+ const {
5
+ aggregationExp,
6
+ aggregationResLevel = 6,
7
+ sqlQuery,
8
+ spatialDataColumn = 'quadbin:quadbin',
9
+ queryParameters
10
+ } = options;
11
+ const urlParameters = {
12
+ aggregationExp,
13
+ q: sqlQuery
14
+ };
15
+
16
+ if (aggregationResLevel) {
17
+ urlParameters.aggregationResLevel = String(aggregationResLevel);
18
+ }
19
+
20
+ if (spatialDataColumn) {
21
+ urlParameters.geo_column = spatialDataColumn;
22
+ }
23
+
24
+ if (queryParameters) {
25
+ urlParameters.queryParameters = JSON.stringify(queryParameters);
26
+ }
27
+
28
+ return cartoBaseSource('query', options, urlParameters);
29
+ };
30
+
31
+ export { cartoQuadbinQuerySource };
32
+ //# sourceMappingURL=quadbin-query-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/sources/quadbin-query-source.ts"],"names":["cartoBaseSource","cartoQuadbinQuerySource","options","aggregationExp","aggregationResLevel","sqlQuery","spatialDataColumn","queryParameters","urlParameters","q","String","geo_column","JSON","stringify"],"mappings":"AACA,SAAQA,eAAR,QAA8B,eAA9B;;AAoBA,MAAMC,uBAAuE,GAAG,gBAC9EC,OAD8E,EAEhE;AACd,QAAM;AACJC,IAAAA,cADI;AAEJC,IAAAA,mBAAmB,GAAG,CAFlB;AAGJC,IAAAA,QAHI;AAIJC,IAAAA,iBAAiB,GAAG,iBAJhB;AAKJC,IAAAA;AALI,MAMFL,OANJ;AAOA,QAAMM,aAA4B,GAAG;AAACL,IAAAA,cAAD;AAAiBM,IAAAA,CAAC,EAAEJ;AAApB,GAArC;;AAEA,MAAID,mBAAJ,EAAyB;AACvBI,IAAAA,aAAa,CAACJ,mBAAd,GAAoCM,MAAM,CAACN,mBAAD,CAA1C;AACD;;AACD,MAAIE,iBAAJ,EAAuB;AACrBE,IAAAA,aAAa,CAACG,UAAd,GAA2BL,iBAA3B;AACD;;AACD,MAAIC,eAAJ,EAAqB;AACnBC,IAAAA,aAAa,CAACD,eAAd,GAAgCK,IAAI,CAACC,SAAL,CAAeN,eAAf,CAAhC;AACD;;AACD,SAAOP,eAAe,CAAgB,OAAhB,EAAyBE,OAAzB,EAAkCM,aAAlC,CAAtB;AACD,CAtBD;;AAwBA,SAAQP,uBAAR","sourcesContent":["/* eslint-disable camelcase */\nimport {cartoBaseSource} from './base-source';\nimport {\n CartoAggregationOptions,\n CartoQuerySourceOptions,\n CartoSourceOptions,\n TilejsonSource\n} from './common';\n\nexport type CartoQuadbinQuerySourceOptions = CartoSourceOptions &\n CartoQuerySourceOptions &\n CartoAggregationOptions;\n\ntype UrlParameters = {\n aggregationExp: string;\n aggregationResLevel?: string;\n geo_column?: string;\n q: string;\n queryParameters?: string;\n};\n\nconst cartoQuadbinQuerySource: TilejsonSource<CartoQuadbinQuerySourceOptions> = async function (\n options: CartoQuadbinQuerySourceOptions\n): Promise<any> {\n const {\n aggregationExp,\n aggregationResLevel = 6,\n sqlQuery,\n spatialDataColumn = 'quadbin:quadbin',\n queryParameters\n } = options;\n const urlParameters: UrlParameters = {aggregationExp, q: sqlQuery};\n\n if (aggregationResLevel) {\n urlParameters.aggregationResLevel = String(aggregationResLevel);\n }\n if (spatialDataColumn) {\n urlParameters.geo_column = spatialDataColumn;\n }\n if (queryParameters) {\n urlParameters.queryParameters = JSON.stringify(queryParameters);\n }\n return cartoBaseSource<UrlParameters>('query', options, urlParameters);\n};\n\nexport {cartoQuadbinQuerySource};\n"],"file":"quadbin-query-source.js"}
@@ -0,0 +1,32 @@
1
+ import { cartoBaseSource } from './base-source';
2
+
3
+ const cartoQuadbinTableSource = async function (options) {
4
+ const {
5
+ aggregationExp,
6
+ aggregationResLevel = 6,
7
+ columns,
8
+ spatialDataColumn = 'quadbin:quadbin',
9
+ tableName
10
+ } = options;
11
+ const urlParameters = {
12
+ aggregationExp,
13
+ name: tableName
14
+ };
15
+
16
+ if (aggregationResLevel) {
17
+ urlParameters.aggregationResLevel = String(aggregationResLevel);
18
+ }
19
+
20
+ if (columns) {
21
+ urlParameters.columns = columns.join(',');
22
+ }
23
+
24
+ if (spatialDataColumn) {
25
+ urlParameters.geo_column = spatialDataColumn;
26
+ }
27
+
28
+ return cartoBaseSource('table', options, urlParameters);
29
+ };
30
+
31
+ export { cartoQuadbinTableSource };
32
+ //# sourceMappingURL=quadbin-table-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/sources/quadbin-table-source.ts"],"names":["cartoBaseSource","cartoQuadbinTableSource","options","aggregationExp","aggregationResLevel","columns","spatialDataColumn","tableName","urlParameters","name","String","join","geo_column"],"mappings":"AACA,SAAQA,eAAR,QAA8B,eAA9B;;AAoBA,MAAMC,uBAAuE,GAAG,gBAC9EC,OAD8E,EAEhE;AACd,QAAM;AACJC,IAAAA,cADI;AAEJC,IAAAA,mBAAmB,GAAG,CAFlB;AAGJC,IAAAA,OAHI;AAIJC,IAAAA,iBAAiB,GAAG,iBAJhB;AAKJC,IAAAA;AALI,MAMFL,OANJ;AAOA,QAAMM,aAA4B,GAAG;AAACL,IAAAA,cAAD;AAAiBM,IAAAA,IAAI,EAAEF;AAAvB,GAArC;;AAEA,MAAIH,mBAAJ,EAAyB;AACvBI,IAAAA,aAAa,CAACJ,mBAAd,GAAoCM,MAAM,CAACN,mBAAD,CAA1C;AACD;;AACD,MAAIC,OAAJ,EAAa;AACXG,IAAAA,aAAa,CAACH,OAAd,GAAwBA,OAAO,CAACM,IAAR,CAAa,GAAb,CAAxB;AACD;;AACD,MAAIL,iBAAJ,EAAuB;AACrBE,IAAAA,aAAa,CAACI,UAAd,GAA2BN,iBAA3B;AACD;;AACD,SAAON,eAAe,CAAgB,OAAhB,EAAyBE,OAAzB,EAAkCM,aAAlC,CAAtB;AACD,CAtBD;;AAwBA,SAAQP,uBAAR","sourcesContent":["/* eslint-disable camelcase */\nimport {cartoBaseSource} from './base-source';\nimport {\n CartoAggregationOptions,\n CartoSourceOptions,\n CartoTableSourceOptions,\n TilejsonSource\n} from './common';\n\nexport type CartoQuadbinTableSourceOptions = CartoSourceOptions &\n CartoTableSourceOptions &\n CartoAggregationOptions;\n\ntype UrlParameters = {\n aggregationExp: string;\n aggregationResLevel?: string;\n columns?: string;\n geo_column?: string;\n name: string;\n};\n\nconst cartoQuadbinTableSource: TilejsonSource<CartoQuadbinTableSourceOptions> = async function (\n options: CartoQuadbinTableSourceOptions\n): Promise<any> {\n const {\n aggregationExp,\n aggregationResLevel = 6,\n columns,\n spatialDataColumn = 'quadbin:quadbin',\n tableName\n } = options;\n const urlParameters: UrlParameters = {aggregationExp, name: tableName};\n\n if (aggregationResLevel) {\n urlParameters.aggregationResLevel = String(aggregationResLevel);\n }\n if (columns) {\n urlParameters.columns = columns.join(',');\n }\n if (spatialDataColumn) {\n urlParameters.geo_column = spatialDataColumn;\n }\n return cartoBaseSource<UrlParameters>('table', options, urlParameters);\n};\n\nexport {cartoQuadbinTableSource};\n"],"file":"quadbin-table-source.js"}
@@ -0,0 +1,14 @@
1
+ import { cartoBaseSource } from './base-source';
2
+
3
+ const cartoQuadbinTilesetSource = async function (options) {
4
+ const {
5
+ tableName
6
+ } = options;
7
+ const urlParameters = {
8
+ name: tableName
9
+ };
10
+ return cartoBaseSource('tileset', options, urlParameters);
11
+ };
12
+
13
+ export { cartoQuadbinTilesetSource };
14
+ //# sourceMappingURL=quadbin-tileset-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/sources/quadbin-tileset-source.ts"],"names":["cartoBaseSource","cartoQuadbinTilesetSource","options","tableName","urlParameters","name"],"mappings":"AAAA,SAAQA,eAAR,QAA8B,eAA9B;;AAMA,MAAMC,yBAA2E,GAAG,gBAClFC,OADkF,EAEpE;AACd,QAAM;AAACC,IAAAA;AAAD,MAAcD,OAApB;AACA,QAAME,aAA4B,GAAG;AAACC,IAAAA,IAAI,EAAEF;AAAP,GAArC;AAEA,SAAOH,eAAe,CAAgB,SAAhB,EAA2BE,OAA3B,EAAoCE,aAApC,CAAtB;AACD,CAPD;;AASA,SAAQH,yBAAR","sourcesContent":["import {cartoBaseSource} from './base-source';\nimport {CartoSourceOptions, CartoTilesetSourceOptions, TilejsonSource} from './common';\n\nexport type CartoQuadbinTilesetSourceOptions = CartoSourceOptions & CartoTilesetSourceOptions;\ntype UrlParameters = {name: string};\n\nconst cartoQuadbinTilesetSource: TilejsonSource<CartoQuadbinTilesetSourceOptions> = async function (\n options: CartoQuadbinTilesetSourceOptions\n): Promise<any> {\n const {tableName} = options;\n const urlParameters: UrlParameters = {name: tableName};\n\n return cartoBaseSource<UrlParameters>('tileset', options, urlParameters);\n};\n\nexport {cartoQuadbinTilesetSource};\n"],"file":"quadbin-tileset-source.js"}
@@ -0,0 +1,14 @@
1
+ import { cartoBaseSource } from './base-source';
2
+
3
+ const cartoRasterSource = async function (options) {
4
+ const {
5
+ tableName
6
+ } = options;
7
+ const urlParameters = {
8
+ name: tableName
9
+ };
10
+ return cartoBaseSource('raster', options, urlParameters);
11
+ };
12
+
13
+ export { cartoRasterSource };
14
+ //# sourceMappingURL=raster-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/sources/raster-source.ts"],"names":["cartoBaseSource","cartoRasterSource","options","tableName","urlParameters","name"],"mappings":"AAAA,SAAQA,eAAR,QAA8B,eAA9B;;AAMA,MAAMC,iBAAwD,GAAG,gBAC/DC,OAD+D,EAEjD;AACd,QAAM;AAACC,IAAAA;AAAD,MAAcD,OAApB;AACA,QAAME,aAA4B,GAAG;AAACC,IAAAA,IAAI,EAAEF;AAAP,GAArC;AAEA,SAAOH,eAAe,CAAgB,QAAhB,EAA0BE,OAA1B,EAAmCE,aAAnC,CAAtB;AACD,CAPD;;AASA,SAAQH,iBAAR","sourcesContent":["import {cartoBaseSource} from './base-source';\nimport {CartoSourceOptions, CartoTilesetSourceOptions, TypedSource} from './common';\n\nexport type CartoRasterSourceOptions = CartoSourceOptions & CartoTilesetSourceOptions;\ntype UrlParameters = {name: string};\n\nconst cartoRasterSource: TypedSource<CartoRasterSourceOptions> = async function (\n options: CartoRasterSourceOptions\n): Promise<any> {\n const {tableName} = options;\n const urlParameters: UrlParameters = {name: tableName};\n\n return cartoBaseSource<UrlParameters>('raster', options, urlParameters);\n};\n\nexport {cartoRasterSource};\n"],"file":"raster-source.js"}
@@ -0,0 +1,69 @@
1
+ import { CartoAPIError } from '../api/carto-api-error';
2
+ import { encodeParameter } from '../api/maps-api-common';
3
+ import { DEFAULT_HEADERS, DEFAULT_PARAMETERS, MAX_GET_LENGTH } from './common';
4
+ import { buildMapsUrlFromBase } from '../config';
5
+ export async function requestWithParameters({
6
+ baseUrl,
7
+ parameters,
8
+ headers: customHeaders,
9
+ errorContext
10
+ }) {
11
+ let url = baseUrl;
12
+
13
+ if (parameters) {
14
+ const allParameters = { ...DEFAULT_PARAMETERS,
15
+ ...parameters
16
+ };
17
+ const encodedParameters = Object.entries(allParameters).map(([key, value]) => {
18
+ return encodeParameter(key, value);
19
+ });
20
+ url += "?".concat(encodedParameters.join('&'));
21
+ }
22
+
23
+ const headers = { ...DEFAULT_HEADERS,
24
+ ...customHeaders
25
+ };
26
+
27
+ try {
28
+ let response;
29
+
30
+ if (url.length > MAX_GET_LENGTH) {
31
+ response = await fetch(url, {
32
+ method: 'POST',
33
+ body: JSON.stringify(parameters),
34
+ headers
35
+ });
36
+ } else {
37
+ response = await fetch(url, {
38
+ headers
39
+ });
40
+ }
41
+
42
+ let json;
43
+
44
+ try {
45
+ json = await response.json();
46
+ } catch {
47
+ json = {
48
+ error: ''
49
+ };
50
+ }
51
+
52
+ if (!response.ok) {
53
+ throw new CartoAPIError(json.error, errorContext, response);
54
+ }
55
+
56
+ return json;
57
+ } catch (error) {
58
+ throw new CartoAPIError(error, errorContext);
59
+ }
60
+ }
61
+ export function buildApiEndpoint({
62
+ apiBaseUrl,
63
+ connectionName,
64
+ endpoint,
65
+ mapsUrl
66
+ }) {
67
+ return "".concat(mapsUrl || buildMapsUrlFromBase(apiBaseUrl), "/").concat(connectionName, "/").concat(endpoint);
68
+ }
69
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/sources/utils.ts"],"names":["CartoAPIError","encodeParameter","DEFAULT_HEADERS","DEFAULT_PARAMETERS","MAX_GET_LENGTH","buildMapsUrlFromBase","requestWithParameters","baseUrl","parameters","headers","customHeaders","errorContext","url","allParameters","encodedParameters","Object","entries","map","key","value","join","response","length","fetch","method","body","JSON","stringify","json","error","ok","buildApiEndpoint","apiBaseUrl","connectionName","endpoint","mapsUrl"],"mappings":"AAAA,SAAyBA,aAAzB,QAA6C,wBAA7C;AACA,SAAQC,eAAR,QAAuC,wBAAvC;AACA,SAAQC,eAAR,EAAyBC,kBAAzB,EAA6CC,cAA7C,QAAkE,UAAlE;AACA,SAAQC,oBAAR,QAAmC,WAAnC;AAEA,OAAO,eAAeC,qBAAf,CAA8C;AACnDC,EAAAA,OADmD;AAEnDC,EAAAA,UAFmD;AAGnDC,EAAAA,OAAO,EAAEC,aAH0C;AAInDC,EAAAA;AAJmD,CAA9C,EAUQ;AACb,MAAIC,GAAG,GAAGL,OAAV;;AACA,MAAIC,UAAJ,EAAgB;AACd,UAAMK,aAAa,GAAG,EAAC,GAAGV,kBAAJ;AAAwB,SAAGK;AAA3B,KAAtB;AACA,UAAMM,iBAAiB,GAAGC,MAAM,CAACC,OAAP,CAAeH,aAAf,EAA8BI,GAA9B,CAAkC,CAAC,CAACC,GAAD,EAAMC,KAAN,CAAD,KAAkB;AAC5E,aAAOlB,eAAe,CAACiB,GAAD,EAAMC,KAAN,CAAtB;AACD,KAFyB,CAA1B;AAGAP,IAAAA,GAAG,eAAQE,iBAAiB,CAACM,IAAlB,CAAuB,GAAvB,CAAR,CAAH;AACD;;AAED,QAAMX,OAAO,GAAG,EAAC,GAAGP,eAAJ;AAAqB,OAAGQ;AAAxB,GAAhB;;AACA,MAAI;AAEF,QAAIW,QAAJ;;AACA,QAAIT,GAAG,CAACU,MAAJ,GAAalB,cAAjB,EAAiC;AAC/BiB,MAAAA,QAAQ,GAAG,MAAME,KAAK,CAACX,GAAD,EAAM;AAACY,QAAAA,MAAM,EAAE,MAAT;AAAiBC,QAAAA,IAAI,EAAEC,IAAI,CAACC,SAAL,CAAenB,UAAf,CAAvB;AAAmDC,QAAAA;AAAnD,OAAN,CAAtB;AACD,KAFD,MAEO;AACLY,MAAAA,QAAQ,GAAG,MAAME,KAAK,CAACX,GAAD,EAAM;AAACH,QAAAA;AAAD,OAAN,CAAtB;AACD;;AACD,QAAImB,IAAJ;;AACA,QAAI;AACFA,MAAAA,IAAI,GAAG,MAAMP,QAAQ,CAACO,IAAT,EAAb;AACD,KAFD,CAEE,MAAM;AACNA,MAAAA,IAAI,GAAG;AAACC,QAAAA,KAAK,EAAE;AAAR,OAAP;AACD;;AACD,QAAI,CAACR,QAAQ,CAACS,EAAd,EAAkB;AAChB,YAAM,IAAI9B,aAAJ,CAAkB4B,IAAI,CAACC,KAAvB,EAA8BlB,YAA9B,EAA4CU,QAA5C,CAAN;AACD;;AAED,WAAOO,IAAP;AACD,GAnBD,CAmBE,OAAOC,KAAP,EAAc;AACd,UAAM,IAAI7B,aAAJ,CAAkB6B,KAAlB,EAAkClB,YAAlC,CAAN;AACD;AACF;AAED,OAAO,SAASoB,gBAAT,CAA0B;AAC/BC,EAAAA,UAD+B;AAE/BC,EAAAA,cAF+B;AAG/BC,EAAAA,QAH+B;AAI/BC,EAAAA;AAJ+B,CAA1B,EAUI;AACT,mBAAUA,OAAO,IAAI9B,oBAAoB,CAAC2B,UAAD,CAAzC,cAAyDC,cAAzD,cAA2EC,QAA3E;AACD","sourcesContent":["import {APIErrorContext, CartoAPIError} from '../api/carto-api-error';\nimport {encodeParameter, MapType} from '../api/maps-api-common';\nimport {DEFAULT_HEADERS, DEFAULT_PARAMETERS, MAX_GET_LENGTH} from './common';\nimport {buildMapsUrlFromBase} from '../config';\n\nexport async function requestWithParameters<T = any>({\n baseUrl,\n parameters,\n headers: customHeaders,\n errorContext\n}: {\n baseUrl: string;\n parameters?: Record<string, string>;\n headers: Record<string, string>;\n errorContext: APIErrorContext;\n}): Promise<T> {\n let url = baseUrl;\n if (parameters) {\n const allParameters = {...DEFAULT_PARAMETERS, ...parameters};\n const encodedParameters = Object.entries(allParameters).map(([key, value]) => {\n return encodeParameter(key, value);\n });\n url += `?${encodedParameters.join('&')}`;\n }\n\n const headers = {...DEFAULT_HEADERS, ...customHeaders};\n try {\n /* global fetch */\n let response: Response;\n if (url.length > MAX_GET_LENGTH) {\n response = await fetch(url, {method: 'POST', body: JSON.stringify(parameters), headers});\n } else {\n response = await fetch(url, {headers});\n }\n let json: any;\n try {\n json = await response.json();\n } catch {\n json = {error: ''};\n }\n if (!response.ok) {\n throw new CartoAPIError(json.error, errorContext, response);\n }\n\n return json;\n } catch (error) {\n throw new CartoAPIError(error as Error, errorContext);\n }\n}\n\nexport function buildApiEndpoint({\n apiBaseUrl,\n connectionName,\n endpoint,\n mapsUrl\n}: {\n apiBaseUrl: string;\n connectionName: string;\n endpoint: MapType;\n mapsUrl?: string;\n}): string {\n return `${mapsUrl || buildMapsUrlFromBase(apiBaseUrl)}/${connectionName}/${endpoint}`;\n}\n"],"file":"utils.js"}
@@ -0,0 +1,25 @@
1
+ import { cartoBaseSource } from './base-source';
2
+
3
+ const cartoVectorQuerySource = async function (options) {
4
+ const {
5
+ spatialDataColumn,
6
+ sqlQuery,
7
+ queryParameters
8
+ } = options;
9
+ const urlParameters = {
10
+ q: sqlQuery
11
+ };
12
+
13
+ if (spatialDataColumn) {
14
+ urlParameters.geo_column = spatialDataColumn;
15
+ }
16
+
17
+ if (queryParameters) {
18
+ urlParameters.queryParameters = JSON.stringify(queryParameters);
19
+ }
20
+
21
+ return cartoBaseSource('query', options, urlParameters);
22
+ };
23
+
24
+ export { cartoVectorQuerySource };
25
+ //# sourceMappingURL=vector-query-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/sources/vector-query-source.ts"],"names":["cartoBaseSource","cartoVectorQuerySource","options","spatialDataColumn","sqlQuery","queryParameters","urlParameters","q","geo_column","JSON","stringify"],"mappings":"AACA,SAAQA,eAAR,QAA8B,eAA9B;;AAMA,MAAMC,sBAAkE,GAAG,gBACzEC,OADyE,EAE3D;AACd,QAAM;AAACC,IAAAA,iBAAD;AAAoBC,IAAAA,QAApB;AAA8BC,IAAAA;AAA9B,MAAiDH,OAAvD;AACA,QAAMI,aAA4B,GAAG;AAACC,IAAAA,CAAC,EAAEH;AAAJ,GAArC;;AAEA,MAAID,iBAAJ,EAAuB;AACrBG,IAAAA,aAAa,CAACE,UAAd,GAA2BL,iBAA3B;AACD;;AACD,MAAIE,eAAJ,EAAqB;AACnBC,IAAAA,aAAa,CAACD,eAAd,GAAgCI,IAAI,CAACC,SAAL,CAAeL,eAAf,CAAhC;AACD;;AACD,SAAOL,eAAe,CAAgB,OAAhB,EAAyBE,OAAzB,EAAkCI,aAAlC,CAAtB;AACD,CAbD;;AAeA,SAAQL,sBAAR","sourcesContent":["/* eslint-disable camelcase */\nimport {cartoBaseSource} from './base-source';\nimport {CartoSourceOptions, CartoQuerySourceOptions, TypedSource} from './common';\n\nexport type CartoVectorQuerySourceOptions = CartoSourceOptions & CartoQuerySourceOptions;\ntype UrlParameters = {geo_column?: string; q: string; queryParameters?: string};\n\nconst cartoVectorQuerySource: TypedSource<CartoVectorQuerySourceOptions> = async function (\n options: CartoVectorQuerySourceOptions\n): Promise<any> {\n const {spatialDataColumn, sqlQuery, queryParameters} = options;\n const urlParameters: UrlParameters = {q: sqlQuery};\n\n if (spatialDataColumn) {\n urlParameters.geo_column = spatialDataColumn;\n }\n if (queryParameters) {\n urlParameters.queryParameters = JSON.stringify(queryParameters);\n }\n return cartoBaseSource<UrlParameters>('query', options, urlParameters);\n};\n\nexport {cartoVectorQuerySource};\n"],"file":"vector-query-source.js"}
@@ -0,0 +1,25 @@
1
+ import { cartoBaseSource } from './base-source';
2
+
3
+ const cartoVectorTableSource = async function (options) {
4
+ const {
5
+ columns,
6
+ spatialDataColumn,
7
+ tableName
8
+ } = options;
9
+ const urlParameters = {
10
+ name: tableName
11
+ };
12
+
13
+ if (columns) {
14
+ urlParameters.columns = columns.join(',');
15
+ }
16
+
17
+ if (spatialDataColumn) {
18
+ urlParameters.geo_column = spatialDataColumn;
19
+ }
20
+
21
+ return cartoBaseSource('table', options, urlParameters);
22
+ };
23
+
24
+ export { cartoVectorTableSource };
25
+ //# sourceMappingURL=vector-table-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/sources/vector-table-source.ts"],"names":["cartoBaseSource","cartoVectorTableSource","options","columns","spatialDataColumn","tableName","urlParameters","name","join","geo_column"],"mappings":"AACA,SAAQA,eAAR,QAA8B,eAA9B;;AAMA,MAAMC,sBAAkE,GAAG,gBACzEC,OADyE,EAE3D;AACd,QAAM;AAACC,IAAAA,OAAD;AAAUC,IAAAA,iBAAV;AAA6BC,IAAAA;AAA7B,MAA0CH,OAAhD;AACA,QAAMI,aAA4B,GAAG;AAACC,IAAAA,IAAI,EAAEF;AAAP,GAArC;;AAEA,MAAIF,OAAJ,EAAa;AACXG,IAAAA,aAAa,CAACH,OAAd,GAAwBA,OAAO,CAACK,IAAR,CAAa,GAAb,CAAxB;AACD;;AACD,MAAIJ,iBAAJ,EAAuB;AACrBE,IAAAA,aAAa,CAACG,UAAd,GAA2BL,iBAA3B;AACD;;AACD,SAAOJ,eAAe,CAAgB,OAAhB,EAAyBE,OAAzB,EAAkCI,aAAlC,CAAtB;AACD,CAbD;;AAeA,SAAQL,sBAAR","sourcesContent":["/* eslint-disable camelcase */\nimport {cartoBaseSource} from './base-source';\nimport {CartoSourceOptions, CartoTableSourceOptions, TypedSource} from './common';\n\nexport type CartoVectorTableSourceOptions = CartoSourceOptions & CartoTableSourceOptions;\ntype UrlParameters = {columns?: string; geo_column?: string; name: string};\n\nconst cartoVectorTableSource: TypedSource<CartoVectorTableSourceOptions> = async function (\n options: CartoVectorTableSourceOptions\n): Promise<any> {\n const {columns, spatialDataColumn, tableName} = options;\n const urlParameters: UrlParameters = {name: tableName};\n\n if (columns) {\n urlParameters.columns = columns.join(',');\n }\n if (spatialDataColumn) {\n urlParameters.geo_column = spatialDataColumn;\n }\n return cartoBaseSource<UrlParameters>('table', options, urlParameters);\n};\n\nexport {cartoVectorTableSource};\n"],"file":"vector-table-source.js"}
@@ -0,0 +1,14 @@
1
+ import { cartoBaseSource } from './base-source';
2
+
3
+ const cartoVectorTilesetSource = async function (options) {
4
+ const {
5
+ tableName
6
+ } = options;
7
+ const urlParameters = {
8
+ name: tableName
9
+ };
10
+ return cartoBaseSource('tileset', options, urlParameters);
11
+ };
12
+
13
+ export { cartoVectorTilesetSource };
14
+ //# sourceMappingURL=vector-tileset-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/sources/vector-tileset-source.ts"],"names":["cartoBaseSource","cartoVectorTilesetSource","options","tableName","urlParameters","name"],"mappings":"AAAA,SAAQA,eAAR,QAA8B,eAA9B;;AAMA,MAAMC,wBAAyE,GAAG,gBAChFC,OADgF,EAElE;AACd,QAAM;AAACC,IAAAA;AAAD,MAAcD,OAApB;AACA,QAAME,aAA4B,GAAG;AAACC,IAAAA,IAAI,EAAEF;AAAP,GAArC;AAEA,SAAOH,eAAe,CAAgB,SAAhB,EAA2BE,OAA3B,EAAoCE,aAApC,CAAtB;AACD,CAPD;;AASA,SAAQH,wBAAR","sourcesContent":["import {cartoBaseSource} from './base-source';\nimport {CartoSourceOptions, CartoTilesetSourceOptions, TilejsonSource} from './common';\n\nexport type CartoVectorTilesetSourceOptions = CartoSourceOptions & CartoTilesetSourceOptions;\ntype UrlParameters = {name: string};\n\nconst cartoVectorTilesetSource: TilejsonSource<CartoVectorTilesetSourceOptions> = async function (\n options: CartoVectorTilesetSourceOptions\n): Promise<any> {\n const {tableName} = options;\n const urlParameters: UrlParameters = {name: tableName};\n\n return cartoBaseSource<UrlParameters>('tileset', options, urlParameters);\n};\n\nexport {cartoVectorTilesetSource};\n"],"file":"vector-tileset-source.js"}
package/dist/esm/utils.js CHANGED
@@ -22,4 +22,7 @@ export function createBinaryProxy(data, index) {
22
22
 
23
23
  });
24
24
  }
25
+ export function getWorkerUrl(id, version) {
26
+ return "https://unpkg.com/@deck.gl/carto@".concat(version, "/dist/").concat(id, "-worker.js");
27
+ }
25
28
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils.ts"],"names":["log","assert","condition","message","createBinaryProxy","data","index","properties","numericProps","Proxy","get","target","property","receiver","value","has"],"mappings":"AAAA,SAAQA,GAAR,QAAkB,eAAlB;AAGA,OAAO,SAASC,MAAT,CAAgBC,SAAhB,EAAoCC,OAApC,EAAyE;AAC9EH,EAAAA,GAAG,CAACC,MAAJ,CAAWC,SAAX,EAAsBC,OAAtB;AACD;AAID,OAAO,SAASC,iBAAT,CACLC,IADK,EAELC,KAFK,EAGL;AACA,QAAM;AAACC,IAAAA,UAAD;AAAaC,IAAAA;AAAb,MAA6BH,IAAnC;AACA,SAAO,IAAII,KAAJ,CAAUF,UAAU,CAACD,KAAD,CAAV,IAAqB,EAA/B,EAAmC;AACxCI,IAAAA,GAAG,CAACC,MAAD,EAASC,QAAT,EAAmBC,QAAnB,EAA6B;AAC9B,UAAID,QAAQ,IAAIJ,YAAhB,EAA8B;AAC5B,eAAOA,YAAY,CAACI,QAAD,CAAZ,CAAiCE,KAAjC,CAAuCR,KAAvC,CAAP;AACD;;AACD,aAAOK,MAAM,CAACC,QAAD,CAAb;AACD,KANuC;;AAQxCG,IAAAA,GAAG,CAACJ,MAAD,EAASC,QAAT,EAAmB;AACpB,aAAOA,QAAQ,IAAIJ,YAAZ,IAA4BI,QAAQ,IAAID,MAA/C;AACD;;AAVuC,GAAnC,CAAP;AAYD","sourcesContent":["import {log} from '@deck.gl/core';\nimport type {Properties, NumericProps} from './layers/schema/spatialjson-utils';\n\nexport function assert(condition: unknown, message?: string): asserts condition {\n log.assert(condition, message);\n}\n\n// Returns a Proxy object that allows accessing binary data\n// as if it were JSON properties\nexport function createBinaryProxy(\n data: {numericProps: NumericProps; properties: Properties[]},\n index: number\n) {\n const {properties, numericProps} = data;\n return new Proxy(properties[index] || {}, {\n get(target, property, receiver) {\n if (property in numericProps) {\n return numericProps[property as string].value[index];\n }\n return target[property as string];\n },\n\n has(target, property) {\n return property in numericProps || property in target;\n }\n });\n}\n"],"file":"utils.js"}
1
+ {"version":3,"sources":["../../src/utils.ts"],"names":["log","assert","condition","message","createBinaryProxy","data","index","properties","numericProps","Proxy","get","target","property","receiver","value","has","getWorkerUrl","id","version"],"mappings":"AAAA,SAAQA,GAAR,QAAkB,eAAlB;AAGA,OAAO,SAASC,MAAT,CAAgBC,SAAhB,EAAoCC,OAApC,EAAyE;AAC9EH,EAAAA,GAAG,CAACC,MAAJ,CAAWC,SAAX,EAAsBC,OAAtB;AACD;AAID,OAAO,SAASC,iBAAT,CACLC,IADK,EAELC,KAFK,EAGL;AACA,QAAM;AAACC,IAAAA,UAAD;AAAaC,IAAAA;AAAb,MAA6BH,IAAnC;AACA,SAAO,IAAII,KAAJ,CAAUF,UAAU,CAACD,KAAD,CAAV,IAAqB,EAA/B,EAAmC;AACxCI,IAAAA,GAAG,CAACC,MAAD,EAASC,QAAT,EAAmBC,QAAnB,EAA6B;AAC9B,UAAID,QAAQ,IAAIJ,YAAhB,EAA8B;AAC5B,eAAOA,YAAY,CAACI,QAAD,CAAZ,CAAiCE,KAAjC,CAAuCR,KAAvC,CAAP;AACD;;AACD,aAAOK,MAAM,CAACC,QAAD,CAAb;AACD,KANuC;;AAQxCG,IAAAA,GAAG,CAACJ,MAAD,EAASC,QAAT,EAAmB;AACpB,aAAOA,QAAQ,IAAIJ,YAAZ,IAA4BI,QAAQ,IAAID,MAA/C;AACD;;AAVuC,GAAnC,CAAP;AAYD;AAED,OAAO,SAASK,YAAT,CAAsBC,EAAtB,EAAkCC,OAAlC,EAAmD;AAGxD,oDAA2CA,OAA3C,mBAA2DD,EAA3D;AACD","sourcesContent":["import {log} from '@deck.gl/core';\nimport type {Properties, NumericProps} from './layers/schema/spatialjson-utils';\n\nexport function assert(condition: unknown, message?: string): asserts condition {\n log.assert(condition, message);\n}\n\n// Returns a Proxy object that allows accessing binary data\n// as if it were JSON properties\nexport function createBinaryProxy(\n data: {numericProps: NumericProps; properties: Properties[]},\n index: number\n) {\n const {properties, numericProps} = data;\n return new Proxy(properties[index] || {}, {\n get(target, property, receiver) {\n if (property in numericProps) {\n return numericProps[property as string].value[index];\n }\n return target[property as string];\n },\n\n has(target, property) {\n return property in numericProps || property in target;\n }\n });\n}\n\nexport function getWorkerUrl(id: string, version: string) {\n // For local testing `yarn build-workers` and then host `modules/carto/dist/`\n // return `http://localhost:8081/dist/${id}-worker.js`;\n return `https://unpkg.com/@deck.gl/carto@${version}/dist/${id}-worker.js`;\n}\n"],"file":"utils.js"}
@@ -0,0 +1,4 @@
1
+ import { createLoaderWorker } from '@loaders.gl/loader-utils';
2
+ import CartoRasterTileLoader from '../layers/schema/carto-raster-tile-loader';
3
+ createLoaderWorker(CartoRasterTileLoader);
4
+ //# sourceMappingURL=cartoRasterTile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/workers/cartoRasterTile.ts"],"names":["createLoaderWorker","CartoRasterTileLoader"],"mappings":"AAAA,SAAQA,kBAAR,QAAiC,0BAAjC;AACA,OAAOC,qBAAP,MAAkC,2CAAlC;AAEAD,kBAAkB,CAACC,qBAAD,CAAlB","sourcesContent":["import {createLoaderWorker} from '@loaders.gl/loader-utils';\nimport CartoRasterTileLoader from '../layers/schema/carto-raster-tile-loader';\n\ncreateLoaderWorker(CartoRasterTileLoader);\n"],"file":"cartoRasterTile.js"}
@@ -0,0 +1,4 @@
1
+ import { createLoaderWorker } from '@loaders.gl/loader-utils';
2
+ import CartoSpatialTileLoader from '../layers/schema/carto-spatial-tile-loader';
3
+ createLoaderWorker(CartoSpatialTileLoader);
4
+ //# sourceMappingURL=cartoSpatialTile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/workers/cartoSpatialTile.ts"],"names":["createLoaderWorker","CartoSpatialTileLoader"],"mappings":"AAAA,SAAQA,kBAAR,QAAiC,0BAAjC;AACA,OAAOC,sBAAP,MAAmC,4CAAnC;AAEAD,kBAAkB,CAACC,sBAAD,CAAlB","sourcesContent":["import {createLoaderWorker} from '@loaders.gl/loader-utils';\nimport CartoSpatialTileLoader from '../layers/schema/carto-spatial-tile-loader';\n\ncreateLoaderWorker(CartoSpatialTileLoader);\n"],"file":"cartoSpatialTile.js"}
@@ -0,0 +1,4 @@
1
+ import { createLoaderWorker } from '@loaders.gl/loader-utils';
2
+ import CartoVectorTileLoader from '../layers/schema/carto-vector-tile-loader';
3
+ createLoaderWorker(CartoVectorTileLoader);
4
+ //# sourceMappingURL=cartoVectorTile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/workers/cartoVectorTile.ts"],"names":["createLoaderWorker","CartoVectorTileLoader"],"mappings":"AAAA,SAAQA,kBAAR,QAAiC,0BAAjC;AACA,OAAOC,qBAAP,MAAkC,2CAAlC;AAEAD,kBAAkB,CAACC,qBAAD,CAAlB","sourcesContent":["import {createLoaderWorker} from '@loaders.gl/loader-utils';\nimport CartoVectorTileLoader from '../layers/schema/carto-vector-tile-loader';\n\ncreateLoaderWorker(CartoVectorTileLoader);\n"],"file":"cartoVectorTile.js"}