Mercurial > gemma
comparison 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 |
comparison
equal
deleted
inserted
replaced
1632:0123a120e999 | 1633:f034371c5d11 |
---|---|
383 }, | 383 }, |
384 cutTool: (state, cutTool) => { | 384 cutTool: (state, cutTool) => { |
385 state.cutTool = cutTool; | 385 state.cutTool = cutTool; |
386 }, | 386 }, |
387 moveMap: (state, { coordinates, zoom, preventZoomOut }) => { | 387 moveMap: (state, { coordinates, zoom, preventZoomOut }) => { |
388 console.assert(state.openLayersMap, "no Map found"); // inserted during bug hunt | |
388 let view = state.openLayersMap.getView(); | 389 let view = state.openLayersMap.getView(); |
390 console.assert(view, "no view found"); // inserted during bug hunt | |
389 const currentZoom = view.getZoom(); | 391 const currentZoom = view.getZoom(); |
390 view.animate({ | 392 view.animate({ |
391 zoom: preventZoomOut ? Math.max(zoom, currentZoom) : zoom, | 393 zoom: preventZoomOut ? Math.max(zoom, currentZoom) : zoom, |
392 center: fromLonLat(coordinates, view.getProjection()), | 394 center: fromLonLat(coordinates, view.getProjection()), |
393 duration: 700 | 395 duration: 700 |