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.js CHANGED
@@ -3072,7 +3072,9 @@ var CameraManager = class {
3072
3072
  return this.map.getView();
3073
3073
  };
3074
3074
  setView = (value) => {
3075
- this.map.setView(value);
3075
+ if (this.map) {
3076
+ this.map.setView(value);
3077
+ }
3076
3078
  };
3077
3079
  animateTo = (view, options = {}, step) => {
3078
3080
  this.map.animateTo(view, options, step);
@@ -3421,7 +3423,7 @@ var Element3DRenderer = class extends EventTarget {
3421
3423
  const color = feature3.properties.style.polygonFill ?? colorOptions ?? "#ffffff";
3422
3424
  if (color === "transparent") return;
3423
3425
  const material = this.getOrCreateMaterialByColor(color);
3424
- const altitude = feature3.properties.ordinal * HEIGHT_METER;
3426
+ const altitude = 0;
3425
3427
  const height = feature3.properties.height ?? heightOptions ?? HEIGHT_METER;
3426
3428
  const bottomHeight = feature3.properties.bottomHeight ?? bottomHeightOptions ?? 0;
3427
3429
  const extrudedPolygon = this.threeLayer.toExtrudePolygon(
@@ -3429,9 +3431,6 @@ var Element3DRenderer = class extends EventTarget {
3429
3431
  { asynchronous: true, ...options, height, bottomHeight, altitude },
3430
3432
  material
3431
3433
  );
3432
- extrudedPolygon.on("click", (e) => {
3433
- console.log(e.target.options.polygon.id);
3434
- });
3435
3434
  const topLineStrings = [
3436
3435
  new maptalks4.LineString(outerRing),
3437
3436
  ...innerRings.map((innerRing) => new maptalks4.LineString(innerRing))
@@ -3452,13 +3451,14 @@ var Element3DRenderer = class extends EventTarget {
3452
3451
  );
3453
3452
  return [extrudedPolygon, topLines, bottomLines];
3454
3453
  } catch (err) {
3455
- throw new Error(`Cannot create polygon, ${err.message}`);
3454
+ return [];
3456
3455
  }
3457
3456
  };
3458
3457
  try {
3459
3458
  switch (feature2.geometry.type) {
3460
3459
  case "MultiPolygon": {
3461
3460
  const { coordinates } = feature2.geometry;
3461
+ if (!coordinates) return [];
3462
3462
  const multiMeshes = coordinates.flatMap((polygonCoordinates) => {
3463
3463
  const meshes = createPolygon({ type: "Polygon", coordinates: polygonCoordinates }, feature2);
3464
3464
  this.threeLayer.addMesh(meshes);
@@ -3467,6 +3467,8 @@ var Element3DRenderer = class extends EventTarget {
3467
3467
  return multiMeshes;
3468
3468
  }
3469
3469
  case "Polygon": {
3470
+ const { coordinates } = feature2.geometry;
3471
+ if (!coordinates) return [];
3470
3472
  const meshes = createPolygon(feature2.geometry, feature2);
3471
3473
  this.threeLayer.addMesh(meshes);
3472
3474
  return meshes;
@@ -4014,7 +4016,7 @@ var RendererManager = class extends EventTarget {
4014
4016
  this.addElementsToManager(escalator.id, _elements, escalator.properties.ordinal);
4015
4017
  }
4016
4018
  } catch (err) {
4017
- console.log(`cannot create escalator`, err.message);
4019
+ console.warn(`cannot create escalator`, err.message);
4018
4020
  }
4019
4021
  }
4020
4022
  this.changeLevelByOrdinal(this.currentOrdinals);
@@ -4174,7 +4176,7 @@ var IndoorMap = class extends EventTarget {
4174
4176
  }
4175
4177
  set dataClient(value) {
4176
4178
  this.#dataClient = value;
4177
- if (!this.options.camera.defaultView.center) {
4179
+ if (!this.options.camera?.defaultView?.center) {
4178
4180
  this.#dataClient.filterByType("venue").then((venues) => {
4179
4181
  const venueCenters = (0, import_center4.default)(featureCollection(venues));
4180
4182
  const [x, y] = venueCenters.geometry.coordinates;