-
Notifications
You must be signed in to change notification settings - Fork 46
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: query with geo bounding box #148
feat: query with geo bounding box #148
Conversation
@ruanyl Looking really good. Thanks for making the changes. Two comments. Can we add check box (instead of switch) inside Filters section like below to decide whether to apply this filter or not? |
Hi @VijayanB, thanks for the comments!
From the end user's point of view, when they are viewing the map, they may not interested in how the data is loaded and adding this checkbox may confuse the user. But of course, this is just my two cents.
To fix the issue, we would need to unsubscribe the previous event listener whenever adding the new event listener when layer config changed, we do this for It seems it's not a trivial task to refactor this part, I'd suggest to fix it in a separate task. |
Totally understand. However, adding filter implicitly (without an option to disable ) might confuse users too. This option was already available in Coordinate map, so i assume our users are aware of that.
Agree. Let's do it in separate task like your suggestion. |
@VijayanB Aha, you're right, thanks for the context, that makes sense to me 👍 |
@ruanyl Even when i haven't enable the option to use geo filters, i see requests are triggered in network tab and these requests for some reason have old time filter ex: i updated my time filter to 15 weeks, but, i see these requests uses old time filter vale ( 15 m) . |
@VijayanB Do you mean the global time filter is not applied? Is it a regression due to this PR? |
@VijayanB the above issue should have been fixed now |
maps_dashboards/public/components/map_container/map_container.tsx
Outdated
Show resolved
Hide resolved
@@ -303,6 +309,16 @@ export const DocumentLayerSource = ({ | |||
filters={selectedLayerConfig.source.filters ?? []} | |||
onFiltersUpdated={onFiltersUpdated} | |||
/> | |||
<EuiSpacer /> | |||
<EuiFormRow> | |||
<EuiSwitch |
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 found out that switch is preferred if an action is performed immediately. In this case, the update happens after user update layer config. Shall we change this control to checkbox?
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 the screenshot you shared, it's a switch component, shall we make it consistent?
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.
Yeah. I shared screenshot from existing component ( i thought i mentioned in text), but i received this feedback from UX designer for tooltip. We also changed to checkbox for tooltip too.
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.
That's clear, I will update.
maps_dashboards/public/components/layer_config/documents_config/document_layer_source.tsx
Show resolved
Hide resolved
@ruanyl can you rebase with latest changes? Thanks |
98e942e
to
53a48ee
Compare
const mapBounds = maplibreRef.current.getBounds(); | ||
const filterBoundingBox = { | ||
bottom_right: { | ||
lon: adjustLongitudeForSearch(mapBounds.getSouthEast().lng), |
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.
Will calling mapBounds.getSouthEast().wrap() solves this problem?
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.
@VijayanB that won't work out of the box, calling wrap()
will wrap the longitude to range (-180, 180]
. In the screenshot, after wrapping, the longitude of left bounding is great than the right bounding, the consequence is OpenSearch won't return results from the expected bounding box. What do people usually do to tackle this issue in a map application?
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 got your point, let's keep your existing solution for bounds crossing date line. I can ask around, but on top of my head i might consider break it into two polygon and add or filter :)
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.
For this did we break the query? I hope no because geobounding box query takes care of these things in the code.
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.
@navneet1v i raised new PR to support corner cases here: #175 . Here, i didn't break it into multiple query, instead wrapped the bounds. However, i had put ceiling to MIN/MAX if at least one complete map is visible. ( hybrid approach ) Let me know whether you see any problem with that approach.
@junqiu-lei @VijayanB Could you check the PR again? |
Sure. Since there is a conflict, can you rebase? Sorry for keeping this PR unmerged |
- allow user to turn on/off geo bounding box query display a switch in map filter config panel to allow user to switch on/off geo bounding box query - search requests will only be sent for layers which have geo bounding query enabled - geo bounding box query will applied global filters Bug fixes: - fixed wrong maplibre instance passed to addTooltip() function which results in a runtime error - fixed empty onHover popup rendered on layer which has tooltip disabled Signed-off-by: Yulong Ruan <[email protected]>
687a8bb
to
17a3316
Compare
@VijayanB No worry, the PR is updated now :) |
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.
Thanks! The PR Looks good to me.
Signed-off-by: Yulong Ruan <[email protected]>
What's changed:
Bug fixes:
Signed-off-by: Yulong Ruan [email protected]
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.