@ohuoy/easymap 1.1.13 → 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 CHANGED
@@ -169,7 +169,7 @@ export class EasyMap {
169
169
  // };
170
170
 
171
171
  // this.map.on('style.load', handleStyleLoad);
172
- this.map.on('styledata', ()=>{
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ohuoy/easymap",
3
- "version": "1.1.13",
3
+ "version": "1.1.15",
4
4
  "description": "self map easy use",
5
5
  "main": "main.js",
6
6
  "scripts": {
@@ -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');
@@ -133,13 +133,12 @@ export default class ThreeScanLayer{
133
133
  if(!this.map.theme){
134
134
  this.map.theme = this.map.theme ? this.map.theme :this.map.style.stylesheet.theme
135
135
  }
136
- // console.log('theme:'+this.map.theme.value)
137
136
  let color = this.map.theme.value == "dark"?"#fff" : "#000"
138
- if(elList.length == 0){
139
- await sleep(200)
140
- }
137
+ await sleep(200)
141
138
  for(let el of elList){
142
- el.style.color = color
139
+ if(el.style.color != color){
140
+ el.style.color = color
141
+ }
143
142
  }
144
143
  }
145
144