mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[dashboard] fix map center change shows unsaved change after clicking reset (#213445)
Closes https://github.com/elastic/kibana/issues/213444 The problem is setting the view with the globe view may not set the view to the exact value. For example setting zoom to 1.74 may move the map to zoom 1.77. PR resolves this problem by adding a margin of error for comparing zoom differences. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
da4ab47ff6
commit
ea266bcd7e
1 changed files with 10 additions and 1 deletions
|
@ -219,7 +219,16 @@ export function initializeReduxSync({
|
|||
(nextValue: MapCenterAndZoom) => {
|
||||
store.dispatch(setGotoWithCenter(nextValue));
|
||||
},
|
||||
fastIsEqual,
|
||||
(a, b) => {
|
||||
if (!a || !b) {
|
||||
return a === b;
|
||||
}
|
||||
|
||||
if (a.lat !== b.lat) return false;
|
||||
if (a.lon !== b.lon) return false;
|
||||
// Map may not restore reset zoom exactly
|
||||
return Math.abs(a.zoom - b.zoom) < 0.05;
|
||||
},
|
||||
],
|
||||
openTOCDetails: [
|
||||
openTOCDetails$,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue