@aibee/crc-bmap 0.0.53 → 0.0.54

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/lib/bmap.esm.js CHANGED
@@ -1393,8 +1393,21 @@ var BaseSvg = class extends EventDispatcher3 {
1393
1393
  __publicField(this, "points", []);
1394
1394
  __publicField(this, "svg");
1395
1395
  __publicField(this, "enable", true);
1396
+ __publicField(this, "_onResize", ({ width, height }) => {
1397
+ if (this.svg) {
1398
+ this.svg.setAttribute("width", `${width}`);
1399
+ this.svg.setAttribute("height", `${height}`);
1400
+ }
1401
+ });
1396
1402
  this.svg = createSvg(`${context.container.clientWidth}`, `${context.container.clientHeight}`);
1397
1403
  context.container.appendChild(this.svg);
1404
+ this._registryEvent();
1405
+ }
1406
+ _registryEvent() {
1407
+ this.context.addEventListener("resize", this._onResize);
1408
+ }
1409
+ _unRegistryEvent() {
1410
+ this.context.removeEventListener("resize", this._onResize);
1398
1411
  }
1399
1412
  setEnable(enable) {
1400
1413
  this.enable = enable;
@@ -1419,6 +1432,7 @@ var BaseSvg = class extends EventDispatcher3 {
1419
1432
  return coord;
1420
1433
  }
1421
1434
  dispose() {
1435
+ this._unRegistryEvent();
1422
1436
  this.context.container.removeChild(this.svg);
1423
1437
  this.svg = null;
1424
1438
  }
@@ -2153,6 +2167,7 @@ var Context = class extends EventDispatcher6 {
2153
2167
  camera.updateProjectionMatrix();
2154
2168
  renderer.setSize(w, h);
2155
2169
  this.resizeClientSize(w, h);
2170
+ this.dispatchEvent({ type: "resize", width: w, height: h });
2156
2171
  });
2157
2172
  __publicField(this, "onClick", (e) => {
2158
2173
  const { graphics, position } = this.getGraphicsByDeviceXy(e.offsetX, e.offsetY);