Skip to content

Commit

Permalink
Fix geosolutions-it#10243 removing toggle mode of non active longitud…
Browse files Browse the repository at this point in the history
…inal profile tool (geosolutions-it#10248)

* Fix geosolutions-it#10243 removing toggle mode of non active longitudinal profile tool

* this was causing the identify to toggle state twice instead of one

* changed some logic to the interaction with mapinfo state

* for street and long profile tool plugins
  • Loading branch information
MV88 authored Apr 24, 2024
1 parent fe92908 commit c236d43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions web/client/epics/longitudinalProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export const LPonDrawActivatedEpic = (action$, store) =>
);
})
.startWith(
unRegisterEventListener('click', CONTROL_NAME),
registerEventListener('click', CONTROL_NAME),
changeMapInfoState(false),
purgeMapInfoResults(),
hideMapinfoMarker(),
Expand All @@ -156,7 +156,7 @@ export const LPonDrawActivatedEpic = (action$, store) =>
return Rx.Observable.from([
purgeMapInfoResults(),
hideMapinfoMarker(),
toggleMapInfoState(),
changeMapInfoState(mode !== undefined),
...(get(store.getState(), 'draw.drawOwner', '') === CONTROL_NAME ? DEACTIVATE_ACTIONS : []),
unRegisterEventListener('click', CONTROL_NAME)
]);
Expand Down Expand Up @@ -385,7 +385,7 @@ export const LPresetLongitudinalToolOnDrawToolActiveEpic = (action$, store) => s
() => {
return Rx.Observable.of(toggleMode());
},
() => dataSourceModeSelector(store.getState())
() => dataSourceModeSelector(store.getState()) === "draw"
);

/**
Expand Down
7 changes: 3 additions & 4 deletions web/client/plugins/StreetView/epics/streetView.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { updateAdditionalLayer, removeAdditionalLayer } from '../../../actions/a
import { CLICK_ON_MAP, registerEventListener, unRegisterEventListener } from '../../../actions/map';


import {hideMapinfoMarker, toggleMapInfoState} from '../../../actions/mapInfo';
import {hideMapinfoMarker, changeMapInfoState} from '../../../actions/mapInfo';
import { mapInfoEnabledSelector } from "../../../selectors/mapInfo";

import { CONTROL_NAME, STREET_VIEW_OWNER, STREET_VIEW_DATA_LAYER_ID } from "../constants";
Expand Down Expand Up @@ -42,19 +42,18 @@ export const disableGFIForStreetViewEpic = (action$, { getState = () => { } }) =
.filter(({control}) => control === CONTROL_NAME)
// if the enable event happens when the mapInfo is active
.filter(() => enabledSelector(getState()))
.filter(() => mapInfoEnabledSelector(getState()))
.switchMap(() => {
// deactivate feature info
return Rx.Observable.of(hideMapinfoMarker(),
toggleMapInfoState()
changeMapInfoState(false) // always disable feature info
).merge(
// restore feature info on close
action$.ofType(TOGGLE_CONTROL, SET_CONTROL_PROPERTY, SET_CONTROL_PROPERTIES)
.filter(({control}) => control === CONTROL_NAME)
.take(1)
.filter(() => !enabledSelector(getState()))
.filter(() => !mapInfoEnabledSelector(getState()))
.mapTo(toggleMapInfoState())
.mapTo(changeMapInfoState(true))
.takeUntil(action$.ofType(RESET_CONTROLS))
);
});
Expand Down

0 comments on commit c236d43

Please sign in to comment.