venue-js 1.2.0-next.3 → 1.2.0-next.5

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.mjs CHANGED
@@ -3027,7 +3027,9 @@ var CameraManager = class {
3027
3027
  return this.map.getView();
3028
3028
  };
3029
3029
  setView = (value) => {
3030
- this.map.setView(value);
3030
+ if (this.map) {
3031
+ this.map.setView(value);
3032
+ }
3031
3033
  };
3032
3034
  animateTo = (view, options = {}, step) => {
3033
3035
  this.map.animateTo(view, options, step);
@@ -3376,7 +3378,7 @@ var Element3DRenderer = class extends EventTarget {
3376
3378
  const color = feature3.properties.style.polygonFill ?? colorOptions ?? "#ffffff";
3377
3379
  if (color === "transparent") return;
3378
3380
  const material = this.getOrCreateMaterialByColor(color);
3379
- const altitude = feature3.properties.ordinal * HEIGHT_METER;
3381
+ const altitude = 0;
3380
3382
  const height = feature3.properties.height ?? heightOptions ?? HEIGHT_METER;
3381
3383
  const bottomHeight = feature3.properties.bottomHeight ?? bottomHeightOptions ?? 0;
3382
3384
  const extrudedPolygon = this.threeLayer.toExtrudePolygon(
@@ -3384,9 +3386,6 @@ var Element3DRenderer = class extends EventTarget {
3384
3386
  { asynchronous: true, ...options, height, bottomHeight, altitude },
3385
3387
  material
3386
3388
  );
3387
- extrudedPolygon.on("click", (e) => {
3388
- console.log(e.target.options.polygon.id);
3389
- });
3390
3389
  const topLineStrings = [
3391
3390
  new maptalks4.LineString(outerRing),
3392
3391
  ...innerRings.map((innerRing) => new maptalks4.LineString(innerRing))
@@ -3407,13 +3406,14 @@ var Element3DRenderer = class extends EventTarget {
3407
3406
  );
3408
3407
  return [extrudedPolygon, topLines, bottomLines];
3409
3408
  } catch (err) {
3410
- throw new Error(`Cannot create polygon, ${err.message}`);
3409
+ return [];
3411
3410
  }
3412
3411
  };
3413
3412
  try {
3414
3413
  switch (feature2.geometry.type) {
3415
3414
  case "MultiPolygon": {
3416
3415
  const { coordinates } = feature2.geometry;
3416
+ if (!coordinates) return [];
3417
3417
  const multiMeshes = coordinates.flatMap((polygonCoordinates) => {
3418
3418
  const meshes = createPolygon({ type: "Polygon", coordinates: polygonCoordinates }, feature2);
3419
3419
  this.threeLayer.addMesh(meshes);
@@ -3422,6 +3422,8 @@ var Element3DRenderer = class extends EventTarget {
3422
3422
  return multiMeshes;
3423
3423
  }
3424
3424
  case "Polygon": {
3425
+ const { coordinates } = feature2.geometry;
3426
+ if (!coordinates) return [];
3425
3427
  const meshes = createPolygon(feature2.geometry, feature2);
3426
3428
  this.threeLayer.addMesh(meshes);
3427
3429
  return meshes;
@@ -3969,7 +3971,7 @@ var RendererManager = class extends EventTarget {
3969
3971
  this.addElementsToManager(escalator.id, _elements, escalator.properties.ordinal);
3970
3972
  }
3971
3973
  } catch (err) {
3972
- console.log(`cannot create escalator`, err.message);
3974
+ console.warn(`cannot create escalator`, err.message);
3973
3975
  }
3974
3976
  }
3975
3977
  this.changeLevelByOrdinal(this.currentOrdinals);
@@ -4129,7 +4131,7 @@ var IndoorMap = class extends EventTarget {
4129
4131
  }
4130
4132
  set dataClient(value) {
4131
4133
  this.#dataClient = value;
4132
- if (!this.options.camera.defaultView.center) {
4134
+ if (!this.options.camera?.defaultView?.center) {
4133
4135
  this.#dataClient.filterByType("venue").then((venues) => {
4134
4136
  const venueCenters = turfCenter3(featureCollection(venues));
4135
4137
  const [x, y] = venueCenters.geometry.coordinates;