Skip to content

Commit 3d4d785

Browse files
committed
【fix】关闭ScaleLine的render函数的this的sonar检查 review by liqian
1 parent b0c435c commit 3d4d785

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/openlayers/control/ScaleLine.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@ export class ScaleLine extends ol.control.ScaleLine {
2828

2929
constructor(options) {
3030
options = options || {};
31+
//需在super之前定义render,真正的调用是在初始化完成后
3132
options.render = function (mapEvent) {
3233
var frameState = mapEvent.frameState;
3334
if (!frameState) {
34-
this.viewState_ = null;
35+
this.viewState_ = null; //NOSONAR
3536
} else {
36-
this.viewState_ = frameState.viewState;
37+
this.viewState_ = frameState.viewState; //NOSONAR
3738
}
38-
this.updateElementRepair();
39+
this.updateElementRepair(); //NOSONAR
3940
}
40-
super(options)
41+
super(options);
4142
}
4243

4344
updateElementRepair() {

0 commit comments

Comments
 (0)