@deck.gl/carto 9.0.0-beta.1 → 9.0.0-beta.11
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.
- package/{typed → dist}/api/carto-api-error.d.ts +1 -1
- package/dist/api/carto-api-error.d.ts.map +1 -0
- package/dist/api/carto-api-error.js +47 -0
- package/{typed → dist}/api/common.d.ts +2 -2
- package/{typed → dist}/api/common.d.ts.map +1 -1
- package/dist/{esm/api → api}/common.js +6 -6
- package/{typed → dist}/api/endpoints.d.ts +1 -1
- package/dist/api/endpoints.d.ts.map +1 -0
- package/dist/api/endpoints.js +22 -0
- package/{typed → dist}/api/fetch-map.d.ts.map +1 -1
- package/dist/api/fetch-map.js +196 -0
- package/dist/api/index.d.ts +7 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +3 -0
- package/{typed → dist}/api/layer-map.d.ts +6 -6
- package/dist/api/layer-map.d.ts.map +1 -0
- package/dist/api/layer-map.js +373 -0
- package/dist/api/parse-map.js +250 -0
- package/{typed → dist}/api/query.d.ts +1 -1
- package/dist/api/query.d.ts.map +1 -0
- package/dist/api/query.js +24 -0
- package/dist/api/request-with-parameters.d.ts +8 -0
- package/dist/api/request-with-parameters.d.ts.map +1 -0
- package/dist/api/request-with-parameters.js +50 -0
- package/{typed → dist}/api/types.d.ts +18 -1
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +20 -0
- package/dist/basemap.js +9 -0
- package/dist/cartoRasterTile-worker.js +22 -58
- package/dist/cartoSpatialTile-worker.js +19 -52
- package/dist/cartoVectorTile-worker.js +19 -52
- package/dist/constants.d.ts +5 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +4 -0
- package/dist/dist.dev.js +2001 -1714
- package/dist/index.cjs +2721 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/{typed → dist}/layers/h3-tile-layer.d.ts +2 -2
- package/dist/layers/h3-tile-layer.d.ts.map +1 -0
- package/dist/layers/h3-tile-layer.js +66 -0
- package/{typed → dist}/layers/h3-tileset-2d.d.ts +4 -1
- package/dist/layers/h3-tileset-2d.d.ts.map +1 -0
- package/dist/layers/h3-tileset-2d.js +120 -0
- package/dist/layers/point-label-layer.js +150 -0
- package/dist/layers/quadbin-layer.js +21 -0
- package/{typed → dist}/layers/quadbin-tile-layer.d.ts +3 -3
- package/dist/layers/quadbin-tile-layer.d.ts.map +1 -0
- package/dist/layers/quadbin-tile-layer.js +49 -0
- package/dist/layers/quadbin-tileset-2d.js +27 -0
- package/dist/layers/quadbin-utils.js +21 -0
- package/dist/layers/raster-layer-vertex.glsl.d.ts +3 -0
- package/dist/layers/raster-layer-vertex.glsl.js +68 -0
- package/{typed → dist}/layers/raster-layer.d.ts.map +1 -1
- package/dist/layers/raster-layer.js +95 -0
- package/{typed → dist}/layers/raster-tile-layer.d.ts +3 -3
- package/dist/layers/raster-tile-layer.d.ts.map +1 -0
- package/dist/layers/raster-tile-layer.js +45 -0
- package/dist/layers/schema/carto-properties-tile-loader.js +21 -0
- package/{typed → dist}/layers/schema/carto-properties-tile.d.ts +1 -1
- package/dist/layers/schema/carto-properties-tile.d.ts.map +1 -0
- package/dist/layers/schema/carto-properties-tile.js +14 -0
- package/{typed → dist}/layers/schema/carto-raster-tile-loader.d.ts +3 -3
- package/dist/layers/schema/carto-raster-tile-loader.d.ts.map +1 -0
- package/dist/layers/schema/carto-raster-tile-loader.js +35 -0
- package/{typed → dist}/layers/schema/carto-raster-tile.d.ts.map +1 -1
- package/dist/layers/schema/carto-raster-tile.js +44 -0
- package/dist/layers/schema/carto-spatial-tile-loader.js +35 -0
- package/{typed → dist}/layers/schema/carto-spatial-tile.d.ts +2 -2
- package/dist/layers/schema/carto-spatial-tile.d.ts.map +1 -0
- package/dist/layers/schema/carto-spatial-tile.js +38 -0
- package/dist/layers/schema/carto-tile.js +187 -0
- package/dist/layers/schema/carto-vector-tile-loader.js +65 -0
- package/dist/layers/schema/fast-pbf.js +7 -0
- package/dist/layers/schema/spatialjson-utils.js +15 -0
- package/dist/layers/schema/tile-loader-utils.js +6 -0
- package/{typed → dist}/layers/spatial-index-tile-layer.d.ts +1 -1
- package/{typed → dist}/layers/spatial-index-tile-layer.d.ts.map +1 -1
- package/dist/layers/spatial-index-tile-layer.js +67 -0
- package/{typed → dist}/layers/utils.d.ts +3 -3
- package/dist/layers/utils.d.ts.map +1 -0
- package/dist/layers/utils.js +74 -0
- package/{typed → dist}/layers/vector-tile-layer.d.ts +6 -5
- package/dist/layers/vector-tile-layer.d.ts.map +1 -0
- package/dist/layers/vector-tile-layer.js +106 -0
- package/{typed → dist}/sources/base-source.d.ts +2 -2
- package/dist/sources/base-source.d.ts.map +1 -0
- package/dist/sources/base-source.js +56 -0
- package/dist/sources/boundary-query-source.d.ts +11 -0
- package/dist/sources/boundary-query-source.d.ts.map +1 -0
- package/dist/sources/boundary-query-source.js +19 -0
- package/{typed → dist}/sources/boundary-table-source.d.ts +2 -2
- package/dist/sources/boundary-table-source.d.ts.map +1 -0
- package/dist/sources/boundary-table-source.js +16 -0
- package/{typed → dist}/sources/h3-query-source.d.ts +1 -1
- package/dist/sources/h3-query-source.d.ts.map +1 -0
- package/dist/sources/h3-query-source.js +19 -0
- package/{typed → dist}/sources/h3-table-source.d.ts +1 -1
- package/dist/sources/h3-table-source.d.ts.map +1 -0
- package/dist/sources/h3-table-source.js +16 -0
- package/{typed → dist}/sources/h3-tileset-source.d.ts +1 -1
- package/dist/sources/h3-tileset-source.d.ts.map +1 -0
- package/dist/sources/h3-tileset-source.js +6 -0
- package/dist/sources/index.d.ts +28 -0
- package/dist/sources/index.d.ts.map +1 -0
- package/dist/sources/index.js +13 -0
- package/{typed → dist}/sources/quadbin-query-source.d.ts +1 -1
- package/dist/sources/quadbin-query-source.d.ts.map +1 -0
- package/dist/sources/quadbin-query-source.js +19 -0
- package/{typed → dist}/sources/quadbin-table-source.d.ts +1 -1
- package/dist/sources/quadbin-table-source.d.ts.map +1 -0
- package/dist/sources/quadbin-table-source.js +16 -0
- package/{typed → dist}/sources/quadbin-tileset-source.d.ts +1 -1
- package/{typed → dist}/sources/quadbin-tileset-source.d.ts.map +1 -1
- package/dist/sources/quadbin-tileset-source.js +6 -0
- package/{typed → dist}/sources/raster-source.d.ts +1 -1
- package/dist/sources/raster-source.d.ts.map +1 -0
- package/dist/sources/raster-source.js +6 -0
- package/{typed → dist}/sources/types.d.ts +45 -7
- package/dist/sources/types.d.ts.map +1 -0
- package/dist/sources/types.js +1 -0
- package/dist/sources/vector-query-source.d.ts +4 -0
- package/dist/sources/vector-query-source.d.ts.map +1 -0
- package/dist/sources/vector-query-source.js +22 -0
- package/dist/sources/vector-table-source.d.ts +4 -0
- package/dist/sources/vector-table-source.d.ts.map +1 -0
- package/dist/sources/vector-table-source.js +19 -0
- package/{typed → dist}/sources/vector-tileset-source.d.ts +1 -1
- package/{typed → dist}/sources/vector-tileset-source.d.ts.map +1 -1
- package/dist/sources/vector-tileset-source.js +6 -0
- package/{typed → dist}/style/color-bins-style.d.ts +2 -2
- package/dist/style/color-bins-style.d.ts.map +1 -0
- package/dist/style/color-bins-style.js +21 -0
- package/{typed → dist}/style/color-categories-style.d.ts +2 -2
- package/dist/style/color-categories-style.d.ts.map +1 -0
- package/dist/style/color-categories-style.js +25 -0
- package/{typed → dist}/style/color-continuous-style.d.ts +2 -2
- package/dist/style/color-continuous-style.d.ts.map +1 -0
- package/dist/style/color-continuous-style.js +21 -0
- package/dist/style/palette.js +62 -0
- package/dist/style/utils.js +11 -0
- package/{typed → dist}/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +45 -0
- package/dist/workers/cartoRasterTile.js +3 -0
- package/dist/workers/cartoSpatialTile.js +3 -0
- package/dist/workers/cartoVectorTile.js +3 -0
- package/dist.min.js +50 -94
- package/package.json +31 -26
- package/src/api/common.ts +5 -3
- package/src/api/fetch-map.ts +13 -4
- package/src/api/query.ts +1 -1
- package/src/api/request-with-parameters.ts +46 -38
- package/src/api/types.ts +20 -0
- package/src/constants.ts +5 -0
- package/src/index.ts +11 -7
- package/src/layers/h3-tile-layer.ts +5 -3
- package/src/layers/h3-tileset-2d.ts +56 -26
- package/src/layers/quadbin-tile-layer.ts +3 -1
- package/src/layers/raster-layer-vertex.glsl.ts +2 -2
- package/src/layers/raster-layer.ts +10 -16
- package/src/layers/raster-tile-layer.ts +3 -1
- package/src/layers/schema/carto-raster-tile-loader.ts +5 -5
- package/src/layers/schema/carto-raster-tile.ts +3 -4
- package/src/layers/spatial-index-tile-layer.ts +7 -3
- package/src/layers/vector-tile-layer.ts +19 -8
- package/src/sources/base-source.ts +9 -5
- package/src/sources/boundary-query-source.ts +27 -9
- package/src/sources/boundary-table-source.ts +13 -8
- package/src/sources/h3-query-source.ts +2 -1
- package/src/sources/h3-table-source.ts +2 -6
- package/src/sources/index.ts +7 -0
- package/src/sources/quadbin-query-source.ts +2 -1
- package/src/sources/quadbin-table-source.ts +2 -6
- package/src/sources/types.ts +49 -7
- package/src/sources/vector-query-source.ts +38 -4
- package/src/sources/vector-table-source.ts +32 -4
- package/src/utils.ts +5 -1
- package/dist/es5/api/carto-api-error.js +0 -83
- package/dist/es5/api/carto-api-error.js.map +0 -1
- package/dist/es5/api/common.js +0 -25
- package/dist/es5/api/common.js.map +0 -1
- package/dist/es5/api/endpoints.js +0 -61
- package/dist/es5/api/endpoints.js.map +0 -1
- package/dist/es5/api/fetch-map.js +0 -566
- package/dist/es5/api/fetch-map.js.map +0 -1
- package/dist/es5/api/index.js +0 -30
- package/dist/es5/api/index.js.map +0 -1
- package/dist/es5/api/layer-map.js +0 -634
- package/dist/es5/api/layer-map.js.map +0 -1
- package/dist/es5/api/parse-map.js +0 -347
- package/dist/es5/api/parse-map.js.map +0 -1
- package/dist/es5/api/query.js +0 -81
- package/dist/es5/api/query.js.map +0 -1
- package/dist/es5/api/request-with-parameters.js +0 -150
- package/dist/es5/api/request-with-parameters.js.map +0 -1
- package/dist/es5/api/types.js +0 -21
- package/dist/es5/api/types.js.map +0 -1
- package/dist/es5/basemap.js +0 -17
- package/dist/es5/basemap.js.map +0 -1
- package/dist/es5/index.js +0 -205
- package/dist/es5/index.js.map +0 -1
- package/dist/es5/layers/h3-tile-layer.js +0 -128
- package/dist/es5/layers/h3-tile-layer.js.map +0 -1
- package/dist/es5/layers/h3-tileset-2d.js +0 -172
- package/dist/es5/layers/h3-tileset-2d.js.map +0 -1
- package/dist/es5/layers/point-label-layer.js +0 -263
- package/dist/es5/layers/point-label-layer.js.map +0 -1
- package/dist/es5/layers/quadbin-layer.js +0 -72
- package/dist/es5/layers/quadbin-layer.js.map +0 -1
- package/dist/es5/layers/quadbin-tile-layer.js +0 -103
- package/dist/es5/layers/quadbin-tile-layer.js.map +0 -1
- package/dist/es5/layers/quadbin-tileset-2d.js +0 -76
- package/dist/es5/layers/quadbin-tileset-2d.js.map +0 -1
- package/dist/es5/layers/quadbin-utils.js +0 -60
- package/dist/es5/layers/quadbin-utils.js.map +0 -1
- package/dist/es5/layers/raster-layer-vertex.glsl.js +0 -9
- package/dist/es5/layers/raster-layer-vertex.glsl.js.map +0 -1
- package/dist/es5/layers/raster-layer.js +0 -174
- package/dist/es5/layers/raster-layer.js.map +0 -1
- package/dist/es5/layers/raster-tile-layer.js +0 -91
- package/dist/es5/layers/raster-tile-layer.js.map +0 -1
- package/dist/es5/layers/schema/carto-properties-tile-loader.js +0 -60
- package/dist/es5/layers/schema/carto-properties-tile-loader.js.map +0 -1
- package/dist/es5/layers/schema/carto-properties-tile.js +0 -38
- package/dist/es5/layers/schema/carto-properties-tile.js.map +0 -1
- package/dist/es5/layers/schema/carto-raster-tile-loader.js +0 -89
- package/dist/es5/layers/schema/carto-raster-tile-loader.js.map +0 -1
- package/dist/es5/layers/schema/carto-raster-tile.js +0 -79
- package/dist/es5/layers/schema/carto-raster-tile.js.map +0 -1
- package/dist/es5/layers/schema/carto-spatial-tile-loader.js +0 -81
- package/dist/es5/layers/schema/carto-spatial-tile-loader.js.map +0 -1
- package/dist/es5/layers/schema/carto-spatial-tile.js +0 -80
- package/dist/es5/layers/schema/carto-spatial-tile.js.map +0 -1
- package/dist/es5/layers/schema/carto-tile.js +0 -269
- package/dist/es5/layers/schema/carto-tile.js.map +0 -1
- package/dist/es5/layers/schema/carto-vector-tile-loader.js +0 -120
- package/dist/es5/layers/schema/carto-vector-tile-loader.js.map +0 -1
- package/dist/es5/layers/schema/fast-pbf.js +0 -14
- package/dist/es5/layers/schema/fast-pbf.js.map +0 -1
- package/dist/es5/layers/schema/spatialjson-utils.js +0 -42
- package/dist/es5/layers/schema/spatialjson-utils.js.map +0 -1
- package/dist/es5/layers/schema/tile-loader-utils.js +0 -17
- package/dist/es5/layers/schema/tile-loader-utils.js.map +0 -1
- package/dist/es5/layers/spatial-index-tile-layer.js +0 -126
- package/dist/es5/layers/spatial-index-tile-layer.js.map +0 -1
- package/dist/es5/layers/utils.js +0 -131
- package/dist/es5/layers/utils.js.map +0 -1
- package/dist/es5/layers/vector-tile-layer.js +0 -248
- package/dist/es5/layers/vector-tile-layer.js.map +0 -1
- package/dist/es5/sources/base-source.js +0 -128
- package/dist/es5/sources/base-source.js.map +0 -1
- package/dist/es5/sources/boundary-query-source.js +0 -51
- package/dist/es5/sources/boundary-query-source.js.map +0 -1
- package/dist/es5/sources/boundary-table-source.js +0 -51
- package/dist/es5/sources/boundary-table-source.js.map +0 -1
- package/dist/es5/sources/h3-query-source.js +0 -56
- package/dist/es5/sources/h3-query-source.js.map +0 -1
- package/dist/es5/sources/h3-table-source.js +0 -56
- package/dist/es5/sources/h3-table-source.js.map +0 -1
- package/dist/es5/sources/h3-tileset-source.js +0 -43
- package/dist/es5/sources/h3-tileset-source.js.map +0 -1
- package/dist/es5/sources/index.js +0 -110
- package/dist/es5/sources/index.js.map +0 -1
- package/dist/es5/sources/quadbin-query-source.js +0 -56
- package/dist/es5/sources/quadbin-query-source.js.map +0 -1
- package/dist/es5/sources/quadbin-table-source.js +0 -56
- package/dist/es5/sources/quadbin-table-source.js.map +0 -1
- package/dist/es5/sources/quadbin-tileset-source.js +0 -43
- package/dist/es5/sources/quadbin-tileset-source.js.map +0 -1
- package/dist/es5/sources/raster-source.js +0 -43
- package/dist/es5/sources/raster-source.js.map +0 -1
- package/dist/es5/sources/types.js +0 -2
- package/dist/es5/sources/types.js.map +0 -1
- package/dist/es5/sources/vector-query-source.js +0 -51
- package/dist/es5/sources/vector-query-source.js.map +0 -1
- package/dist/es5/sources/vector-table-source.js +0 -51
- package/dist/es5/sources/vector-table-source.js.map +0 -1
- package/dist/es5/sources/vector-tileset-source.js +0 -43
- package/dist/es5/sources/vector-tileset-source.js.map +0 -1
- package/dist/es5/style/color-bins-style.js +0 -37
- package/dist/es5/style/color-bins-style.js.map +0 -1
- package/dist/es5/style/color-categories-style.js +0 -65
- package/dist/es5/style/color-categories-style.js.map +0 -1
- package/dist/es5/style/color-continuous-style.js +0 -37
- package/dist/es5/style/color-continuous-style.js.map +0 -1
- package/dist/es5/style/palette.js +0 -81
- package/dist/es5/style/palette.js.map +0 -1
- package/dist/es5/style/utils.js +0 -28
- package/dist/es5/style/utils.js.map +0 -1
- package/dist/es5/utils.js +0 -65
- package/dist/es5/utils.js.map +0 -1
- package/dist/es5/workers/cartoRasterTile.js +0 -10
- package/dist/es5/workers/cartoRasterTile.js.map +0 -1
- package/dist/es5/workers/cartoSpatialTile.js +0 -10
- package/dist/es5/workers/cartoSpatialTile.js.map +0 -1
- package/dist/es5/workers/cartoVectorTile.js +0 -10
- package/dist/es5/workers/cartoVectorTile.js.map +0 -1
- package/dist/esm/api/carto-api-error.js +0 -46
- package/dist/esm/api/carto-api-error.js.map +0 -1
- package/dist/esm/api/common.js.map +0 -1
- package/dist/esm/api/endpoints.js +0 -41
- package/dist/esm/api/endpoints.js.map +0 -1
- package/dist/esm/api/fetch-map.js +0 -298
- package/dist/esm/api/fetch-map.js.map +0 -1
- package/dist/esm/api/index.js +0 -4
- package/dist/esm/api/index.js.map +0 -1
- package/dist/esm/api/layer-map.js +0 -520
- package/dist/esm/api/layer-map.js.map +0 -1
- package/dist/esm/api/parse-map.js +0 -343
- package/dist/esm/api/parse-map.js.map +0 -1
- package/dist/esm/api/query.js +0 -40
- package/dist/esm/api/query.js.map +0 -1
- package/dist/esm/api/request-with-parameters.js +0 -82
- package/dist/esm/api/request-with-parameters.js.map +0 -1
- package/dist/esm/api/types.js +0 -14
- package/dist/esm/api/types.js.map +0 -1
- package/dist/esm/basemap.js +0 -10
- package/dist/esm/basemap.js.map +0 -1
- package/dist/esm/index.js +0 -35
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/layers/h3-tile-layer.js +0 -77
- package/dist/esm/layers/h3-tile-layer.js.map +0 -1
- package/dist/esm/layers/h3-tileset-2d.js +0 -119
- package/dist/esm/layers/h3-tileset-2d.js.map +0 -1
- package/dist/esm/layers/point-label-layer.js +0 -194
- package/dist/esm/layers/point-label-layer.js.map +0 -1
- package/dist/esm/layers/quadbin-layer.js +0 -31
- package/dist/esm/layers/quadbin-layer.js.map +0 -1
- package/dist/esm/layers/quadbin-tile-layer.js +0 -51
- package/dist/esm/layers/quadbin-tile-layer.js.map +0 -1
- package/dist/esm/layers/quadbin-tileset-2d.js +0 -39
- package/dist/esm/layers/quadbin-tileset-2d.js.map +0 -1
- package/dist/esm/layers/quadbin-utils.js +0 -23
- package/dist/esm/layers/quadbin-utils.js.map +0 -1
- package/dist/esm/layers/raster-layer-vertex.glsl.js +0 -99
- package/dist/esm/layers/raster-layer-vertex.glsl.js.map +0 -1
- package/dist/esm/layers/raster-layer.js +0 -108
- package/dist/esm/layers/raster-layer.js.map +0 -1
- package/dist/esm/layers/raster-tile-layer.js +0 -48
- package/dist/esm/layers/raster-tile-layer.js.map +0 -1
- package/dist/esm/layers/schema/carto-properties-tile-loader.js +0 -23
- package/dist/esm/layers/schema/carto-properties-tile-loader.js.map +0 -1
- package/dist/esm/layers/schema/carto-properties-tile.js +0 -18
- package/dist/esm/layers/schema/carto-properties-tile.js.map +0 -1
- package/dist/esm/layers/schema/carto-raster-tile-loader.js +0 -54
- package/dist/esm/layers/schema/carto-raster-tile-loader.js.map +0 -1
- package/dist/esm/layers/schema/carto-raster-tile.js +0 -51
- package/dist/esm/layers/schema/carto-raster-tile.js.map +0 -1
- package/dist/esm/layers/schema/carto-spatial-tile-loader.js +0 -44
- package/dist/esm/layers/schema/carto-spatial-tile-loader.js.map +0 -1
- package/dist/esm/layers/schema/carto-spatial-tile.js +0 -47
- package/dist/esm/layers/schema/carto-spatial-tile.js.map +0 -1
- package/dist/esm/layers/schema/carto-tile.js +0 -197
- package/dist/esm/layers/schema/carto-tile.js.map +0 -1
- package/dist/esm/layers/schema/carto-vector-tile-loader.js +0 -82
- package/dist/esm/layers/schema/carto-vector-tile-loader.js.map +0 -1
- package/dist/esm/layers/schema/fast-pbf.js +0 -7
- package/dist/esm/layers/schema/fast-pbf.js.map +0 -1
- package/dist/esm/layers/schema/spatialjson-utils.js +0 -27
- package/dist/esm/layers/schema/spatialjson-utils.js.map +0 -1
- package/dist/esm/layers/schema/tile-loader-utils.js +0 -7
- package/dist/esm/layers/schema/tile-loader-utils.js.map +0 -1
- package/dist/esm/layers/spatial-index-tile-layer.js +0 -86
- package/dist/esm/layers/spatial-index-tile-layer.js.map +0 -1
- package/dist/esm/layers/utils.js +0 -85
- package/dist/esm/layers/utils.js.map +0 -1
- package/dist/esm/layers/vector-tile-layer.js +0 -143
- package/dist/esm/layers/vector-tile-layer.js.map +0 -1
- package/dist/esm/sources/base-source.js +0 -72
- package/dist/esm/sources/base-source.js.map +0 -1
- package/dist/esm/sources/boundary-query-source.js +0 -21
- package/dist/esm/sources/boundary-query-source.js.map +0 -1
- package/dist/esm/sources/boundary-table-source.js +0 -21
- package/dist/esm/sources/boundary-table-source.js.map +0 -1
- package/dist/esm/sources/h3-query-source.js +0 -27
- package/dist/esm/sources/h3-query-source.js.map +0 -1
- package/dist/esm/sources/h3-table-source.js +0 -27
- package/dist/esm/sources/h3-table-source.js.map +0 -1
- package/dist/esm/sources/h3-tileset-source.js +0 -11
- package/dist/esm/sources/h3-tileset-source.js.map +0 -1
- package/dist/esm/sources/index.js +0 -14
- package/dist/esm/sources/index.js.map +0 -1
- package/dist/esm/sources/quadbin-query-source.js +0 -27
- package/dist/esm/sources/quadbin-query-source.js.map +0 -1
- package/dist/esm/sources/quadbin-table-source.js +0 -27
- package/dist/esm/sources/quadbin-table-source.js.map +0 -1
- package/dist/esm/sources/quadbin-tileset-source.js +0 -11
- package/dist/esm/sources/quadbin-tileset-source.js.map +0 -1
- package/dist/esm/sources/raster-source.js +0 -11
- package/dist/esm/sources/raster-source.js.map +0 -1
- package/dist/esm/sources/types.js +0 -2
- package/dist/esm/sources/types.js.map +0 -1
- package/dist/esm/sources/vector-query-source.js +0 -20
- package/dist/esm/sources/vector-query-source.js.map +0 -1
- package/dist/esm/sources/vector-table-source.js +0 -20
- package/dist/esm/sources/vector-table-source.js.map +0 -1
- package/dist/esm/sources/vector-tileset-source.js +0 -11
- package/dist/esm/sources/vector-tileset-source.js.map +0 -1
- package/dist/esm/style/color-bins-style.js +0 -19
- package/dist/esm/style/color-bins-style.js.map +0 -1
- package/dist/esm/style/color-categories-style.js +0 -24
- package/dist/esm/style/color-categories-style.js.map +0 -1
- package/dist/esm/style/color-continuous-style.js +0 -19
- package/dist/esm/style/color-continuous-style.js.map +0 -1
- package/dist/esm/style/palette.js +0 -51
- package/dist/esm/style/palette.js.map +0 -1
- package/dist/esm/style/utils.js +0 -15
- package/dist/esm/style/utils.js.map +0 -1
- package/dist/esm/utils.js +0 -51
- package/dist/esm/utils.js.map +0 -1
- package/dist/esm/workers/cartoRasterTile.js +0 -4
- package/dist/esm/workers/cartoRasterTile.js.map +0 -1
- package/dist/esm/workers/cartoSpatialTile.js +0 -4
- package/dist/esm/workers/cartoSpatialTile.js.map +0 -1
- package/dist/esm/workers/cartoVectorTile.js +0 -4
- package/dist/esm/workers/cartoVectorTile.js.map +0 -1
- package/src/.DS_Store +0 -0
- package/typed/api/carto-api-error.d.ts.map +0 -1
- package/typed/api/endpoints.d.ts.map +0 -1
- package/typed/api/index.d.ts +0 -7
- package/typed/api/index.d.ts.map +0 -1
- package/typed/api/layer-map.d.ts.map +0 -1
- package/typed/api/query.d.ts.map +0 -1
- package/typed/api/request-with-parameters.d.ts +0 -9
- package/typed/api/request-with-parameters.d.ts.map +0 -1
- package/typed/api/types.d.ts.map +0 -1
- package/typed/index.d.ts +0 -37
- package/typed/index.d.ts.map +0 -1
- package/typed/layers/h3-tile-layer.d.ts.map +0 -1
- package/typed/layers/h3-tileset-2d.d.ts.map +0 -1
- package/typed/layers/quadbin-tile-layer.d.ts.map +0 -1
- package/typed/layers/raster-layer-vertex.glsl.d.ts +0 -3
- package/typed/layers/raster-tile-layer.d.ts.map +0 -1
- package/typed/layers/schema/carto-properties-tile.d.ts.map +0 -1
- package/typed/layers/schema/carto-raster-tile-loader.d.ts.map +0 -1
- package/typed/layers/schema/carto-spatial-tile.d.ts.map +0 -1
- package/typed/layers/utils.d.ts.map +0 -1
- package/typed/layers/vector-tile-layer.d.ts.map +0 -1
- package/typed/sources/base-source.d.ts.map +0 -1
- package/typed/sources/boundary-query-source.d.ts +0 -10
- package/typed/sources/boundary-query-source.d.ts.map +0 -1
- package/typed/sources/boundary-table-source.d.ts.map +0 -1
- package/typed/sources/h3-query-source.d.ts.map +0 -1
- package/typed/sources/h3-table-source.d.ts.map +0 -1
- package/typed/sources/h3-tileset-source.d.ts.map +0 -1
- package/typed/sources/index.d.ts +0 -27
- package/typed/sources/index.d.ts.map +0 -1
- package/typed/sources/quadbin-query-source.d.ts.map +0 -1
- package/typed/sources/quadbin-table-source.d.ts.map +0 -1
- package/typed/sources/raster-source.d.ts.map +0 -1
- package/typed/sources/types.d.ts.map +0 -1
- package/typed/sources/vector-query-source.d.ts +0 -4
- package/typed/sources/vector-query-source.d.ts.map +0 -1
- package/typed/sources/vector-table-source.d.ts +0 -4
- package/typed/sources/vector-table-source.d.ts.map +0 -1
- package/typed/style/color-bins-style.d.ts.map +0 -1
- package/typed/style/color-categories-style.d.ts.map +0 -1
- package/typed/style/color-continuous-style.d.ts.map +0 -1
- package/typed/utils.d.ts.map +0 -1
- /package/{typed → dist}/api/fetch-map.d.ts +0 -0
- /package/{typed → dist}/api/parse-map.d.ts +0 -0
- /package/{typed → dist}/api/parse-map.d.ts.map +0 -0
- /package/{typed → dist}/basemap.d.ts +0 -0
- /package/{typed → dist}/basemap.d.ts.map +0 -0
- /package/{typed → dist}/layers/point-label-layer.d.ts +0 -0
- /package/{typed → dist}/layers/point-label-layer.d.ts.map +0 -0
- /package/{typed → dist}/layers/quadbin-layer.d.ts +0 -0
- /package/{typed → dist}/layers/quadbin-layer.d.ts.map +0 -0
- /package/{typed → dist}/layers/quadbin-tileset-2d.d.ts +0 -0
- /package/{typed → dist}/layers/quadbin-tileset-2d.d.ts.map +0 -0
- /package/{typed → dist}/layers/quadbin-utils.d.ts +0 -0
- /package/{typed → dist}/layers/quadbin-utils.d.ts.map +0 -0
- /package/{typed → dist}/layers/raster-layer-vertex.glsl.d.ts.map +0 -0
- /package/{typed → dist}/layers/raster-layer.d.ts +0 -0
- /package/{typed → dist}/layers/schema/carto-properties-tile-loader.d.ts +0 -0
- /package/{typed → dist}/layers/schema/carto-properties-tile-loader.d.ts.map +0 -0
- /package/{typed → dist}/layers/schema/carto-raster-tile.d.ts +0 -0
- /package/{typed → dist}/layers/schema/carto-spatial-tile-loader.d.ts +0 -0
- /package/{typed → dist}/layers/schema/carto-spatial-tile-loader.d.ts.map +0 -0
- /package/{typed → dist}/layers/schema/carto-tile.d.ts +0 -0
- /package/{typed → dist}/layers/schema/carto-tile.d.ts.map +0 -0
- /package/{typed → dist}/layers/schema/carto-vector-tile-loader.d.ts +0 -0
- /package/{typed → dist}/layers/schema/carto-vector-tile-loader.d.ts.map +0 -0
- /package/{typed → dist}/layers/schema/fast-pbf.d.ts +0 -0
- /package/{typed → dist}/layers/schema/fast-pbf.d.ts.map +0 -0
- /package/{typed → dist}/layers/schema/spatialjson-utils.d.ts +0 -0
- /package/{typed → dist}/layers/schema/spatialjson-utils.d.ts.map +0 -0
- /package/{typed → dist}/layers/schema/tile-loader-utils.d.ts +0 -0
- /package/{typed → dist}/layers/schema/tile-loader-utils.d.ts.map +0 -0
- /package/{typed → dist}/style/palette.d.ts +0 -0
- /package/{typed → dist}/style/palette.d.ts.map +0 -0
- /package/{typed → dist}/style/utils.d.ts +0 -0
- /package/{typed → dist}/style/utils.d.ts.map +0 -0
- /package/{typed → dist}/workers/cartoRasterTile.d.ts +0 -0
- /package/{typed → dist}/workers/cartoRasterTile.d.ts.map +0 -0
- /package/{typed → dist}/workers/cartoSpatialTile.d.ts +0 -0
- /package/{typed → dist}/workers/cartoSpatialTile.d.ts.map +0 -0
- /package/{typed → dist}/workers/cartoVectorTile.d.ts +0 -0
- /package/{typed → dist}/workers/cartoVectorTile.d.ts.map +0 -0
package/package.json
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
"name": "@deck.gl/carto",
|
|
3
3
|
"description": "CARTO official integration with Deck.gl. Build geospatial applications using CARTO and Deck.gl.",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"version": "9.0.0-beta.11",
|
|
6
7
|
"publishConfig": {
|
|
7
8
|
"access": "public"
|
|
8
9
|
},
|
|
@@ -18,13 +19,19 @@
|
|
|
18
19
|
"type": "git",
|
|
19
20
|
"url": "https://github.com/visgl/deck.gl.git"
|
|
20
21
|
},
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
22
|
+
"types": "dist/index.d.ts",
|
|
23
|
+
"main": "dist/index.cjs",
|
|
24
|
+
"module": "dist/index.js",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"import": "./dist/index.js",
|
|
29
|
+
"require": "./dist/index.cjs"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
24
32
|
"files": [
|
|
25
33
|
"dist",
|
|
26
34
|
"src",
|
|
27
|
-
"typed",
|
|
28
35
|
"dist.min.js"
|
|
29
36
|
],
|
|
30
37
|
"sideEffects": false,
|
|
@@ -35,37 +42,35 @@
|
|
|
35
42
|
"prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
|
|
36
43
|
},
|
|
37
44
|
"dependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"@loaders.gl/
|
|
40
|
-
"@loaders.gl/
|
|
41
|
-
"@loaders.gl/
|
|
42
|
-
"@loaders.gl/tiles": "4.
|
|
43
|
-
"@luma.gl/constants": "9.0.
|
|
44
|
-
"@luma.gl/core": "9.0.0-alpha.54",
|
|
45
|
+
"@loaders.gl/gis": "^4.2.0",
|
|
46
|
+
"@loaders.gl/loader-utils": "^4.2.0",
|
|
47
|
+
"@loaders.gl/mvt": "^4.2.0",
|
|
48
|
+
"@loaders.gl/schema": "^4.2.0",
|
|
49
|
+
"@loaders.gl/tiles": "^4.2.0",
|
|
50
|
+
"@luma.gl/constants": "^9.0.11",
|
|
45
51
|
"@math.gl/web-mercator": "^4.0.0",
|
|
52
|
+
"@types/d3-array": "^3.0.2",
|
|
53
|
+
"@types/d3-color": "^1.4.2",
|
|
54
|
+
"@types/d3-scale": "^3.0.0",
|
|
46
55
|
"cartocolor": "^4.0.2",
|
|
47
56
|
"d3-array": "^3.2.0",
|
|
48
57
|
"d3-color": "^3.1.0",
|
|
49
58
|
"d3-format": "^3.1.0",
|
|
50
59
|
"d3-scale": "^4.0.0",
|
|
60
|
+
"earcut": "^2.2.4",
|
|
51
61
|
"h3-js": "^4.1.0",
|
|
52
62
|
"moment-timezone": "^0.5.33",
|
|
53
63
|
"pbf": "^3.2.1",
|
|
54
|
-
"quadbin": "^0.
|
|
55
|
-
},
|
|
56
|
-
"devDependencies": {
|
|
57
|
-
"@loaders.gl/schema": "4.1.0-alpha.9",
|
|
58
|
-
"@types/d3-array": "^3.0.2",
|
|
59
|
-
"@types/d3-color": "^1.4.2",
|
|
60
|
-
"@types/d3-scale": "^3.0.0"
|
|
64
|
+
"quadbin": "^0.2.0"
|
|
61
65
|
},
|
|
62
66
|
"peerDependencies": {
|
|
63
|
-
"@deck.gl/aggregation-layers": "^9.0.0-
|
|
64
|
-
"@deck.gl/core": "^9.0.0-
|
|
65
|
-
"@deck.gl/extensions": "^9.0.0-
|
|
66
|
-
"@deck.gl/geo-layers": "^9.0.0-
|
|
67
|
-
"@deck.gl/layers": "^9.0.0-
|
|
68
|
-
"@loaders.gl/core": "4.
|
|
67
|
+
"@deck.gl/aggregation-layers": "^9.0.0-beta",
|
|
68
|
+
"@deck.gl/core": "^9.0.0-beta",
|
|
69
|
+
"@deck.gl/extensions": "^9.0.0-beta",
|
|
70
|
+
"@deck.gl/geo-layers": "^9.0.0-beta",
|
|
71
|
+
"@deck.gl/layers": "^9.0.0-beta",
|
|
72
|
+
"@loaders.gl/core": "^4.2.0",
|
|
73
|
+
"@luma.gl/core": "^9.0.0"
|
|
69
74
|
},
|
|
70
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "d8a3f5bdb644f85caba9d5c1e74baff8f8a3d439"
|
|
71
76
|
}
|
package/src/api/common.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import {VERSION} from '@deck.gl/core';
|
|
2
|
+
|
|
1
3
|
export const DEFAULT_API_BASE_URL = 'https://gcp-us-east1.api.carto.com';
|
|
2
4
|
export const DEFAULT_CLIENT = 'deck-gl-carto';
|
|
3
|
-
export const V3_MINOR_VERSION = '3.
|
|
5
|
+
export const V3_MINOR_VERSION = '3.4';
|
|
4
6
|
export const MAX_GET_LENGTH = 8192;
|
|
5
7
|
|
|
6
8
|
export const DEFAULT_PARAMETERS = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
v: V3_MINOR_VERSION,
|
|
10
|
+
deckglVersion: VERSION
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
export const DEFAULT_HEADERS = {
|
package/src/api/fetch-map.ts
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
vectorQuerySource,
|
|
17
17
|
vectorTableSource,
|
|
18
18
|
vectorTilesetSource
|
|
19
|
-
} from '../sources';
|
|
19
|
+
} from '../sources/index';
|
|
20
20
|
import {parseMap} from './parse-map';
|
|
21
21
|
import {requestWithParameters} from './request-with-parameters';
|
|
22
22
|
import {assert} from '../utils';
|
|
@@ -80,19 +80,24 @@ async function _fetchMapDataset(
|
|
|
80
80
|
if (type === 'table') {
|
|
81
81
|
dataset.data = await vectorTableSource({...options, columns, tableName: source});
|
|
82
82
|
} else if (type === 'query') {
|
|
83
|
-
dataset.data = await vectorQuerySource({
|
|
83
|
+
dataset.data = await vectorQuerySource({
|
|
84
|
+
...options,
|
|
85
|
+
columns,
|
|
86
|
+
sqlQuery: source,
|
|
87
|
+
queryParameters
|
|
88
|
+
});
|
|
84
89
|
}
|
|
85
90
|
} else if (spatialDataType === 'h3') {
|
|
86
91
|
const options = {...globalOptions, aggregationExp, aggregationResLevel, spatialDataColumn};
|
|
87
92
|
if (type === 'table') {
|
|
88
|
-
dataset.data = await h3TableSource({...options,
|
|
93
|
+
dataset.data = await h3TableSource({...options, tableName: source});
|
|
89
94
|
} else if (type === 'query') {
|
|
90
95
|
dataset.data = await h3QuerySource({...options, sqlQuery: source, queryParameters});
|
|
91
96
|
}
|
|
92
97
|
} else if (spatialDataType === 'quadbin') {
|
|
93
98
|
const options = {...globalOptions, aggregationExp, aggregationResLevel, spatialDataColumn};
|
|
94
99
|
if (type === 'table') {
|
|
95
|
-
dataset.data = await quadbinTableSource({...options,
|
|
100
|
+
dataset.data = await quadbinTableSource({...options, tableName: source});
|
|
96
101
|
} else if (type === 'query') {
|
|
97
102
|
dataset.data = await quadbinQuerySource({...options, sqlQuery: source, queryParameters});
|
|
98
103
|
}
|
|
@@ -125,8 +130,12 @@ async function _fetchTilestats(
|
|
|
125
130
|
}
|
|
126
131
|
|
|
127
132
|
const baseUrl = buildStatsUrl({attribute, apiBaseUrl, ...dataset});
|
|
133
|
+
const client = new URLSearchParams(data.tiles[0]).get('client');
|
|
128
134
|
const headers = {Authorization: `Bearer ${accessToken}`};
|
|
129
135
|
const parameters: Record<string, string> = {};
|
|
136
|
+
if (client) {
|
|
137
|
+
parameters.client = client;
|
|
138
|
+
}
|
|
130
139
|
if (type === 'query') {
|
|
131
140
|
parameters.q = source;
|
|
132
141
|
if (queryParameters) {
|
package/src/api/query.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {SOURCE_DEFAULTS} from '../sources';
|
|
1
|
+
import {SOURCE_DEFAULTS} from '../sources/index';
|
|
2
2
|
import type {SourceOptions, QuerySourceOptions, QueryResult} from '../sources/types';
|
|
3
3
|
import {buildQueryUrl} from './endpoints';
|
|
4
4
|
import {requestWithParameters} from './request-with-parameters';
|
|
@@ -9,60 +9,68 @@ function encodeParameter(name: string, value: string | boolean | number): string
|
|
|
9
9
|
return `${name}=${encodeURIComponent(value)}`;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
const REQUEST_CACHE = new Map();
|
|
12
|
+
const REQUEST_CACHE = new Map<string, Promise<unknown>>();
|
|
13
13
|
export async function requestWithParameters<T = any>({
|
|
14
|
-
accessToken,
|
|
15
14
|
baseUrl,
|
|
16
15
|
parameters,
|
|
17
16
|
headers: customHeaders,
|
|
18
17
|
errorContext
|
|
19
18
|
}: {
|
|
20
|
-
accessToken?: string;
|
|
21
19
|
baseUrl: string;
|
|
22
20
|
parameters?: Record<string, string>;
|
|
23
21
|
headers: Record<string, string>;
|
|
24
22
|
errorContext: APIErrorContext;
|
|
25
23
|
}): Promise<T> {
|
|
26
|
-
const key =
|
|
24
|
+
const key = createCacheKey(baseUrl, parameters || {}, customHeaders || {});
|
|
27
25
|
if (REQUEST_CACHE.has(key)) {
|
|
28
|
-
return REQUEST_CACHE.get(key)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
let url = baseUrl;
|
|
32
|
-
if (parameters) {
|
|
33
|
-
const allParameters = {...DEFAULT_PARAMETERS, ...parameters};
|
|
34
|
-
const encodedParameters = Object.entries(allParameters).map(([key, value]) => {
|
|
35
|
-
return encodeParameter(key, value);
|
|
36
|
-
});
|
|
37
|
-
url += `?${encodedParameters.join('&')}`;
|
|
26
|
+
return REQUEST_CACHE.get(key) as Promise<T>;
|
|
38
27
|
}
|
|
39
28
|
|
|
29
|
+
const url = parameters ? createURLWithParameters(baseUrl, parameters) : baseUrl;
|
|
40
30
|
const headers = {...DEFAULT_HEADERS, ...customHeaders};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
31
|
+
|
|
32
|
+
/* global fetch */
|
|
33
|
+
const fetchPromise =
|
|
34
|
+
url.length > MAX_GET_LENGTH
|
|
35
|
+
? fetch(baseUrl, {method: 'POST', body: JSON.stringify(parameters), headers})
|
|
36
|
+
: fetch(url, {headers});
|
|
37
|
+
|
|
38
|
+
let response: Response | undefined;
|
|
39
|
+
const jsonPromise: Promise<T> = fetchPromise
|
|
40
|
+
.then((_response: Response) => {
|
|
41
|
+
response = _response;
|
|
42
|
+
return response.json();
|
|
43
|
+
})
|
|
44
|
+
.then((json: any) => {
|
|
45
|
+
if (!response || !response.ok) {
|
|
46
|
+
throw new Error(json.error);
|
|
54
47
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (!response.ok) {
|
|
48
|
+
return json;
|
|
49
|
+
})
|
|
50
|
+
.catch((error: Error) => {
|
|
59
51
|
REQUEST_CACHE.delete(key);
|
|
60
|
-
throw new CartoAPIError(
|
|
61
|
-
}
|
|
52
|
+
throw new CartoAPIError(error, errorContext, response);
|
|
53
|
+
});
|
|
62
54
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
REQUEST_CACHE.set(key, jsonPromise);
|
|
56
|
+
return jsonPromise;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function createCacheKey(
|
|
60
|
+
baseUrl: string,
|
|
61
|
+
parameters: Record<string, string>,
|
|
62
|
+
headers: Record<string, string>
|
|
63
|
+
): string {
|
|
64
|
+
const parameterEntries = Object.entries(parameters).sort(([a], [b]) => (a > b ? 1 : -1));
|
|
65
|
+
const headerEntries = Object.entries(headers).sort(([a], [b]) => (a > b ? 1 : -1));
|
|
66
|
+
return JSON.stringify({baseUrl, parameters: parameterEntries, headers: headerEntries});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function createURLWithParameters(baseUrl: string, parameters: Record<string, string>): string {
|
|
70
|
+
const encodedParameters = Object.entries({...DEFAULT_PARAMETERS, ...parameters}).map(
|
|
71
|
+
([key, value]) => {
|
|
72
|
+
return encodeParameter(key, value);
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
return `${baseUrl}?${encodedParameters.join('&')}`;
|
|
68
76
|
}
|
package/src/api/types.ts
CHANGED
|
@@ -54,6 +54,26 @@ export type VisualChannelField = {
|
|
|
54
54
|
colorColumn?: string;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
+
export interface Filters {
|
|
58
|
+
[column: string]: Filter;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
interface Filter {
|
|
62
|
+
[FilterTypes.In]: number[];
|
|
63
|
+
[FilterTypes.Between]: number[][];
|
|
64
|
+
[FilterTypes.ClosedOpen]: number[][];
|
|
65
|
+
[FilterTypes.Time]: number[][];
|
|
66
|
+
[FilterTypes.StringSearch]: string[];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export enum FilterTypes {
|
|
70
|
+
In = 'in',
|
|
71
|
+
Between = 'between', // [a, b] both are included
|
|
72
|
+
ClosedOpen = 'closed_open', // [a, b) a is included, b is not
|
|
73
|
+
Time = 'time',
|
|
74
|
+
StringSearch = 'stringSearch'
|
|
75
|
+
}
|
|
76
|
+
|
|
57
77
|
export type VisualChannels = {
|
|
58
78
|
colorField?: VisualChannelField;
|
|
59
79
|
colorScale?: SCALE_TYPE;
|
package/src/constants.ts
ADDED
package/src/index.ts
CHANGED
|
@@ -23,7 +23,7 @@ export {default as BASEMAP} from './basemap';
|
|
|
23
23
|
export {default as colorBins} from './style/color-bins-style';
|
|
24
24
|
export {default as colorCategories} from './style/color-categories-style';
|
|
25
25
|
export {default as colorContinuous} from './style/color-continuous-style';
|
|
26
|
-
export {CartoAPIError, fetchMap, query} from './api';
|
|
26
|
+
export {CartoAPIError, fetchMap, query} from './api/index';
|
|
27
27
|
export type {
|
|
28
28
|
APIErrorContext,
|
|
29
29
|
FetchMapOptions,
|
|
@@ -32,7 +32,7 @@ export type {
|
|
|
32
32
|
RequestType,
|
|
33
33
|
QueryParameters,
|
|
34
34
|
QueryOptions
|
|
35
|
-
} from './api';
|
|
35
|
+
} from './api/index';
|
|
36
36
|
|
|
37
37
|
import {
|
|
38
38
|
boundaryQuerySource,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
vectorTableSource,
|
|
49
49
|
vectorTilesetSource,
|
|
50
50
|
SOURCE_DEFAULTS
|
|
51
|
-
} from './sources';
|
|
51
|
+
} from './sources/index';
|
|
52
52
|
|
|
53
53
|
const CARTO_SOURCES = {
|
|
54
54
|
boundaryQuerySource,
|
|
@@ -83,7 +83,13 @@ export {
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
export type {
|
|
86
|
+
GeojsonResult,
|
|
87
|
+
JsonResult,
|
|
86
88
|
TilejsonResult,
|
|
89
|
+
SourceOptions,
|
|
90
|
+
QuerySourceOptions,
|
|
91
|
+
TableSourceOptions,
|
|
92
|
+
TilesetSourceOptions,
|
|
87
93
|
BoundaryQuerySourceOptions,
|
|
88
94
|
BoundaryTableSourceOptions,
|
|
89
95
|
H3QuerySourceOptions,
|
|
@@ -95,7 +101,5 @@ export type {
|
|
|
95
101
|
QuadbinTilesetSourceOptions,
|
|
96
102
|
VectorQuerySourceOptions,
|
|
97
103
|
VectorTableSourceOptions,
|
|
98
|
-
VectorTilesetSourceOptions
|
|
99
|
-
|
|
100
|
-
JsonResult
|
|
101
|
-
} from './sources';
|
|
104
|
+
VectorTilesetSourceOptions
|
|
105
|
+
} from './sources/index';
|
|
@@ -4,6 +4,7 @@ import H3Tileset2D, {getHexagonResolution} from './h3-tileset-2d';
|
|
|
4
4
|
import SpatialIndexTileLayer, {SpatialIndexTileLayerProps} from './spatial-index-tile-layer';
|
|
5
5
|
import type {TilejsonResult} from '../sources/types';
|
|
6
6
|
import {injectAccessToken, TilejsonPropType} from './utils';
|
|
7
|
+
import {DEFAULT_TILE_SIZE} from '../constants';
|
|
7
8
|
|
|
8
9
|
export const renderSubLayers = props => {
|
|
9
10
|
const {data} = props;
|
|
@@ -18,7 +19,8 @@ export const renderSubLayers = props => {
|
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
const defaultProps: DefaultProps<H3TileLayerProps> = {
|
|
21
|
-
data: TilejsonPropType
|
|
22
|
+
data: TilejsonPropType,
|
|
23
|
+
tileSize: DEFAULT_TILE_SIZE
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
/** All properties supported by H3TileLayer. */
|
|
@@ -59,13 +61,13 @@ export default class H3TileLayer<DataT = any, ExtraPropsT extends {} = {}> exten
|
|
|
59
61
|
if (this.props.minZoom) {
|
|
60
62
|
minresolution = Math.max(
|
|
61
63
|
minresolution,
|
|
62
|
-
getHexagonResolution({zoom: this.props.minZoom, latitude: 0})
|
|
64
|
+
getHexagonResolution({zoom: this.props.minZoom, latitude: 0}, this.props.tileSize)
|
|
63
65
|
);
|
|
64
66
|
}
|
|
65
67
|
if (this.props.maxZoom) {
|
|
66
68
|
maxresolution = Math.min(
|
|
67
69
|
maxresolution,
|
|
68
|
-
getHexagonResolution({zoom: this.props.maxZoom, latitude: 0})
|
|
70
|
+
getHexagonResolution({zoom: this.props.maxZoom, latitude: 0}, this.props.tileSize)
|
|
69
71
|
);
|
|
70
72
|
}
|
|
71
73
|
|
|
@@ -5,11 +5,43 @@ import {
|
|
|
5
5
|
getResolution,
|
|
6
6
|
cellToBoundary,
|
|
7
7
|
cellToParent,
|
|
8
|
-
gridDisk
|
|
8
|
+
gridDisk,
|
|
9
|
+
edgeLength,
|
|
10
|
+
UNITS,
|
|
11
|
+
originToDirectedEdges
|
|
9
12
|
} from 'h3-js';
|
|
10
13
|
|
|
11
14
|
export type H3TileIndex = {i: string};
|
|
12
15
|
|
|
16
|
+
const MAX_LATITUDE = 85.051128;
|
|
17
|
+
|
|
18
|
+
// `polygonToCells()` fills based on hexagon center, this function will
|
|
19
|
+
// pad the bounds such that all cells that overlap the bounds will be included
|
|
20
|
+
function padBoundingBox(
|
|
21
|
+
{west, north, east, south}: GeoBoundingBox,
|
|
22
|
+
resolution: number
|
|
23
|
+
): GeoBoundingBox {
|
|
24
|
+
const corners = [
|
|
25
|
+
[north, east],
|
|
26
|
+
[south, east],
|
|
27
|
+
[south, west],
|
|
28
|
+
[north, west]
|
|
29
|
+
];
|
|
30
|
+
const cornerCells = corners.map(c => latLngToCell(c[0], c[1], resolution));
|
|
31
|
+
const cornerEdgeLengths = cornerCells.map(
|
|
32
|
+
c => (Math.max(...originToDirectedEdges(c).map(e => edgeLength(e, UNITS.rads))) * 180) / Math.PI
|
|
33
|
+
);
|
|
34
|
+
const bufferLat = Math.max(...cornerEdgeLengths);
|
|
35
|
+
const bufferLon = Math.min(180, bufferLat / Math.cos((((north + south) / 2) * Math.PI) / 180));
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
north: Math.min(north + bufferLat, MAX_LATITUDE),
|
|
39
|
+
east: east + bufferLon,
|
|
40
|
+
south: Math.max(south - bufferLat, -MAX_LATITUDE),
|
|
41
|
+
west: west - bufferLon
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
13
45
|
function getHexagonsInBoundingBox(
|
|
14
46
|
{west, north, east, south}: GeoBoundingBox,
|
|
15
47
|
resolution: number
|
|
@@ -21,8 +53,8 @@ function getHexagonsInBoundingBox(
|
|
|
21
53
|
const nSegments = Math.ceil(longitudeSpan / 180);
|
|
22
54
|
let h3Indices: string[] = [];
|
|
23
55
|
for (let s = 0; s < nSegments; s++) {
|
|
24
|
-
const
|
|
25
|
-
const
|
|
56
|
+
const segmentWest = west + s * 180;
|
|
57
|
+
const segmentEast = Math.min(segmentWest + 179.9999999, east);
|
|
26
58
|
h3Indices = h3Indices.concat(
|
|
27
59
|
getHexagonsInBoundingBox({west: segmentWest, north, east: segmentEast, south}, resolution)
|
|
28
60
|
);
|
|
@@ -30,24 +62,14 @@ function getHexagonsInBoundingBox(
|
|
|
30
62
|
return [...new Set(h3Indices)];
|
|
31
63
|
}
|
|
32
64
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
[
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
[east, south],
|
|
42
|
-
[east, north],
|
|
43
|
-
[west, north]
|
|
44
|
-
]
|
|
45
|
-
],
|
|
46
|
-
resolution + oversample,
|
|
47
|
-
true
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
return oversample ? [...new Set(h3Indices.map(i => cellToParent(i, resolution)))] : h3Indices;
|
|
65
|
+
const polygon = [
|
|
66
|
+
[north, east],
|
|
67
|
+
[south, east],
|
|
68
|
+
[south, west],
|
|
69
|
+
[north, west],
|
|
70
|
+
[north, east]
|
|
71
|
+
];
|
|
72
|
+
return polygonToCells(polygon, resolution);
|
|
51
73
|
}
|
|
52
74
|
|
|
53
75
|
function tileToBoundingBox(index: string): GeoBoundingBox {
|
|
@@ -66,8 +88,14 @@ function tileToBoundingBox(index: string): GeoBoundingBox {
|
|
|
66
88
|
// similar
|
|
67
89
|
// Relative scale factor (0 = no biasing, 2 = a few hexagons cover view)
|
|
68
90
|
const BIAS = 2;
|
|
69
|
-
export function getHexagonResolution(
|
|
70
|
-
|
|
91
|
+
export function getHexagonResolution(
|
|
92
|
+
viewport: {zoom: number; latitude: number},
|
|
93
|
+
tileSize: number
|
|
94
|
+
): number {
|
|
95
|
+
// Difference in given tile size compared to deck's internal 512px tile size,
|
|
96
|
+
// expressed as an offset to the viewport zoom.
|
|
97
|
+
const zoomOffset = Math.log2(tileSize / 512);
|
|
98
|
+
const hexagonScaleFactor = (2 / 3) * (viewport.zoom - zoomOffset);
|
|
71
99
|
const latitudeScaleFactor = Math.log(1 / Math.cos((Math.PI * viewport.latitude) / 180));
|
|
72
100
|
|
|
73
101
|
// Clip and bias
|
|
@@ -83,9 +111,10 @@ export default class H3Tileset2D extends Tileset2D {
|
|
|
83
111
|
// @ts-expect-error Tileset2D should be generic over TileIndex
|
|
84
112
|
getTileIndices({viewport, minZoom, maxZoom}): H3TileIndex[] {
|
|
85
113
|
if (viewport.latitude === undefined) return [];
|
|
86
|
-
const [
|
|
114
|
+
const [west, south, east, north] = viewport.getBounds();
|
|
115
|
+
const {tileSize} = this.opts;
|
|
87
116
|
|
|
88
|
-
let z = getHexagonResolution(viewport);
|
|
117
|
+
let z = getHexagonResolution(viewport, tileSize);
|
|
89
118
|
let indices: string[];
|
|
90
119
|
if (typeof minZoom === 'number' && Number.isFinite(minZoom) && z < minZoom) {
|
|
91
120
|
// TODO support `extent` prop
|
|
@@ -99,7 +128,8 @@ export default class H3Tileset2D extends Tileset2D {
|
|
|
99
128
|
const center = latLngToCell(viewport.latitude, viewport.longitude, maxZoom);
|
|
100
129
|
indices = gridDisk(center, 1);
|
|
101
130
|
} else {
|
|
102
|
-
|
|
131
|
+
const paddedBounds = padBoundingBox({west, north, east, south}, z);
|
|
132
|
+
indices = getHexagonsInBoundingBox(paddedBounds, z);
|
|
103
133
|
}
|
|
104
134
|
|
|
105
135
|
return indices.map(i => ({i}));
|
|
@@ -5,6 +5,7 @@ import SpatialIndexTileLayer, {SpatialIndexTileLayerProps} from './spatial-index
|
|
|
5
5
|
import {hexToBigInt} from 'quadbin';
|
|
6
6
|
import type {TilejsonResult} from '../sources/types';
|
|
7
7
|
import {injectAccessToken, TilejsonPropType} from './utils';
|
|
8
|
+
import {DEFAULT_TILE_SIZE} from '../constants';
|
|
8
9
|
|
|
9
10
|
export const renderSubLayers = props => {
|
|
10
11
|
const {data} = props;
|
|
@@ -16,7 +17,8 @@ export const renderSubLayers = props => {
|
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
const defaultProps: DefaultProps<QuadbinTileLayerProps> = {
|
|
19
|
-
data: TilejsonPropType
|
|
20
|
+
data: TilejsonPropType,
|
|
21
|
+
tileSize: DEFAULT_TILE_SIZE
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
/** All properties supported by QuadbinTileLayer. */
|
|
@@ -32,8 +32,8 @@ void main(void) {
|
|
|
32
32
|
vec2 common_position = offset.xy;
|
|
33
33
|
float scale = offset.z;
|
|
34
34
|
|
|
35
|
-
int yIndex = - (gl_InstanceID /
|
|
36
|
-
int xIndex = gl_InstanceID + (yIndex *
|
|
35
|
+
int yIndex = - (gl_InstanceID / BLOCK_WIDTH);
|
|
36
|
+
int xIndex = gl_InstanceID + (yIndex * BLOCK_WIDTH);
|
|
37
37
|
common_position += scale * vec2(float(xIndex), float(yIndex));
|
|
38
38
|
|
|
39
39
|
vec4 color = isStroke ? instanceLineColors : instanceFillColors;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {GL} from '@luma.gl/constants';
|
|
2
1
|
import {
|
|
3
2
|
Accessor,
|
|
4
3
|
CompositeLayer,
|
|
@@ -11,7 +10,7 @@ import {ColumnLayer, ColumnLayerProps} from '@deck.gl/layers';
|
|
|
11
10
|
import {quadbinToOffset} from './quadbin-utils';
|
|
12
11
|
import {Raster} from './schema/carto-raster-tile-loader';
|
|
13
12
|
import vs from './raster-layer-vertex.glsl';
|
|
14
|
-
import {
|
|
13
|
+
import {createBinaryProxy} from '../utils';
|
|
15
14
|
|
|
16
15
|
const defaultProps: DefaultProps<RasterLayerProps> = {
|
|
17
16
|
...ColumnLayer.defaultProps,
|
|
@@ -31,7 +30,9 @@ class RasterColumnLayer extends ColumnLayer {
|
|
|
31
30
|
|
|
32
31
|
getShaders() {
|
|
33
32
|
const shaders = super.getShaders();
|
|
34
|
-
|
|
33
|
+
const data = this.props.data as unknown as {data: Raster; length: number};
|
|
34
|
+
const BLOCK_WIDTH = data.data.blockSize ?? Math.sqrt(data.length);
|
|
35
|
+
return {...shaders, defines: {...shaders.defines, BLOCK_WIDTH}, vs};
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
initializeState() {
|
|
@@ -46,16 +47,14 @@ class RasterColumnLayer extends ColumnLayer {
|
|
|
46
47
|
},
|
|
47
48
|
instanceFillColors: {
|
|
48
49
|
size: this.props.colorFormat.length,
|
|
49
|
-
type:
|
|
50
|
-
normalized: true,
|
|
50
|
+
type: 'unorm8',
|
|
51
51
|
transition: true,
|
|
52
52
|
accessor: 'getFillColor',
|
|
53
53
|
defaultValue: [0, 0, 0, 255]
|
|
54
54
|
},
|
|
55
55
|
instanceLineColors: {
|
|
56
56
|
size: this.props.colorFormat.length,
|
|
57
|
-
type:
|
|
58
|
-
normalized: true,
|
|
57
|
+
type: 'unorm8',
|
|
59
58
|
transition: true,
|
|
60
59
|
accessor: 'getLineColor',
|
|
61
60
|
defaultValue: [255, 255, 255, 255]
|
|
@@ -94,17 +93,12 @@ export default class RasterLayer<DataT = any, ExtraProps = {}> extends Composite
|
|
|
94
93
|
getLineWidth,
|
|
95
94
|
tileIndex,
|
|
96
95
|
updateTriggers
|
|
97
|
-
} = this.props;
|
|
96
|
+
} = this.props as typeof this.props & {data: Raster};
|
|
98
97
|
if (!data || !tileIndex) return null;
|
|
99
98
|
|
|
100
|
-
const
|
|
101
|
-
assert(
|
|
102
|
-
blockWidth === blockHeight,
|
|
103
|
-
`blockWidth (${blockWidth}) must equal blockHeight (${blockHeight})`
|
|
104
|
-
);
|
|
105
|
-
|
|
99
|
+
const blockSize = data.blockSize ?? 0;
|
|
106
100
|
const [xOffset, yOffset, scale] = quadbinToOffset(tileIndex);
|
|
107
|
-
const offset = [xOffset, yOffset, scale /
|
|
101
|
+
const offset = [xOffset, yOffset, scale / blockSize];
|
|
108
102
|
|
|
109
103
|
// Filled Column Layer
|
|
110
104
|
const CellLayer = this.getSubLayerClass('column', RasterColumnLayer);
|
|
@@ -122,7 +116,7 @@ export default class RasterLayer<DataT = any, ExtraProps = {}> extends Composite
|
|
|
122
116
|
{
|
|
123
117
|
data: {
|
|
124
118
|
data, // Pass through data for getSubLayerAccessor()
|
|
125
|
-
length:
|
|
119
|
+
length: blockSize * blockSize
|
|
126
120
|
},
|
|
127
121
|
offset
|
|
128
122
|
}
|
|
@@ -4,6 +4,7 @@ import QuadbinTileset2D from './quadbin-tileset-2d';
|
|
|
4
4
|
import SpatialIndexTileLayer, {SpatialIndexTileLayerProps} from './spatial-index-tile-layer';
|
|
5
5
|
import type {TilejsonResult} from '../sources/types';
|
|
6
6
|
import {injectAccessToken, TilejsonPropType} from './utils';
|
|
7
|
+
import {DEFAULT_TILE_SIZE} from '../constants';
|
|
7
8
|
|
|
8
9
|
export const renderSubLayers = props => {
|
|
9
10
|
const tileIndex = props.tile?.index?.q;
|
|
@@ -12,7 +13,8 @@ export const renderSubLayers = props => {
|
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
const defaultProps: DefaultProps<RasterTileLayerProps> = {
|
|
15
|
-
data: TilejsonPropType
|
|
16
|
+
data: TilejsonPropType,
|
|
17
|
+
tileSize: DEFAULT_TILE_SIZE
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
/** All properties supported by RasterTileLayer. */
|
|
@@ -36,8 +36,8 @@ const CartoRasterTileLoader: LoaderWithParser = {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
export type Raster = {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
/** Raster tiles are square, with 'blockSize' width and height in pixels. */
|
|
40
|
+
blockSize: number;
|
|
41
41
|
cells: {
|
|
42
42
|
numericProps: NumericProps;
|
|
43
43
|
properties: Properties[];
|
|
@@ -49,14 +49,14 @@ function parseCartoRasterTile(
|
|
|
49
49
|
options?: CartoRasterTileLoaderOptions
|
|
50
50
|
): Raster | null {
|
|
51
51
|
if (!arrayBuffer) return null;
|
|
52
|
-
const
|
|
53
|
-
|
|
52
|
+
const {bands, blockSize} = parsePbf(arrayBuffer, TileReader);
|
|
53
|
+
|
|
54
54
|
const numericProps = {};
|
|
55
55
|
for (let i = 0; i < bands.length; i++) {
|
|
56
56
|
const {name, data} = bands[i];
|
|
57
57
|
numericProps[name] = data;
|
|
58
58
|
}
|
|
59
|
-
return {
|
|
59
|
+
return {blockSize, cells: {numericProps, properties: []}};
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
export default CartoRasterTileLoader;
|