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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix PR comment
  • Loading branch information
belom88 committed Oct 17, 2022
commit cf536e68735f03720bb645cd78591986e06c5504
44 changes: 22 additions & 22 deletions web/client/epics/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,31 +323,31 @@ export const searchOnStartEpic = (action$, store) =>
.then( (response = {}) => response.features && response.features.length && {...response.features[0], typeName: name})
)
.switchMap(({ type, geometry, typeName }) => {
let coord = pointOnSurface({ type, geometry }).geometry.coordinates;
const latlng = {lng: coord[0], lat: coord[1] };
const projection = projectionSelector(store.getState());
const { x, y } = reproject(
coord,
"EPSG:4326",
projection
);
const coord = pointOnSurface({ type, geometry }).geometry.coordinates;

let mapActionObservable;
if (isMapPopup(store.getState())) {
mapActionObservable = Rx.Observable.of(
addPopup(uuid(), {
component: IDENTIFY_POPUP,
maxWidth: 600,
position: { coordinates: [x, y] }
})
);
} else {
mapActionObservable = Rx.Observable.of(
showMapinfoMarker()
if (coord) {
const latlng = {lng: coord[0], lat: coord[1] };
const projection = projectionSelector(store.getState());
const { x, y } = reproject(
coord,
"EPSG:4326",
projection
);
}
let mapActionObservable;
if (isMapPopup(store.getState())) {
mapActionObservable = Rx.Observable.of(
addPopup(uuid(), {
component: IDENTIFY_POPUP,
maxWidth: 600,
position: { coordinates: [x, y] }
})
);
} else {
mapActionObservable = Rx.Observable.of(
showMapinfoMarker()
);
}

if (coord) {
// trigger get feature info
return Rx.Observable.of(
featureInfoClick(
Expand Down