@ohuoy/easymap 1.1.2 → 1.1.4

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
@@ -158,7 +158,6 @@ export class EasyMap {
158
158
  map.addLayer(layer);
159
159
  }
160
160
  })
161
- console.log( map.style.order )
162
161
  map.theme.value = map.style.stylesheet.theme
163
162
 
164
163
  map.off('style.load', handleStyleLoad);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ohuoy/easymap",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "self map easy use",
5
5
  "main": "main.js",
6
6
  "scripts": {
@@ -40,7 +40,7 @@ function update(target, key) {
40
40
  deps.forEach((dep) => dep());
41
41
  }
42
42
 
43
- export function observe(obj){
43
+ export function observe(obj,eventFun){
44
44
  if (typeof obj !== "object") {
45
45
  return obj;
46
46
  }
@@ -58,6 +58,9 @@ export function observe(obj){
58
58
  const res = Reflect.set(target, key, val, receiver);
59
59
  // 侦听到数据变化,执行相应回调
60
60
  update(target, key);
61
+ if(eventFun){
62
+ eventFun(target,key, val, receiver)
63
+ }
61
64
  return res;
62
65
  }
63
66
  })