Skip to content

feat(sources): Support featureBbox parameter#289

Draft
felixpalmer wants to merge 7 commits intomainfrom
felix/autolabels-bbox
Draft

feat(sources): Support featureBbox parameter#289
felixpalmer wants to merge 7 commits intomainfrom
felix/autolabels-bbox

Conversation

@felixpalmer
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the featureBbox option to both vectorQuerySource and vectorTableSource, enabling the server to include bounding box properties for polygon features to support stable label positioning. The changes include updates to the option types, URL parameter logic, and the addition of corresponding unit tests. Feedback was provided regarding the duplication of the featureBbox property and its documentation across files, suggesting the use of a shared interface to improve maintainability.

Comment on lines +26 to +34
ColumnsOption & {
/**
* If `true`, the server includes a `_carto_bbox` property on each polygon
* feature, containing the bounding box of the full (unclipped) geometry as
* a `"west,south,east,north"` string in WGS84. Used by clients to compute
* stable label positions for polygons that span multiple tiles.
*/
featureBbox?: boolean;
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The featureBbox property and its detailed JSDoc are duplicated in both VectorQuerySourceOptions and VectorTableSourceOptions. Additionally, the property is added to the local UrlParameters type in both source files. To improve maintainability and prevent documentation drift, consider defining a shared interface (e.g., FeatureBboxOption) in src/sources/types.ts and using it in these intersections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant