-
Notifications
You must be signed in to change notification settings - Fork 414
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
#8578 SEARCH_WITH_FILTER action: add popup support #8673
#8578 SEARCH_WITH_FILTER action: add popup support #8673
Conversation
web/client/epics/search.js
Outdated
@@ -321,9 +324,14 @@ export const searchOnStartEpic = (action$, store) => | |||
.switchMap(({ type, geometry, typeName }) => { | |||
let coord = pointOnSurface({ type, geometry }).geometry.coordinates; | |||
const latlng = {lng: coord[0], lat: coord[1] }; | |||
const {x, y} = reproject(coord, 'EPSG:4326', 'EPSG:3857'); |
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.
the current map could have a different projection from EPSG:3857 so please use projectionSelector
from the map selectors to get the correct one
web/client/epics/search.js
Outdated
|
||
if (coord) { // trigger get feature info | ||
return Rx.Observable.of(featureInfoClick({latlng}, typeName, [typeName], {[typeName]: {cql_filter: cqlFilter}}), showMapinfoMarker()); | ||
return Rx.Observable.of(featureInfoClick({latlng}, typeName, [typeName], {[typeName]: {cql_filter: cqlFilter}}), showMapinfoMarker()) |
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.
There is a marker on the map after closing the popup and this is due to the showMapinfoMarker() action.
We should avoid to dispatch showMapinfoMarker if the isMapPopup is true bacause the marker should be hidden, the popup is already showing the position.
marker-popup-bug.mp4
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 also think it's better to hide the marker when we use popup display option.
web/client/epics/search.js
Outdated
@@ -299,7 +303,7 @@ export const zoomAndAddPointEpic = (action$, store) => | |||
export const searchOnStartEpic = (action$, store) => | |||
action$.ofType(SEARCH_LAYER_WITH_FILTER) | |||
.switchMap(({layer: name, "cql_filter": cqlFilter}) => { | |||
const state = store.getState(); | |||
const state = store.getState(store.getState()); |
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.
please fix this get state
@ElenaGallo please test on dev and let us know when we can backport this on branch stable 2022.02.xx, thanks |
Test passed on DEV, @belom88 please backport this on branch stable 2022.02.xx. Thanks |
Description
Add popup support to
searchOnStartEpic
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
Issue
What is the current behavior?
#8578
What is the new behavior?
Works as expected
Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)
Other useful information
Steps to reproduce on local environment:
"showInMapPopup": true
in the configMapStore2/web/client/configs/localConfig.json
Line 335 in 0e3b035
http://localhost:8081/#/viewer/openlayers/19?actions=[{%22type%22:%22SEARCH:SEARCH_WITH_FILTER%22,%22cql_filter%22:%22NAME='art'%22,%22layer%22:%22tiger:poi2%22}]