|
@@ -10,12 +10,13 @@ class AddScaleEvent {
|
|
|
|
|
|
addScaleEvent(){
|
|
|
let currentScale = this.view.scale; //缓存比例尺信息
|
|
|
+ let throttleService = throttle((newValue) =>{
|
|
|
+ this.callBackFunction(newValue)
|
|
|
+ },500);
|
|
|
this.scaleHandle = this.view.watch("scale",(newValue) =>{
|
|
|
if(newValue !== currentScale){
|
|
|
currentScale = newValue;
|
|
|
- throttle(() =>{
|
|
|
- this.callBackFunction(newValue)
|
|
|
- },500)
|
|
|
+ throttleService(newValue);
|
|
|
}
|
|
|
})
|
|
|
}
|