vis-core 0.30.0-beta.20 → 0.30.0-beta.22

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.
@@ -63,7 +63,7 @@ import { continentsCountriesIso2 } from "geojson-cn";
63
63
  Array.prototype.at || (Array.prototype.at = function(v) {
64
64
  return v < 0 && (v = this.length + v), this[v];
65
65
  });
66
- const version = "0.30.0-beta.20", publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t", accessToken = {
66
+ const version = "0.30.0-beta.22", publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t", accessToken = {
67
67
  token: void 0,
68
68
  getInfo() {
69
69
  if (!this.token)
@@ -140348,22 +140348,28 @@ class Editor {
140348
140348
  return this._mListOptionsMaps[o].get(r);
140349
140349
  }
140350
140350
  changeMListOptions() {
140351
- if (!this.pencil)
140352
- return [];
140351
+ var r, o, V;
140352
+ if (!((r = this.pencil) != null && r.mList))
140353
+ return console.log({
140354
+ _dispose: this._dispose,
140355
+ //@ts-ignore
140356
+ minDisabledLayer: (o = this.pencil) == null ? void 0 : o.pages.getMinDisabledLayer(),
140357
+ vis: (V = this.viewport) == null ? void 0 : V.vis
140358
+ }), [];
140353
140359
  this._mListOptionsMaps.key.clear(), this._mListOptionsMaps.material = /* @__PURE__ */ new WeakMap(), this._mListOptionsMaps.object = /* @__PURE__ */ new WeakMap();
140354
140360
  const e = Array.from(this.pencil.mList.fixBaseObjects.entries());
140355
140361
  this.mListOptions = new Array(e.length);
140356
- for (let r = 0; r < e.length; r++) {
140357
- const [o, V] = e[r], O = this.pencil.mList.get(o), j = V.object3d, le = {
140358
- key: o,
140359
- name: O.name,
140360
- type: O.type,
140361
- object: j,
140362
- baseObject: V,
140363
- material: O,
140364
- use: this.pencil.mList.getBaseObjectMap(O).size
140362
+ for (let O = 0; O < e.length; O++) {
140363
+ const [j, le] = e[O], fe = this.pencil.mList.get(j), Se = le.object3d, Ce = {
140364
+ key: j,
140365
+ name: fe.name,
140366
+ type: fe.type,
140367
+ object: Se,
140368
+ baseObject: le,
140369
+ material: fe,
140370
+ use: this.pencil.mList.getBaseObjectMap(fe).size
140365
140371
  };
140366
- this.mListOptions[r] = le, this._mListOptionsMaps.key.set(o, le), this._mListOptionsMaps.material.set(O, le), this._mListOptionsMaps.object.set(j, le);
140372
+ this.mListOptions[O] = Ce, this._mListOptionsMaps.key.set(j, Ce), this._mListOptionsMaps.material.set(fe, Ce), this._mListOptionsMaps.object.set(Se, Ce);
140367
140373
  }
140368
140374
  this.emit("mListGraphChanged");
140369
140375
  }
@@ -140401,7 +140407,10 @@ class Editor {
140401
140407
  const fe = parseTexture(le.v.bg.texture);
140402
140408
  fe.colorSpace = SRGBColorSpace, this.viewport.vis.pencil.scene.background = fe;
140403
140409
  }
140404
- return this.hooks.dispatch("beforeShow"), (O = this.viewport.vis) == null || O.show(), this.hooks.dispatch("afterShow"), (j = this.pencil.controls) == null || j.saveState(), this.select(null), this.hooks.dispatch("afterFromJSON"), le;
140410
+ return this.hooks.dispatch("beforeShow"), (O = this.viewport.vis) == null || O.show(), this.hooks.dispatch("afterShow"), (j = this.pencil.controls) == null || j.saveState(), this.select(null), window.requestIdleCallback(() => {
140411
+ var fe;
140412
+ (fe = this.viewport.vis) == null || fe.worker.dispose();
140413
+ }), this.hooks.dispatch("afterFromJSON"), le;
140405
140414
  } catch (le) {
140406
140415
  throw this.hooks.dispatch("errorFromJSON"), new Error("fromJSON error:" + le);
140407
140416
  }
@@ -144120,7 +144129,7 @@ const getLabelElement = (v) => {
144120
144129
  v0(this, "pcenter", [104, 37.5]);
144121
144130
  v0(this, "pscale", 5e4 / 1e3);
144122
144131
  v0(this, "meters");
144123
- v0(this, "cityVis", null);
144132
+ v0(this, "cityVis", []);
144124
144133
  v0(this, "extendsOptions", {
144125
144134
  mapDepth: () => this.getOptionsDepth(this.options.adcode),
144126
144135
  equirectangular: () => this.options.projectionType === "equirectangular",
@@ -144283,7 +144292,7 @@ const getLabelElement = (v) => {
144283
144292
  setWaterMaterial: this.options.setWaterMaterial,
144284
144293
  ssao: this.options.citySSAO,
144285
144294
  pencil2: this.pencil
144286
- }), yield j.init(), this.cityVis = j, this.settings.mouseLeft = Xi.SCREEN_PAN, yield this.settings.mouseLeft, this.emit("initCityVis", r), j;
144295
+ }), yield j.init(), this.cityVis.push(j), this.settings.mouseLeft = Xi.SCREEN_PAN, yield this.settings.mouseLeft, this.emit("initCityVis", r), j;
144287
144296
  });
144288
144297
  }
144289
144298
  initCityOnMap(r) {
@@ -145142,10 +145151,12 @@ const getLabelElement = (v) => {
145142
145151
  return findAdcodeInfo(r);
145143
145152
  }
145144
145153
  dispose() {
145145
- var r, o, V;
145146
- (r = this.cityVis) == null || r.dispose(), (o = this.map) == null || o.dispose(), this.parentBg.forEach((O) => {
145147
- O.dispose();
145148
- }), this.parentBg.length = 0, (V = this.continentsBg) == null || V.dispose(), this.continentsBg = void 0, this.mapHistory.length = 0, super.dispose();
145154
+ var r, o;
145155
+ this.cityVis.forEach((V) => {
145156
+ V.dispose();
145157
+ }), this.cityVis.length = 0, (r = this.map) == null || r.dispose(), this.parentBg.forEach((V) => {
145158
+ V.dispose();
145159
+ }), this.parentBg.length = 0, (o = this.continentsBg) == null || o.dispose(), this.continentsBg = void 0, this.mapHistory.length = 0, super.dispose();
145149
145160
  }
145150
145161
  };
145151
145162
  v0(Mn, "VisName", "map"), v0(Mn, "getAdcodeShowLevel", getAdcodeShowLevel);
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.30.0-beta.20";
1
+ declare const _default: "0.30.0-beta.22";
2
2
  export default _default;
@@ -165,7 +165,7 @@ export default class extends Base {
165
165
  pcenter: [number, number];
166
166
  pscale: number;
167
167
  meters: number;
168
- cityVis: City | null;
168
+ cityVis: City[];
169
169
  extendsOptions: Record<string, any>;
170
170
  setOptions(options: MapOptions): void;
171
171
  initSettingsObj: Record<string, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.30.0-beta.20",
3
+ "version": "0.30.0-beta.22",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version && PUBLIC_EXCLUDE=true bundler",