Skip to content

Commit 3c9437e

Browse files
committed
add async log
1 parent 0cf833c commit 3c9437e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

_posts/2019-02-02-car-location.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@
373373
renderLineGroup: function(splitedPoints){
374374
var map = this.baiduMap.map;
375375
map.clearOverlays();
376-
var _this = this;
377376
var edgePoints = [];
378377
var lineGroupArr = [];
379378
splitedPoints.forEach(pointsGroup => {
@@ -384,14 +383,24 @@
384383
map.setViewport(edgePoints);
385384
this.lineGroupArr = lineGroupArr;
386385
this.renderLineGroupController(lineGroupArr);
386+
this.asyncLogReallyPointsCount(splitedPoints);
387387
},
388388
renderLineGroupController: function(lineGroupArr){
389389
var html = '';
390390
lineGroupArr.forEach((i, index) => {
391391
html += `<label><input type="checkbox" data-index="${index}" checked />第${index + 1}段</label>`;
392392
});
393393
$lineGroupControl.innerHTML = html;
394-
}
394+
},
395+
asyncLogReallyPointsCount: function(splitedPoints){
396+
setTimeout(function(){
397+
var count = 0;
398+
splitedPoints.forEach(i => {
399+
i.forEach(j => count += j.points.length);
400+
});
401+
$log.innerHTML += `&nbsp;实际渲染${count}个点`;
402+
}, 100);
403+
}
395404
};
396405
pageControl.init();
397406
function LineGroup(baiduMap, pointsGroup){

0 commit comments

Comments
 (0)