Commit 0b3c11ea authored by Viacheslav Pavlov's avatar Viacheslav Pavlov

Merge branch '611-select-area-functionality' into 'master'

Resolve "Select area functionality"

Closes #611

See merge request genesys-pgr/genesys-ui!598
parents 3d39a107 65705583
......@@ -176,7 +176,7 @@ export const loadAccessionsMapInfo = (filters: string | AccessionFilter, viewPor
viewPort && viewPort.center && `/@${viewPort.center[0].toFixed(6)},${viewPort.center[1].toFixed(6)},${viewPort.zoom}z`),
);
} else {
dispatch(updateRouteWithFilterCode(mapInfo.filterCode, '/a/map', null, '/@0,0,3z'));
dispatch(updateRouteWithFilterCode(mapInfo.filterCode, '/a/map'));
}
});
};
......
......@@ -364,6 +364,9 @@ class MapPage extends React.Component<IMapPageProps, any> {
private handleMoveEnd = (e) => {
const {navigateTo, filterCode} = this.props;
if (this.mapRef) {
if (this.state.moveStarted) {
this.setState({moveStarted: false});
}
const {viewport: {center, zoom}} = this.mapRef;
// console.log('Updating URL center: ', center, ' Zoom: ', zoom);
if (center && (center[0] !== 0 || center[1] !== 0)) {
......@@ -409,7 +412,7 @@ class MapPage extends React.Component<IMapPageProps, any> {
this.clickTimeout = null;
return;
}
this.clickTimeout = setTimeout(() => {
this.clickTimeout = !trackAreaSelect && setTimeout(() => {
console.log('started');
......@@ -467,7 +470,7 @@ class MapPage extends React.Component<IMapPageProps, any> {
if (trackAreaSelect) {
const classList = e.originalEvent.target.classList;
if (!classList || !classList.contains('leaflet-interactive') || classList.contains('leaflet-container')) {
setTimeout(() => this.setState({trackAreaSelect: false, mouseDown: false}));
this.setState({trackAreaSelect: false, mouseDown: false});
return;
}
}
......@@ -521,7 +524,7 @@ class MapPage extends React.Component<IMapPageProps, any> {
private onMapClick = (e) => {
if (e.originalEvent.target.className.indexOf('leaflet-touch') === -1) {
if (e.originalEvent.target.className.indexOf('leaflet-container') === -1) {
return;
}
this.setState({mouseDown: true});
......
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