hn-map 1.1.12 → 1.1.13
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/dist/index.js +6 -5
- package/package.json +1 -1
- package/src/base/siji_entity.ts +6 -5
package/dist/index.js
CHANGED
|
@@ -1756,6 +1756,7 @@
|
|
|
1756
1756
|
this.option = null;
|
|
1757
1757
|
this.type = null;
|
|
1758
1758
|
this.show = false;
|
|
1759
|
+
this.id = null;
|
|
1759
1760
|
this.hnMap = hnMap;
|
|
1760
1761
|
this.event = {};
|
|
1761
1762
|
this.show = false;
|
|
@@ -1850,9 +1851,9 @@
|
|
|
1850
1851
|
}
|
|
1851
1852
|
}, {
|
|
1852
1853
|
key: "on",
|
|
1853
|
-
value: function on(eventType,
|
|
1854
|
+
value: function on(eventType, callback) {
|
|
1854
1855
|
var _this3 = this;
|
|
1855
|
-
this.off(eventType
|
|
1856
|
+
this.off(eventType);
|
|
1856
1857
|
switch (eventType) {
|
|
1857
1858
|
case "click":
|
|
1858
1859
|
this.event[eventType] = function () {
|
|
@@ -1860,13 +1861,13 @@
|
|
|
1860
1861
|
};
|
|
1861
1862
|
break;
|
|
1862
1863
|
}
|
|
1863
|
-
this.hnMap.map.map.on(eventType,
|
|
1864
|
+
this.hnMap.map.map.on(eventType, this.id, this.event[eventType]);
|
|
1864
1865
|
} // 监听事件
|
|
1865
1866
|
}, {
|
|
1866
1867
|
key: "off",
|
|
1867
|
-
value: function off(eventType
|
|
1868
|
+
value: function off(eventType) {
|
|
1868
1869
|
if (this.event[eventType]) {
|
|
1869
|
-
this.hnMap.map.map.off(eventType,
|
|
1870
|
+
this.hnMap.map.map.off(eventType, this.id, this.event[eventType]);
|
|
1870
1871
|
delete this.event[eventType];
|
|
1871
1872
|
}
|
|
1872
1873
|
}
|
package/package.json
CHANGED
package/src/base/siji_entity.ts
CHANGED
|
@@ -8,6 +8,7 @@ export default class siji_entity {
|
|
|
8
8
|
option: any = null;
|
|
9
9
|
type: any = null;
|
|
10
10
|
show: boolean = false;
|
|
11
|
+
id:any = null
|
|
11
12
|
|
|
12
13
|
constructor(hnMap: any) {
|
|
13
14
|
this.hnMap = hnMap;
|
|
@@ -104,8 +105,8 @@ export default class siji_entity {
|
|
|
104
105
|
this.hnMap.map.map.removeSource(this.config.id);
|
|
105
106
|
}
|
|
106
107
|
|
|
107
|
-
on(eventType: any,
|
|
108
|
-
this.off(eventType
|
|
108
|
+
on(eventType: any, callback: any) {
|
|
109
|
+
this.off(eventType);
|
|
109
110
|
switch (eventType) {
|
|
110
111
|
case "click":
|
|
111
112
|
this.event[eventType] = () => {
|
|
@@ -113,12 +114,12 @@ export default class siji_entity {
|
|
|
113
114
|
};
|
|
114
115
|
break;
|
|
115
116
|
}
|
|
116
|
-
this.hnMap.map.map.on(eventType,
|
|
117
|
+
this.hnMap.map.map.on(eventType, this.id, this.event[eventType]);
|
|
117
118
|
} // 监听事件
|
|
118
119
|
|
|
119
|
-
off(eventType: any
|
|
120
|
+
off(eventType: any) {
|
|
120
121
|
if (this.event[eventType]) {
|
|
121
|
-
this.hnMap.map.map.off(eventType,
|
|
122
|
+
this.hnMap.map.map.off(eventType, this.id, this.event[eventType]);
|
|
122
123
|
delete this.event[eventType];
|
|
123
124
|
}
|
|
124
125
|
}
|