The general problem is that because Baidu map point aggregation will lag slightly when it exceeds 1000 points, and after more than 5000, it is obvious that it is stuck or even the browser crashes, so it is necessary to modify the MarkerClusterer_min.js file introduced by Baidu Map external link.
JS source file of Baidu map aggregation:The hyperlink login is visible.
Modify three places to solve the lag, the modified js file, perfectly solves the phenomenon of lag, as shown in the figure below, more than 7,000 cars, the interface is not stuck, and the response speed has become very fast.
First: On line 198, MarkerClusterer.createClusters adds the following code at the end
Second: The following code is commented on line 494
Third: On line 511, a new method is added
Finally, attach the modified js file:
Tourists, if you want to see the hidden content of this post, please Reply
|