CartoDB / carto-vl

CARTO VL: a Javascript library to create vector-based visualizations
BSD 3-Clause "New" or "Revised" License
129 stars 26 forks source link

Update BQTileset metadata #1443

Closed Jesus89 closed 4 years ago

Jesus89 commented 4 years ago
const data = { project, dataset, tileset, token };
const metadata = { id_property: 'geoid', center: null }; // optional

const source = new carto.source.BigQueryTileset(data, metadata);
/**
 * BigQueryTileset source: PoC based on the MVT source to fetch tiles directly from a tileset in BigQuery.
 *
 * @param {object} data - BigQuery data to reference the tileset:
 * @param {string} data.project - The name of the BigQuery project.
 * @param {string} data.dataset - The name of the BigQuery dataset.
 * @param {string} data.tileset - The name of the BigQuery tileset table.
 * @param {string} data.token   - The token to authorize requests to the BigQuery project.
 *
 * @param {object} [metadata] - Optional attributes to overwrite tileset metadata:
 * @param {string} [metadata.id_property] - The name of the ID property ('cartodb_id', 'geoid').
 * @param {object} [metadata.properties]  - The information about available columns and types in the MVT ('{"geoid": {"type": "STRING"}, ...').
 * @param {string} [metadata.maxzoom]     - The maximum zoom with tiles data ('14').
 * @param {string} [metadata.minzoom]     - The minimum zoom with tiles data ('4').
 * @param {string} [metadata.center]      - The initial position and zoom of the map ('-76.124268,38.933775,14')
 * @param {string} [metadata.bounds]      - The global bounds with tiles data available ('78.178689,0.000000,0.000000,39.719731').
 * @param {string} [metadata.compression] - The type of tile compression ('gzip').
 * @param {string} [metadata.tile_extent] - The size and resolution of the tile ('4096').
 * @param {string} [metadata.carto_quadkey_zoom] - The zoom level for quadkey optimization ('8')
 */