MCPcopy
hub / github.com/apache/echarts / moveHandler

Function moveHandler

extension-src/bmap/BMapView.ts:47–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 2

setMapOffsetMethod · 0.80
dispatchActionMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…