Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tileset): Improve filter and spatial filter API for tilesets #103

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

donmccurdy
Copy link
Member

@donmccurdy donmccurdy commented Feb 14, 2025

For tilesets, filters cannot be specified in source functions like vectorTilesetSource. Both filters and spatial filters need to be applied in a pre-pass on the tile data, before computing widget results. In #50 this was originally set up similarly to C4R, with three distinct steps for (1) loading tiles, (2) extracting tile features, and (3) computing results. For simpler usage, we'd like to hide step (2), and in most cases users can simply do this:

// (1)
widgetSource.loadTiles(tiles);

// (2)
const result = await widgetSource.getFormula({..., filters, spatialFilter});

For the less common cases where the storeGeometry or uniqueIdProperty options need to be specified, that can be done once, and doesnt need to be reconfigured when new tiles are loaded:

// (optional)
widgetSource.setTileExtractOptions({
  uniqueIdProperty: 'my_custom_id',
  storeGeometry: true
});

@donmccurdy donmccurdy added the enhancement New feature or request label Feb 14, 2025
@donmccurdy donmccurdy requested review from a team and srtena February 14, 2025 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant