@aibee/crc-bmap 0.0.118 → 0.0.119

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
@@ -3807,7 +3807,7 @@ var Lane = class extends Object3D12 {
3807
3807
  geometry.setPositions(vec);
3808
3808
  const line = new Line2(geometry, material);
3809
3809
  line.computeLineDistances();
3810
- line.position.z += 1e-4;
3810
+ line.position.z += 1e-3;
3811
3811
  this.add(line);
3812
3812
  });
3813
3813
  });
@@ -4951,7 +4951,7 @@ var Context = class extends EventDispatcher6 {
4951
4951
  this.tweenGroup.getAll().forEach((item) => item.stop());
4952
4952
  this.tweenGroup.removeAll();
4953
4953
  this.unRegistryEvent();
4954
- this.container.removeChild(this.renderer.domElement);
4954
+ this.renderer.domElement.remove();
4955
4955
  this.timer.dispose();
4956
4956
  this.renderer.dispose();
4957
4957
  this.lights.children.forEach(
@@ -7172,8 +7172,18 @@ var AibeeLoader = class {
7172
7172
  return null;
7173
7173
  }
7174
7174
  const cacheKey = this.getFloorCacheKey(floorInfo);
7175
- const cacheVersion = await this.getCacheData(VersionStoreName, cacheKey);
7176
- return this.getFloorDataByFloorInfo(floorInfo);
7175
+ try {
7176
+ const cacheVersion = await this.getCacheData(VersionStoreName, cacheKey);
7177
+ if (cacheVersion === floorInfo.version_id) {
7178
+ const res = await this.getCacheData(MapDataStoreName, cacheKey);
7179
+ if (res) {
7180
+ return this.getDataByJson(res);
7181
+ }
7182
+ }
7183
+ return this.getFloorDataByFloorInfo(floorInfo);
7184
+ } catch {
7185
+ return this.getFloorDataByFloorInfo(floorInfo);
7186
+ }
7177
7187
  }
7178
7188
  async getFloorDataByFloorInfo(floorInfo) {
7179
7189
  const cacheKey = this.getFloorCacheKey(floorInfo);
@@ -7186,9 +7196,26 @@ var AibeeLoader = class {
7186
7196
  }
7187
7197
  // 获取路网数据
7188
7198
  async getRoadNetworkData() {
7189
- return Promise.all(this.floors.map(async (item) => {
7190
- return fetch(item.route_url).then((res) => res.json());
7199
+ const res = await Promise.all(this.floors.map(async (item) => {
7200
+ const cacheKey = this.getFloorCacheKey(item);
7201
+ try {
7202
+ const cacheVersion = await this.getCacheData(VersionStoreName, cacheKey);
7203
+ if (cacheVersion === item.version_id) {
7204
+ const res2 = await this.getCacheData(RoadNetworkDataStoreName, cacheKey);
7205
+ if (res2) {
7206
+ return res2;
7207
+ }
7208
+ }
7209
+ const route = await fetch(item.route_url).then((res2) => res2.json());
7210
+ await this.setCacheData(RoadNetworkDataStoreName, cacheKey, route);
7211
+ return route;
7212
+ } catch {
7213
+ const route = await fetch(item.route_url).then((res2) => res2.json());
7214
+ await this.setCacheData(RoadNetworkDataStoreName, cacheKey, route);
7215
+ return route;
7216
+ }
7191
7217
  }));
7218
+ return res.filter((item) => item.points);
7192
7219
  }
7193
7220
  // 空闲时间请求其他数据
7194
7221
  async getOtherDataByFreeTime() {