()
| 45 | const viewportRoot = api.getZr().painter.getViewportRoot(); |
| 46 | const coordSys = bMapModel.coordinateSystem; |
| 47 | const moveHandler = function () { |
| 48 | if (rendering) { |
| 49 | return; |
| 50 | } |
| 51 | const offsetEl = viewportRoot.parentNode.parentNode.parentNode as HTMLElement; |
| 52 | const mapOffset = [ |
| 53 | -parseInt(offsetEl.style.left, 10) || 0, |
| 54 | -parseInt(offsetEl.style.top, 10) || 0 |
| 55 | ]; |
| 56 | // only update style when map offset changed |
| 57 | const viewportRootStyle = viewportRoot.style; |
| 58 | const offsetLeft = mapOffset[0] + 'px'; |
| 59 | const offsetTop = mapOffset[1] + 'px'; |
| 60 | if (viewportRootStyle.left !== offsetLeft) { |
| 61 | viewportRootStyle.left = offsetLeft; |
| 62 | } |
| 63 | if (viewportRootStyle.top !== offsetTop) { |
| 64 | viewportRootStyle.top = offsetTop; |
| 65 | } |
| 66 | |
| 67 | coordSys.setMapOffset(mapOffset); |
| 68 | bMapModel.__mapOffset = mapOffset; |
| 69 | |
| 70 | api.dispatchAction({ |
| 71 | type: 'bmapRoam', |
| 72 | animation: { |
| 73 | duration: 0 |
| 74 | } |
| 75 | }); |
| 76 | }; |
| 77 | |
| 78 | function zoomEndHandler() { |
| 79 | if (rendering) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…