@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
|
@@ -36,11 +36,10 @@ export class BandReader {
|
|
|
36
36
|
|
|
37
37
|
export class TileReader {
|
|
38
38
|
static read(pbf, end) {
|
|
39
|
-
return pbf.readFields(TileReader._readField, {
|
|
39
|
+
return pbf.readFields(TileReader._readField, {blockSize: 0, bands: []}, end);
|
|
40
40
|
}
|
|
41
41
|
static _readField(this: void, tag, obj, pbf) {
|
|
42
|
-
if (tag === 1) obj.
|
|
43
|
-
else if (tag === 2) obj.
|
|
44
|
-
else if (tag === 3) obj.bands.push(BandReader.read(pbf, pbf.readVarint() + pbf.pos));
|
|
42
|
+
if (tag === 1) obj.blockSize = pbf.readVarint();
|
|
43
|
+
else if (tag === 2) obj.bands.push(BandReader.read(pbf, pbf.readVarint() + pbf.pos));
|
|
45
44
|
}
|
|
46
45
|
}
|
|
@@ -6,12 +6,15 @@ registerLoaders([CartoRasterTileLoader, CartoSpatialTileLoader]);
|
|
|
6
6
|
|
|
7
7
|
import {PickingInfo} from '@deck.gl/core';
|
|
8
8
|
import {TileLayer, _Tile2DHeader as Tile2DHeader, TileLayerProps} from '@deck.gl/geo-layers';
|
|
9
|
+
import {DEFAULT_TILE_SIZE} from '../constants';
|
|
9
10
|
|
|
10
11
|
function isFeatureIdDefined(value: unknown): boolean {
|
|
11
12
|
return value !== undefined && value !== null && value !== '';
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
const defaultProps: DefaultProps<SpatialIndexTileLayerProps> = {
|
|
15
|
+
const defaultProps: DefaultProps<SpatialIndexTileLayerProps> = {
|
|
16
|
+
tileSize: DEFAULT_TILE_SIZE
|
|
17
|
+
};
|
|
15
18
|
|
|
16
19
|
/** All properties supported by SpatialIndexTileLayer. */
|
|
17
20
|
export type SpatialIndexTileLayerProps<DataT = unknown> = _SpatialIndexTileLayerProps &
|
|
@@ -28,14 +31,14 @@ export default class SpatialIndexTileLayer<
|
|
|
28
31
|
static defaultProps = defaultProps;
|
|
29
32
|
|
|
30
33
|
state!: TileLayer<DataT>['state'] & {
|
|
31
|
-
hoveredFeatureId: number | null;
|
|
34
|
+
hoveredFeatureId: BigInt | number | null;
|
|
32
35
|
highlightColor: number[];
|
|
33
36
|
};
|
|
34
37
|
|
|
35
38
|
protected _updateAutoHighlight(info: PickingInfo): void {
|
|
36
39
|
const {hoveredFeatureId} = this.state;
|
|
37
40
|
const hoveredFeature = info.object;
|
|
38
|
-
let newHoveredFeatureId;
|
|
41
|
+
let newHoveredFeatureId: BigInt | number | null = null;
|
|
39
42
|
|
|
40
43
|
if (hoveredFeature) {
|
|
41
44
|
newHoveredFeatureId = hoveredFeature.id;
|
|
@@ -79,6 +82,7 @@ export default class SpatialIndexTileLayer<
|
|
|
79
82
|
}
|
|
80
83
|
|
|
81
84
|
_featureInTile(tile: Tile2DHeader, featureId: BigInt | number) {
|
|
85
|
+
// TODO: Tile2DHeader index should be generic for H3TileIndex or QuadbinTileIndex
|
|
82
86
|
const tileset = this.state.tileset!;
|
|
83
87
|
const tileZoom = tileset.getTileZoom(tile.index);
|
|
84
88
|
// @ts-ignore
|
|
@@ -16,30 +16,33 @@ import {
|
|
|
16
16
|
import {GeoJsonLayer} from '@deck.gl/layers';
|
|
17
17
|
import {binaryToGeojson} from '@loaders.gl/gis';
|
|
18
18
|
import type {BinaryFeatureCollection} from '@loaders.gl/schema';
|
|
19
|
-
import type {Feature} from 'geojson';
|
|
19
|
+
import type {Feature, Geometry} from 'geojson';
|
|
20
20
|
|
|
21
21
|
import type {TilejsonResult} from '../sources/types';
|
|
22
22
|
import {TilejsonPropType, injectAccessToken, mergeBoundaryData} from './utils';
|
|
23
|
+
import {DEFAULT_TILE_SIZE} from '../constants';
|
|
23
24
|
|
|
24
25
|
const defaultProps: DefaultProps<VectorTileLayerProps> = {
|
|
25
26
|
...MVTLayer.defaultProps,
|
|
26
27
|
data: TilejsonPropType,
|
|
27
|
-
dataComparator: TilejsonPropType.equal
|
|
28
|
+
dataComparator: TilejsonPropType.equal,
|
|
29
|
+
tileSize: DEFAULT_TILE_SIZE
|
|
28
30
|
};
|
|
29
31
|
|
|
30
32
|
/** All properties supported by VectorTileLayer. */
|
|
31
|
-
export type VectorTileLayerProps = _VectorTileLayerProps &
|
|
33
|
+
export type VectorTileLayerProps<FeaturePropertiesT = unknown> = _VectorTileLayerProps &
|
|
34
|
+
Omit<MVTLayerProps<FeaturePropertiesT>, 'data'>;
|
|
32
35
|
|
|
33
36
|
/** Properties added by VectorTileLayer. */
|
|
34
37
|
type _VectorTileLayerProps = {
|
|
35
38
|
data: null | TilejsonResult | Promise<TilejsonResult>;
|
|
36
39
|
};
|
|
37
40
|
|
|
38
|
-
// TODO Perhaps we can't subclass MVTLayer and keep types. Better to subclass TileLayer instead?
|
|
39
41
|
// @ts-ignore
|
|
40
|
-
export default class VectorTileLayer<
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
export default class VectorTileLayer<
|
|
43
|
+
FeaturePropertiesT = any,
|
|
44
|
+
ExtraProps extends {} = {}
|
|
45
|
+
> extends MVTLayer<FeaturePropertiesT, Required<_VectorTileLayerProps> & ExtraProps> {
|
|
43
46
|
static layerName = 'VectorTileLayer';
|
|
44
47
|
static defaultProps = defaultProps;
|
|
45
48
|
|
|
@@ -47,6 +50,12 @@ export default class VectorTileLayer<ExtraProps extends {} = {}> extends MVTLaye
|
|
|
47
50
|
mvt: boolean;
|
|
48
51
|
};
|
|
49
52
|
|
|
53
|
+
constructor(...propObjects: VectorTileLayerProps<FeaturePropertiesT>[]) {
|
|
54
|
+
// Force externally visible props type, as it is not possible modify via extension
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
super(...propObjects);
|
|
57
|
+
}
|
|
58
|
+
|
|
50
59
|
initializeState(): void {
|
|
51
60
|
super.initializeState();
|
|
52
61
|
this.setState({binary: true});
|
|
@@ -71,6 +80,7 @@ export default class VectorTileLayer<ExtraProps extends {} = {}> extends MVTLaye
|
|
|
71
80
|
return loadOptions;
|
|
72
81
|
}
|
|
73
82
|
|
|
83
|
+
/* eslint-disable camelcase */
|
|
74
84
|
async getTileData(tile: TileLoadProps) {
|
|
75
85
|
const tileJSON = this.props.data as TilejsonResult;
|
|
76
86
|
const {tiles, properties_tiles} = tileJSON;
|
|
@@ -106,6 +116,7 @@ export default class VectorTileLayer<ExtraProps extends {} = {}> extends MVTLaye
|
|
|
106
116
|
|
|
107
117
|
return attributes ? mergeBoundaryData(geometry, attributes) : geometry;
|
|
108
118
|
}
|
|
119
|
+
/* eslint-enable camelcase */
|
|
109
120
|
|
|
110
121
|
renderSubLayers(
|
|
111
122
|
props: TileLayer['props'] & {
|
|
@@ -144,7 +155,7 @@ export default class VectorTileLayer<ExtraProps extends {} = {}> extends MVTLaye
|
|
|
144
155
|
const {data} = params.sourceLayer!.props;
|
|
145
156
|
info.object = binaryToGeojson(data as BinaryFeatureCollection, {
|
|
146
157
|
globalFeatureId: info.index
|
|
147
|
-
}) as Feature
|
|
158
|
+
}) as Feature<Geometry, FeaturePropertiesT>;
|
|
148
159
|
}
|
|
149
160
|
|
|
150
161
|
return info;
|
|
@@ -32,18 +32,19 @@ export async function baseSource<UrlParameters extends Record<string, string>>(
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
const baseUrl = buildSourceUrl(mergedOptions);
|
|
35
|
-
const {format} = mergedOptions;
|
|
35
|
+
const {clientId, format} = mergedOptions;
|
|
36
36
|
const headers = {Authorization: `Bearer ${options.accessToken}`, ...options.headers};
|
|
37
|
+
const parameters = {client: clientId, ...urlParameters};
|
|
37
38
|
|
|
38
39
|
const errorContext: APIErrorContext = {
|
|
39
40
|
requestType: 'Map instantiation',
|
|
40
41
|
connection: options.connectionName,
|
|
41
42
|
type: endpoint,
|
|
42
|
-
source: JSON.stringify(
|
|
43
|
+
source: JSON.stringify(parameters, undefined, 2)
|
|
43
44
|
};
|
|
44
45
|
const mapInstantiation = await requestWithParameters<TilejsonMapInstantiation>({
|
|
45
46
|
baseUrl,
|
|
46
|
-
parameters
|
|
47
|
+
parameters,
|
|
47
48
|
headers,
|
|
48
49
|
errorContext
|
|
49
50
|
});
|
|
@@ -55,12 +56,15 @@ export async function baseSource<UrlParameters extends Record<string, string>>(
|
|
|
55
56
|
errorContext.requestType = 'Map data';
|
|
56
57
|
|
|
57
58
|
if (format === 'tilejson') {
|
|
58
|
-
|
|
59
|
-
accessToken,
|
|
59
|
+
const json = await requestWithParameters<TilejsonResult>({
|
|
60
60
|
baseUrl: dataUrl,
|
|
61
61
|
headers,
|
|
62
62
|
errorContext
|
|
63
63
|
});
|
|
64
|
+
if (accessToken) {
|
|
65
|
+
json.accessToken = accessToken;
|
|
66
|
+
}
|
|
67
|
+
return json;
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
return await requestWithParameters<GeojsonResult | JsonResult>({
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import {QueryParameters} from '../api';
|
|
1
|
+
import {QueryParameters} from '../api/index';
|
|
2
2
|
import {baseSource} from './base-source';
|
|
3
|
-
import type {SourceOptions, TilejsonResult} from './types';
|
|
3
|
+
import type {FilterOptions, SourceOptions, TilejsonResult} from './types';
|
|
4
4
|
|
|
5
|
-
export type BoundaryQuerySourceOptions = SourceOptions &
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
export type BoundaryQuerySourceOptions = SourceOptions &
|
|
6
|
+
FilterOptions & {
|
|
7
|
+
columns?: string[];
|
|
8
|
+
tilesetTableName: string;
|
|
9
|
+
matchingColumn?: string;
|
|
10
|
+
propertiesSqlQuery: string;
|
|
11
|
+
queryParameters?: QueryParameters;
|
|
12
|
+
};
|
|
11
13
|
type UrlParameters = {
|
|
14
|
+
columns?: string;
|
|
15
|
+
filters?: string;
|
|
12
16
|
tilesetTableName: string;
|
|
13
17
|
matchingColumn: string;
|
|
14
18
|
propertiesSqlQuery: string;
|
|
@@ -18,12 +22,26 @@ type UrlParameters = {
|
|
|
18
22
|
export const boundaryQuerySource = async function (
|
|
19
23
|
options: BoundaryQuerySourceOptions
|
|
20
24
|
): Promise<TilejsonResult> {
|
|
21
|
-
const {
|
|
25
|
+
const {
|
|
26
|
+
columns,
|
|
27
|
+
filters,
|
|
28
|
+
tilesetTableName,
|
|
29
|
+
matchingColumn = 'id',
|
|
30
|
+
propertiesSqlQuery,
|
|
31
|
+
queryParameters
|
|
32
|
+
} = options;
|
|
22
33
|
const urlParameters: UrlParameters = {
|
|
23
34
|
tilesetTableName,
|
|
24
35
|
matchingColumn,
|
|
25
36
|
propertiesSqlQuery
|
|
26
37
|
};
|
|
38
|
+
|
|
39
|
+
if (columns) {
|
|
40
|
+
urlParameters.columns = columns.join(',');
|
|
41
|
+
}
|
|
42
|
+
if (filters) {
|
|
43
|
+
urlParameters.filters = JSON.stringify(filters);
|
|
44
|
+
}
|
|
27
45
|
if (queryParameters) {
|
|
28
46
|
urlParameters.queryParameters = JSON.stringify(queryParameters);
|
|
29
47
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import {baseSource} from './base-source';
|
|
2
|
-
import type {SourceOptions, TilejsonResult} from './types';
|
|
2
|
+
import type {FilterOptions, SourceOptions, TilejsonResult} from './types';
|
|
3
3
|
|
|
4
|
-
export type BoundaryTableSourceOptions = SourceOptions &
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
export type BoundaryTableSourceOptions = SourceOptions &
|
|
5
|
+
FilterOptions & {
|
|
6
|
+
tilesetTableName: string;
|
|
7
|
+
columns?: string[];
|
|
8
|
+
matchingColumn?: string;
|
|
9
|
+
propertiesTableName: string;
|
|
10
|
+
};
|
|
10
11
|
type UrlParameters = {
|
|
12
|
+
filters?: string;
|
|
11
13
|
tilesetTableName: string;
|
|
12
14
|
columns?: string;
|
|
13
15
|
matchingColumn: string;
|
|
@@ -17,7 +19,7 @@ type UrlParameters = {
|
|
|
17
19
|
export const boundaryTableSource = async function (
|
|
18
20
|
options: BoundaryTableSourceOptions
|
|
19
21
|
): Promise<TilejsonResult> {
|
|
20
|
-
const {tilesetTableName, columns, matchingColumn = 'id', propertiesTableName} = options;
|
|
22
|
+
const {filters, tilesetTableName, columns, matchingColumn = 'id', propertiesTableName} = options;
|
|
21
23
|
const urlParameters: UrlParameters = {
|
|
22
24
|
tilesetTableName,
|
|
23
25
|
matchingColumn,
|
|
@@ -27,5 +29,8 @@ export const boundaryTableSource = async function (
|
|
|
27
29
|
if (columns) {
|
|
28
30
|
urlParameters.columns = columns.join(',');
|
|
29
31
|
}
|
|
32
|
+
if (filters) {
|
|
33
|
+
urlParameters.filters = JSON.stringify(filters);
|
|
34
|
+
}
|
|
30
35
|
return baseSource<UrlParameters>('boundary', options, urlParameters) as Promise<TilejsonResult>;
|
|
31
36
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
|
+
import {DEFAULT_AGGREGATION_RES_LEVEL_H3} from '../constants';
|
|
2
3
|
import {baseSource} from './base-source';
|
|
3
4
|
import type {
|
|
4
5
|
AggregationOptions,
|
|
@@ -23,7 +24,7 @@ export const h3QuerySource = async function (
|
|
|
23
24
|
): Promise<TilejsonResult> {
|
|
24
25
|
const {
|
|
25
26
|
aggregationExp,
|
|
26
|
-
aggregationResLevel =
|
|
27
|
+
aggregationResLevel = DEFAULT_AGGREGATION_RES_LEVEL_H3,
|
|
27
28
|
sqlQuery,
|
|
28
29
|
spatialDataColumn = 'h3',
|
|
29
30
|
queryParameters
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
|
+
import {DEFAULT_AGGREGATION_RES_LEVEL_H3} from '../constants';
|
|
2
3
|
import {baseSource} from './base-source';
|
|
3
4
|
import type {
|
|
4
5
|
AggregationOptions,
|
|
@@ -13,7 +14,6 @@ export type H3TableSourceOptions = SourceOptions & TableSourceOptions & Aggregat
|
|
|
13
14
|
type UrlParameters = {
|
|
14
15
|
aggregationExp: string;
|
|
15
16
|
aggregationResLevel?: string;
|
|
16
|
-
columns?: string;
|
|
17
17
|
spatialDataType: SpatialDataType;
|
|
18
18
|
spatialDataColumn?: string;
|
|
19
19
|
name: string;
|
|
@@ -24,8 +24,7 @@ export const h3TableSource = async function (
|
|
|
24
24
|
): Promise<TilejsonResult> {
|
|
25
25
|
const {
|
|
26
26
|
aggregationExp,
|
|
27
|
-
aggregationResLevel =
|
|
28
|
-
columns,
|
|
27
|
+
aggregationResLevel = DEFAULT_AGGREGATION_RES_LEVEL_H3,
|
|
29
28
|
spatialDataColumn = 'h3',
|
|
30
29
|
tableName
|
|
31
30
|
} = options;
|
|
@@ -39,8 +38,5 @@ export const h3TableSource = async function (
|
|
|
39
38
|
if (aggregationResLevel) {
|
|
40
39
|
urlParameters.aggregationResLevel = String(aggregationResLevel);
|
|
41
40
|
}
|
|
42
|
-
if (columns) {
|
|
43
|
-
urlParameters.columns = columns.join(',');
|
|
44
|
-
}
|
|
45
41
|
return baseSource<UrlParameters>('table', options, urlParameters) as Promise<TilejsonResult>;
|
|
46
42
|
};
|
package/src/sources/index.ts
CHANGED
|
@@ -36,3 +36,10 @@ export type {VectorTableSourceOptions} from './vector-table-source';
|
|
|
36
36
|
|
|
37
37
|
export {vectorTilesetSource} from './vector-tileset-source';
|
|
38
38
|
export type {VectorTilesetSourceOptions} from './vector-tileset-source';
|
|
39
|
+
|
|
40
|
+
export type {
|
|
41
|
+
SourceOptions,
|
|
42
|
+
QuerySourceOptions,
|
|
43
|
+
TableSourceOptions,
|
|
44
|
+
TilesetSourceOptions
|
|
45
|
+
} from './types';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
|
+
import {DEFAULT_AGGREGATION_RES_LEVEL_QUADBIN} from '../constants';
|
|
2
3
|
import {baseSource} from './base-source';
|
|
3
4
|
import type {
|
|
4
5
|
AggregationOptions,
|
|
@@ -24,7 +25,7 @@ export const quadbinQuerySource = async function (
|
|
|
24
25
|
): Promise<TilejsonResult> {
|
|
25
26
|
const {
|
|
26
27
|
aggregationExp,
|
|
27
|
-
aggregationResLevel =
|
|
28
|
+
aggregationResLevel = DEFAULT_AGGREGATION_RES_LEVEL_QUADBIN,
|
|
28
29
|
sqlQuery,
|
|
29
30
|
spatialDataColumn = 'quadbin',
|
|
30
31
|
queryParameters
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
|
+
import {DEFAULT_AGGREGATION_RES_LEVEL_QUADBIN} from '../constants';
|
|
2
3
|
import {baseSource} from './base-source';
|
|
3
4
|
import type {
|
|
4
5
|
AggregationOptions,
|
|
@@ -13,7 +14,6 @@ export type QuadbinTableSourceOptions = SourceOptions & TableSourceOptions & Agg
|
|
|
13
14
|
type UrlParameters = {
|
|
14
15
|
aggregationExp: string;
|
|
15
16
|
aggregationResLevel?: string;
|
|
16
|
-
columns?: string;
|
|
17
17
|
spatialDataType: SpatialDataType;
|
|
18
18
|
spatialDataColumn?: string;
|
|
19
19
|
name: string;
|
|
@@ -24,8 +24,7 @@ export const quadbinTableSource = async function (
|
|
|
24
24
|
): Promise<TilejsonResult> {
|
|
25
25
|
const {
|
|
26
26
|
aggregationExp,
|
|
27
|
-
aggregationResLevel =
|
|
28
|
-
columns,
|
|
27
|
+
aggregationResLevel = DEFAULT_AGGREGATION_RES_LEVEL_QUADBIN,
|
|
29
28
|
spatialDataColumn = 'quadbin',
|
|
30
29
|
tableName
|
|
31
30
|
} = options;
|
|
@@ -40,8 +39,5 @@ export const quadbinTableSource = async function (
|
|
|
40
39
|
if (aggregationResLevel) {
|
|
41
40
|
urlParameters.aggregationResLevel = String(aggregationResLevel);
|
|
42
41
|
}
|
|
43
|
-
if (columns) {
|
|
44
|
-
urlParameters.columns = columns.join(',');
|
|
45
|
-
}
|
|
46
42
|
return baseSource<UrlParameters>('table', options, urlParameters) as Promise<TilejsonResult>;
|
|
47
43
|
};
|
package/src/sources/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type {Feature} from 'geojson';
|
|
2
|
-
import type {Format, MapInstantiation, QueryParameters} from '../api/types';
|
|
2
|
+
import type {Filters, Format, MapInstantiation, QueryParameters} from '../api/types';
|
|
3
3
|
|
|
4
4
|
export type SourceRequiredOptions = {
|
|
5
5
|
/** Carto platform access token. */
|
|
@@ -57,6 +57,13 @@ export type AggregationOptions = {
|
|
|
57
57
|
aggregationResLevel?: number;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
+
export type FilterOptions = {
|
|
61
|
+
/**
|
|
62
|
+
* Filters to apply to the data source on the server
|
|
63
|
+
*/
|
|
64
|
+
filters?: Filters;
|
|
65
|
+
};
|
|
66
|
+
|
|
60
67
|
export type QuerySourceOptions = {
|
|
61
68
|
/**
|
|
62
69
|
* The column name and the type of geospatial support.
|
|
@@ -68,6 +75,21 @@ export type QuerySourceOptions = {
|
|
|
68
75
|
/** SQL query. */
|
|
69
76
|
sqlQuery: string;
|
|
70
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Relative resolution of a tile. Higher values increase density and data size. At `tileResolution = 1`, tile geometry is
|
|
80
|
+
* quantized to a 1024x1024 grid. Increasing or decreasing the resolution will increase or decrease the dimensions of
|
|
81
|
+
* the quantization grid proportionately.
|
|
82
|
+
*
|
|
83
|
+
* Supported `tileResolution` values, with corresponding grid sizes:
|
|
84
|
+
*
|
|
85
|
+
* - 0.25: 256x256
|
|
86
|
+
* - 0.5: 512x512
|
|
87
|
+
* - 1: 1024x1024
|
|
88
|
+
* - 2: 2048x2048
|
|
89
|
+
* - 4: 4096x4096
|
|
90
|
+
*/
|
|
91
|
+
tileResolution?: TileResolution;
|
|
92
|
+
|
|
71
93
|
/**
|
|
72
94
|
* Values for named or positional paramteres in the query.
|
|
73
95
|
*
|
|
@@ -102,18 +124,26 @@ export type TableSourceOptions = {
|
|
|
102
124
|
tableName: string;
|
|
103
125
|
|
|
104
126
|
/**
|
|
105
|
-
*
|
|
127
|
+
* The column name and the type of geospatial support.
|
|
106
128
|
*
|
|
107
|
-
* If not present,
|
|
129
|
+
* If not present, defaults to `'geom'` for generic tables, `'quadbin'` for Quadbin sources and `'h3'` for H3 sources.
|
|
108
130
|
*/
|
|
109
|
-
|
|
131
|
+
spatialDataColumn?: string;
|
|
110
132
|
|
|
111
133
|
/**
|
|
112
|
-
*
|
|
134
|
+
* Relative resolution of a tile. Higher values increase density and data size. At `tileResolution = 1`, tile geometry is
|
|
135
|
+
* quantized to a 1024x1024 grid. Increasing or decreasing the resolution will increase or decrease the dimensions of
|
|
136
|
+
* the quantization grid proportionately.
|
|
113
137
|
*
|
|
114
|
-
*
|
|
138
|
+
* Supported `tileResolution` values, with corresponding grid sizes:
|
|
139
|
+
*
|
|
140
|
+
* - 0.25: 256x256
|
|
141
|
+
* - 0.5: 512x512
|
|
142
|
+
* - 1: 1024x1024
|
|
143
|
+
* - 2: 2048x2048
|
|
144
|
+
* - 4: 4096x4096
|
|
115
145
|
*/
|
|
116
|
-
|
|
146
|
+
tileResolution?: TileResolution;
|
|
117
147
|
};
|
|
118
148
|
|
|
119
149
|
export type TilesetSourceOptions = {
|
|
@@ -123,12 +153,23 @@ export type TilesetSourceOptions = {
|
|
|
123
153
|
tableName: string;
|
|
124
154
|
};
|
|
125
155
|
|
|
156
|
+
export type ColumnsOption = {
|
|
157
|
+
/**
|
|
158
|
+
* Columns to retrieve from the table.
|
|
159
|
+
*
|
|
160
|
+
* If not present, all columns are returned.
|
|
161
|
+
*/
|
|
162
|
+
columns?: string[];
|
|
163
|
+
};
|
|
164
|
+
|
|
126
165
|
export type SpatialDataType = 'geo' | 'h3' | 'quadbin';
|
|
127
166
|
|
|
128
167
|
export type TilejsonMapInstantiation = MapInstantiation & {
|
|
129
168
|
tilejson: {url: string[]};
|
|
130
169
|
};
|
|
131
170
|
|
|
171
|
+
export type TileResolution = 0.25 | 0.5 | 1 | 2 | 4;
|
|
172
|
+
|
|
132
173
|
export interface Tilejson {
|
|
133
174
|
tilejson: string;
|
|
134
175
|
name: string;
|
|
@@ -146,6 +187,7 @@ export interface Tilejson {
|
|
|
146
187
|
center: [number, number, number];
|
|
147
188
|
vector_layers: VectorLayer[];
|
|
148
189
|
tilestats: Tilestats;
|
|
190
|
+
tileResolution?: TileResolution;
|
|
149
191
|
}
|
|
150
192
|
|
|
151
193
|
export interface Tilestats {
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
|
+
import {DEFAULT_TILE_RESOLUTION} from '../constants';
|
|
2
3
|
import {baseSource} from './base-source';
|
|
3
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
FilterOptions,
|
|
6
|
+
SourceOptions,
|
|
7
|
+
QuerySourceOptions,
|
|
8
|
+
SpatialDataType,
|
|
9
|
+
TilejsonResult,
|
|
10
|
+
ColumnsOption
|
|
11
|
+
} from './types';
|
|
12
|
+
|
|
13
|
+
export type VectorQuerySourceOptions = SourceOptions &
|
|
14
|
+
QuerySourceOptions &
|
|
15
|
+
FilterOptions &
|
|
16
|
+
ColumnsOption;
|
|
4
17
|
|
|
5
|
-
export type VectorQuerySourceOptions = SourceOptions & QuerySourceOptions;
|
|
6
18
|
type UrlParameters = {
|
|
19
|
+
columns?: string;
|
|
20
|
+
filters?: string;
|
|
7
21
|
spatialDataType: SpatialDataType;
|
|
8
22
|
spatialDataColumn?: string;
|
|
23
|
+
tileResolution?: string;
|
|
9
24
|
q: string;
|
|
10
25
|
queryParameters?: string;
|
|
11
26
|
};
|
|
@@ -13,9 +28,28 @@ type UrlParameters = {
|
|
|
13
28
|
export const vectorQuerySource = async function (
|
|
14
29
|
options: VectorQuerySourceOptions
|
|
15
30
|
): Promise<TilejsonResult> {
|
|
16
|
-
const {
|
|
17
|
-
|
|
31
|
+
const {
|
|
32
|
+
columns,
|
|
33
|
+
filters,
|
|
34
|
+
spatialDataColumn = 'geom',
|
|
35
|
+
sqlQuery,
|
|
36
|
+
tileResolution = DEFAULT_TILE_RESOLUTION,
|
|
37
|
+
queryParameters
|
|
38
|
+
} = options;
|
|
39
|
+
|
|
40
|
+
const urlParameters: UrlParameters = {
|
|
41
|
+
spatialDataColumn,
|
|
42
|
+
spatialDataType: 'geo',
|
|
43
|
+
tileResolution: tileResolution.toString(),
|
|
44
|
+
q: sqlQuery
|
|
45
|
+
};
|
|
18
46
|
|
|
47
|
+
if (columns) {
|
|
48
|
+
urlParameters.columns = columns.join(',');
|
|
49
|
+
}
|
|
50
|
+
if (filters) {
|
|
51
|
+
urlParameters.filters = JSON.stringify(filters);
|
|
52
|
+
}
|
|
19
53
|
if (queryParameters) {
|
|
20
54
|
urlParameters.queryParameters = JSON.stringify(queryParameters);
|
|
21
55
|
}
|
|
@@ -1,23 +1,51 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
|
+
import {DEFAULT_TILE_RESOLUTION} from '../constants';
|
|
2
3
|
import {baseSource} from './base-source';
|
|
3
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
FilterOptions,
|
|
6
|
+
ColumnsOption,
|
|
7
|
+
SourceOptions,
|
|
8
|
+
SpatialDataType,
|
|
9
|
+
TableSourceOptions,
|
|
10
|
+
TilejsonResult
|
|
11
|
+
} from './types';
|
|
4
12
|
|
|
5
|
-
export type VectorTableSourceOptions = SourceOptions &
|
|
13
|
+
export type VectorTableSourceOptions = SourceOptions &
|
|
14
|
+
TableSourceOptions &
|
|
15
|
+
FilterOptions &
|
|
16
|
+
ColumnsOption;
|
|
6
17
|
type UrlParameters = {
|
|
7
18
|
columns?: string;
|
|
19
|
+
filters?: string;
|
|
8
20
|
spatialDataType: SpatialDataType;
|
|
9
21
|
spatialDataColumn?: string;
|
|
22
|
+
tileResolution?: string;
|
|
10
23
|
name: string;
|
|
11
24
|
};
|
|
12
25
|
|
|
13
26
|
export const vectorTableSource = async function (
|
|
14
27
|
options: VectorTableSourceOptions
|
|
15
28
|
): Promise<TilejsonResult> {
|
|
16
|
-
const {
|
|
17
|
-
|
|
29
|
+
const {
|
|
30
|
+
columns,
|
|
31
|
+
filters,
|
|
32
|
+
spatialDataColumn = 'geom',
|
|
33
|
+
tableName,
|
|
34
|
+
tileResolution = DEFAULT_TILE_RESOLUTION
|
|
35
|
+
} = options;
|
|
36
|
+
|
|
37
|
+
const urlParameters: UrlParameters = {
|
|
38
|
+
name: tableName,
|
|
39
|
+
spatialDataColumn,
|
|
40
|
+
spatialDataType: 'geo',
|
|
41
|
+
tileResolution: tileResolution.toString()
|
|
42
|
+
};
|
|
18
43
|
|
|
19
44
|
if (columns) {
|
|
20
45
|
urlParameters.columns = columns.join(',');
|
|
21
46
|
}
|
|
47
|
+
if (filters) {
|
|
48
|
+
urlParameters.filters = JSON.stringify(filters);
|
|
49
|
+
}
|
|
22
50
|
return baseSource<UrlParameters>('table', options, urlParameters) as Promise<TilejsonResult>;
|
|
23
51
|
};
|
package/src/utils.ts
CHANGED
|
@@ -51,7 +51,11 @@ export function scaleIdentity() {
|
|
|
51
51
|
return unknown;
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
scale.copy = () =>
|
|
54
|
+
scale.copy = () => {
|
|
55
|
+
const scaleCopy = scaleIdentity();
|
|
56
|
+
scaleCopy.unknown(unknown);
|
|
57
|
+
return scaleCopy;
|
|
58
|
+
};
|
|
55
59
|
|
|
56
60
|
return scale;
|
|
57
61
|
}
|