Skip to content

Commit 94579ca

Browse files
【fix】 fix Esheatmap 停止后继续渲染数据 review by songym
1 parent 6312328 commit 94579ca

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

examples/leaflet/ESHeatMap.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<script type="text/javascript" include="mapv,elasticsearch" src="../../dist/leaflet/include-leaflet.js"></script>
2929
<script type="text/javascript">
3030
var map,
31+
stopRender,
3132
timeControl,
3233
liveESService,
3334
liveRenderer,
@@ -78,16 +79,18 @@
7879
timeControl.updateOptions(options);
7980
}
8081
timeControl.start();
82+
stopRender = false;
8183
}
8284

8385
//暂停播放
8486
function pause() {
85-
timeControl.pause();
87+
timeControl && timeControl.pause();
8688
}
8789

8890
//停止播放
8991
function stop() {
90-
timeControl.stop();
92+
stopRender = true;
93+
timeControl && timeControl.stop();
9194
clearAll();
9295
}
9396

@@ -109,7 +112,9 @@
109112
if (startT > endT) {
110113
return;
111114
}
115+
112116
var coords = wrapLatLngBounds(extent), prec;
117+
113118
if (level <= 2) {
114119
prec = 2;
115120
} else if (level > 2 && level <= 5) {
@@ -174,7 +179,7 @@
174179
console.log(error.body);
175180
return;
176181
}
177-
renderLive(response.aggregations.zoomedInView.geohash.buckets);
182+
!stopRender && renderLive(response.aggregations.zoomedInView.geohash.buckets);
178183
});
179184
}
180185

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy