diff client/src/store/map.js @ 1633:f034371c5d11

refac: move to map in staging component resolves now via id Currently we observe on some builds (not machines), that the zoom to a specific bottleneck does not work occasionaly. To exclude problems I restrucutred, how the information is resolved and included several assert statements to help hunting down this strange bug. The assert statemants could stay in the code anyways, because the do not do any harm.
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 20 Dec 2018 09:37:29 +0100
parents faa045ebdf0c
children 1fde2f48977b
line wrap: on
line diff
--- a/client/src/store/map.js	Thu Dec 20 08:42:06 2018 +0100
+++ b/client/src/store/map.js	Thu Dec 20 09:37:29 2018 +0100
@@ -385,7 +385,9 @@
       state.cutTool = cutTool;
     },
     moveMap: (state, { coordinates, zoom, preventZoomOut }) => {
+      console.assert(state.openLayersMap, "no Map found"); // inserted during bug hunt
       let view = state.openLayersMap.getView();
+      console.assert(view, "no view found"); // inserted during bug hunt
       const currentZoom = view.getZoom();
       view.animate({
         zoom: preventZoomOut ? Math.max(zoom, currentZoom) : zoom,