Commit 4845ad3d authored by juminet's avatar juminet

[client/geothermie] issue 67 : reset XY on Graph when map moving

parent 28ab8e2d
......@@ -101,9 +101,14 @@ observe('port/map/top/view', v => {
}
});
export const setGraphXy = (xy: GraphXY) => assign('geo/graph/xy', xy);
export const setGraphXy = (xy: GraphXY | null) => assign('geo/graph/xy', xy);
export const setGraphSnapXy = (xy: GraphXY) => assign('geo/graph/snap-xy', xy);
export const setGraphSnapXy = (xy: GraphXY | null) => assign('geo/graph/snap-xy', xy);
export const resetGraphXY = () => {
setGraphXy(null);
setGraphSnapXy(null);
}
export const setMoreTextHidden = (key: keyof MoreTextHidden, index: number) => {
const arr: boolean[] = getMoreTextHiddenArray(key);
......
......@@ -8,7 +8,7 @@ import { scopeOption } from 'sdi/lib';
import { SystemIO } from '../components/geothermie';
import { fromEither } from 'fp-ts/lib/Option';
import { getSystem, getAddress } from '../queries/geothermie';
import { setXY, setAddress, setDataPoint, setDataConstraint } from './geothermie';
import { setXY, setAddress, setDataPoint, setDataConstraint, resetGraphXY } from './geothermie';
import { fetchPoint, fetchConstraint } from '../remote';
import { queryReverseGeocoder } from 'sdi/ports/geocoder';
import { setInteractionClick, centerMapOn } from './map';
......@@ -96,6 +96,8 @@ const initXY =
fetchConstraint(x, y).then(
r => setDataConstraint(r)
);
resetGraphXY();
};
// Route handlers
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment