feat(sources): Support featureBbox parameter#289
Conversation
There was a problem hiding this comment.
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.
| 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; | ||
| }; |
There was a problem hiding this comment.
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.
No description provided.