@ohuoy/easymap 1.1.14 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -2
- package/package.json +1 -1
- package/src/components/control/TilesBar.js +1 -0
package/index.js
CHANGED
|
@@ -169,7 +169,7 @@ export class EasyMap {
|
|
|
169
169
|
// };
|
|
170
170
|
|
|
171
171
|
// this.map.on('style.load', handleStyleLoad);
|
|
172
|
-
|
|
172
|
+
const styleLoadFun = ()=>{
|
|
173
173
|
if(this.mapStyleTimer){
|
|
174
174
|
clearTimeout(this.mapStyleTimer)
|
|
175
175
|
}
|
|
@@ -194,8 +194,10 @@ export class EasyMap {
|
|
|
194
194
|
map.theme.value = map.style.stylesheet.theme
|
|
195
195
|
}
|
|
196
196
|
this.mapStyleTimer = null
|
|
197
|
+
this.map.off('styledata', styleLoadFun);
|
|
197
198
|
}, 1000);
|
|
198
|
-
}
|
|
199
|
+
}
|
|
200
|
+
this.map.on('styledata', styleLoadFun);
|
|
199
201
|
this.map.setStyle(style);
|
|
200
202
|
}
|
|
201
203
|
|
package/package.json
CHANGED
|
@@ -124,6 +124,7 @@ export default class TilesBar {
|
|
|
124
124
|
}else{
|
|
125
125
|
this.currentKey = key
|
|
126
126
|
}
|
|
127
|
+
if (this._map.getLayer('mask')) this._map.removeLayer('mask');
|
|
127
128
|
if(key == 'standard'){
|
|
128
129
|
if (this._map.getLayer('yingxiang')) this._map.removeLayer('yingxiang');
|
|
129
130
|
if (this._map.getLayer('tiandi')) this._map.removeLayer('tiandi');
|