-
Notifications
You must be signed in to change notification settings - Fork 1
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
Spatial index widgets second proposal #35
Spatial index widgets second proposal #35
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I prefer computing the spatialFilterResolution internally like this, thanks! This way the user can set the resolution explicitly if the want to, but they don't always need to have the right options to pass into a new function.
I'm not 100% sure about some of the properties moved around on SourceOptionalOptions
here, but that's easier to review after merging on the feature branch so I'm not worried about it now.
@juandjara @srtena any other concerns or preferences?
if (spatialFilter && source.spatialDataType !== 'geo') { | ||
assert( | ||
options.spatialFiltersResolution ?? viewState, | ||
'spatialFiltersResolution or viewState is required for using spatialFilter with spatial indexes' | ||
); | ||
} | ||
|
||
const spatialFiltersResolution = options.spatialFiltersResolution ?? ( | ||
getSpatialFiltersResolution({ source, viewState: viewState! }) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably we can move the common validation into getSpatialFiltersResolution
here, and call the function only if a spatial filter is being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, good call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case the assert message would need to change to something like
"viewState prop is required to compute automatic spatialFiltersResolution when using spatialFilter with spatial indexes. Either pass a spatialFiltersResolution
prop or a viewState
prop to avoid this error"
Following up on the conversation here: #34
This is an alternative implementation for the feature of adding widgets to spatial index sources configuring spatial filter to work in that case