Skip to content

Commit a4f0c5c

Browse files
committed
Reduce point clustering flicker.
There are two different contributing factors: (1) some times zoom rounding caused a flicker. In floating point, 7.99999999 is essentially 8.0, but their floors are different. In general, round zoom values to six places. (2) gratuitous drawing during the zoom event. After reclustering, a point feature draw() call was being made. This is never necessary (at least on current master).
1 parent 24d0bb1 commit a4f0c5c

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

src/map.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,6 +1704,7 @@ var map = function (arg) {
17041704
* with other settings applied.
17051705
*/
17061706
function fix_zoom(zoom, ignoreDiscreteZoom) {
1707+
zoom = Math.round(zoom * 1e6) / 1e6;
17071708
zoom = Math.max(
17081709
Math.min(
17091710
m_validZoomRange.max,

src/pointFeature.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ var pointFeature = function (arg) {
143143
// prevent recomputing the clustering and set the new data array
144144
m_ignoreData = true;
145145
m_this.data(data);
146-
m_this.draw();
147146
};
148147

149148
////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)