@antv/l7-scene 2.9.31 → 2.9.32-alpha.1

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/es/index.d.ts CHANGED
@@ -78,6 +78,7 @@ declare class Scene implements IPostProcessingPassPluggable, IMapController, ILa
78
78
  addPopup(popup: IPopup): void;
79
79
  on(type: string, handle: (...args: any[]) => void): void;
80
80
  once(type: string, handle: (...args: any[]) => void): void;
81
+ emit(type: string, handle: (...args: any[]) => void): void;
81
82
  off(type: string, handle: (...args: any[]) => void): void;
82
83
  getZoom(): number;
83
84
  getCenter(options?: ICameraOptions): ILngLat;
package/es/index.js CHANGED
@@ -256,7 +256,12 @@ var Scene = /*#__PURE__*/function () {
256
256
  }, {
257
257
  key: "addFontFace",
258
258
  value: function addFontFace(fontFamily, fontPath) {
259
- this.sceneService.addFontFace(fontFamily, fontPath);
259
+ var _this3 = this;
260
+
261
+ this.fontService.once('fontloaded', function (e) {
262
+ _this3.emit('fontloaded', e);
263
+ });
264
+ this.fontService.addFontFace(fontFamily, fontPath);
260
265
  }
261
266
  }, {
262
267
  key: "addImage",
@@ -265,8 +270,7 @@ var Scene = /*#__PURE__*/function () {
265
270
  this.iconService.addImage(id, img);
266
271
  } else {
267
272
  this.iconService.addImageMini(id, img, this.sceneService);
268
- } // this.iconService.addImage(id, img);
269
-
273
+ }
270
274
  }
271
275
  }, {
272
276
  key: "hasImage",
@@ -335,6 +339,11 @@ var Scene = /*#__PURE__*/function () {
335
339
  value: function once(type, handle) {
336
340
  SceneEventList.indexOf(type) === -1 ? this.mapService.once(type, handle) : this.sceneService.once(type, handle);
337
341
  }
342
+ }, {
343
+ key: "emit",
344
+ value: function emit(type, handle) {
345
+ SceneEventList.indexOf(type) === -1 ? this.mapService.on(type, handle) : this.sceneService.emit(type, handle);
346
+ }
338
347
  }, {
339
348
  key: "off",
340
349
  value: function off(type, handle) {
package/lib/index.js CHANGED
@@ -168,7 +168,10 @@ var Scene = class {
168
168
  });
169
169
  }
170
170
  addFontFace(fontFamily, fontPath) {
171
- this.sceneService.addFontFace(fontFamily, fontPath);
171
+ this.fontService.once("fontloaded", (e) => {
172
+ this.emit("fontloaded", e);
173
+ });
174
+ this.fontService.addFontFace(fontFamily, fontPath);
172
175
  }
173
176
  addImage(id, img) {
174
177
  if (!import_l7_utils.isMini) {
@@ -216,6 +219,9 @@ var Scene = class {
216
219
  once(type, handle) {
217
220
  import_l7_core.SceneEventList.indexOf(type) === -1 ? this.mapService.once(type, handle) : this.sceneService.once(type, handle);
218
221
  }
222
+ emit(type, handle) {
223
+ import_l7_core.SceneEventList.indexOf(type) === -1 ? this.mapService.on(type, handle) : this.sceneService.emit(type, handle);
224
+ }
219
225
  off(type, handle) {
220
226
  import_l7_core.SceneEventList.indexOf(type) === -1 ? this.mapService.off(type, handle) : this.sceneService.off(type, handle);
221
227
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-scene",
3
- "version": "2.9.31",
3
+ "version": "2.9.32-alpha.1",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -23,21 +23,21 @@
23
23
  "author": "xiaoiver",
24
24
  "license": "ISC",
25
25
  "dependencies": {
26
- "@antv/l7-component": "2.9.31",
27
- "@antv/l7-core": "2.9.31",
28
- "@antv/l7-layers": "2.9.31",
29
- "@antv/l7-maps": "2.9.31",
30
- "@antv/l7-renderer": "2.9.31",
31
- "@antv/l7-utils": "2.9.31",
26
+ "@antv/l7-component": "2.9.32-alpha.1",
27
+ "@antv/l7-core": "2.9.32-alpha.1",
28
+ "@antv/l7-layers": "2.9.32-alpha.1",
29
+ "@antv/l7-maps": "2.9.32-alpha.1",
30
+ "@antv/l7-renderer": "2.9.32-alpha.1",
31
+ "@antv/l7-utils": "2.9.32-alpha.1",
32
32
  "@babel/runtime": "^7.7.7",
33
33
  "inversify": "^5.0.1",
34
34
  "mapbox-gl": "^1.2.1",
35
35
  "reflect-metadata": "^0.1.13"
36
36
  },
37
37
  "devDependencies": {
38
- "@antv/l7-test-utils": "2.9.31"
38
+ "@antv/l7-test-utils": "2.9.32-alpha.1"
39
39
  },
40
- "gitHead": "774753ffb2c03d3a52bcde4924bf198e803d82ae",
40
+ "gitHead": "3605ad7724ff58f38c6e22e195d103edfbcb5bc0",
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  }