Skip to content
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

Merged

Conversation

belom88
Copy link
Contributor

@belom88 belom88 commented Oct 10, 2022

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)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

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)

  • Yes, and I documented them in migration notes
  • No

Other useful information

Steps to reproduce on local environment:

  • Set "showInMapPopup": true in the config
  • Create a map with "Manhattan (NY) points of interest";
  • Open new map with URL: 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}]
@belom88 belom88 self-assigned this Oct 10, 2022
@belom88 belom88 removed the request for review from alex-fko October 10, 2022 07:58
@tdipisa tdipisa added this to the 2022.02.01 milestone Oct 10, 2022
@@ -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');
Copy link
Contributor

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


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())
Copy link
Contributor

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

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.

@@ -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());
Copy link
Contributor

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

@allyoucanmap allyoucanmap merged commit 1a4ae42 into geosolutions-it:master Oct 17, 2022
@allyoucanmap
Copy link
Contributor

@ElenaGallo please test on dev and let us know when we can backport this on branch stable 2022.02.xx, thanks

@ElenaGallo
Copy link
Contributor

Test passed on DEV, @belom88 please backport this on branch stable 2022.02.xx. Thanks

@ElenaGallo ElenaGallo added the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Oct 18, 2022
@tdipisa tdipisa removed the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment