venue-js 1.2.0-next.15 → 1.2.0-next.16

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.d.mts CHANGED
@@ -1194,8 +1194,6 @@ declare function styledFeatureGenerator(mapTheme: any): {
1194
1194
  createLineStringFromGeometries: (geometries: any) => LineString$1;
1195
1195
  create3DStepPath: (feature: any, threeLayer: any, option?: {}) => NavigationPath;
1196
1196
  createDecoration: (decoration: any, options: any) => LineString$1 | Polygon$1 | MultiPolygon$1 | MultiLineString;
1197
- /** Three JS */
1198
- create3DFootprint: (feature: any, threeLayer: any, options: any) => Promise<any[]>;
1199
1197
  create3DBillboard: (billboard: any, threeLayer: any) => Billboard;
1200
1198
  create3DAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
1201
1199
  create3DOccupantAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
package/dist/index.d.ts CHANGED
@@ -1194,8 +1194,6 @@ declare function styledFeatureGenerator(mapTheme: any): {
1194
1194
  createLineStringFromGeometries: (geometries: any) => LineString$1;
1195
1195
  create3DStepPath: (feature: any, threeLayer: any, option?: {}) => NavigationPath;
1196
1196
  createDecoration: (decoration: any, options: any) => LineString$1 | Polygon$1 | MultiPolygon$1 | MultiLineString;
1197
- /** Three JS */
1198
- create3DFootprint: (feature: any, threeLayer: any, options: any) => Promise<any[]>;
1199
1197
  create3DBillboard: (billboard: any, threeLayer: any) => Billboard;
1200
1198
  create3DAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
1201
1199
  create3DOccupantAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
package/dist/index.js CHANGED
@@ -972,7 +972,6 @@ var import_maptalks4 = require("maptalks");
972
972
  var import_center2 = __toESM(require("@turf/center"));
973
973
  var import_buffer = __toESM(require("@turf/buffer"));
974
974
  var import_three4 = require("three");
975
- var import_GLTFLoader = require("three/examples/jsm/loaders/GLTFLoader.js");
976
975
 
977
976
  // src/IndoorMap/object3d/Billboard.js
978
977
  var maptalks = __toESM(require("maptalks"));
@@ -1558,36 +1557,6 @@ var createPedestrianOpening = (feature2, style, options = {}) => {
1558
1557
  console.log(`error creating pedestrian opening:`, feature2);
1559
1558
  }
1560
1559
  };
1561
- var loadModel3d = (model3d, coordinate, threeLayer) => {
1562
- return new Promise((resolve, reject) => {
1563
- const loader = new import_GLTFLoader.GLTFLoader();
1564
- const { url, properties: modelProperties } = model3d;
1565
- loader.load(
1566
- url,
1567
- (gltf) => {
1568
- const object3d = gltf.scene;
1569
- object3d.rotation.x = import_lodash4.default.get(modelProperties, "rotation.x");
1570
- object3d.rotation.y = import_lodash4.default.get(modelProperties, "rotation.y");
1571
- object3d.scale.set(...import_lodash4.default.get(modelProperties, "scale") || []);
1572
- const object = threeLayer.toModel(object3d, {
1573
- coordinate
1574
- });
1575
- object.getObject3d().traverse((child) => {
1576
- if (child.isMesh === true) {
1577
- child.material.transparent = true;
1578
- child.material.metalness = 0.1;
1579
- }
1580
- });
1581
- resolve(object);
1582
- },
1583
- (xhr) => {
1584
- },
1585
- (error) => {
1586
- reject(error);
1587
- }
1588
- );
1589
- });
1590
- };
1591
1560
  var createExtrudePolygon = (geometry, threeLayer, material, height, properties = {}, options) => {
1592
1561
  const { offset = 0, altitude = 0 } = options;
1593
1562
  const offsetGeometry = (0, import_buffer.default)(geometry, offset, { units: "meters" });
@@ -2261,42 +2230,6 @@ var styledFeatureGenerator = (mapTheme) => {
2261
2230
  return null;
2262
2231
  }
2263
2232
  },
2264
- /** Three JS */
2265
- create3DFootprint: async (feature2, threeLayer, options) => {
2266
- const objects = [];
2267
- const extrudeHeight = import_lodash4.default.get(options, "height");
2268
- if (!extrudeHeight) return objects;
2269
- const { properties } = feature2;
2270
- const footprintProperties = getFeatureProperties(feature2);
2271
- const hasModel3ds = Array.isArray(properties.model3d) && properties.model3d.length > 0;
2272
- if (hasModel3ds) {
2273
- const models = properties.model3d;
2274
- const center2 = (0, import_center2.default)(feature2);
2275
- const coordinate = import_lodash4.default.get(center2, "geometry.coordinates");
2276
- for (const model of models) {
2277
- const object = await loadModel3d(model, coordinate, threeLayer);
2278
- object.properties = footprintProperties;
2279
- objects.push(object);
2280
- }
2281
- } else {
2282
- const color = footprintProperties.defaultColor;
2283
- if (color === "transparent") return;
2284
- const material = new import_three4.MeshLambertMaterial({
2285
- color,
2286
- transparent: true
2287
- });
2288
- const object = createExtrudePolygon(
2289
- feature2.geometry,
2290
- threeLayer,
2291
- material,
2292
- extrudeHeight,
2293
- footprintProperties,
2294
- {}
2295
- );
2296
- objects.push(object);
2297
- }
2298
- return objects;
2299
- },
2300
2233
  create3DBillboard: (billboard, threeLayer) => {
2301
2234
  const { id, feature_type, properties } = billboard;
2302
2235
  const {
@@ -2797,9 +2730,7 @@ var CameraManager = class {
2797
2730
  };
2798
2731
 
2799
2732
  // src/IndoorMap/renderer/RendererManager.ts
2800
- var import_compact2 = __toESM(require("lodash/compact"));
2801
- var import_isFunction = __toESM(require("lodash/isFunction"));
2802
- var import_min = __toESM(require("lodash/min"));
2733
+ var import_lodash_es2 = require("lodash-es");
2803
2734
  var import_center3 = require("@turf/center");
2804
2735
  var THREE3 = __toESM(require("three"));
2805
2736
 
@@ -4490,7 +4421,7 @@ var RendererManager = class extends EventTarget {
4490
4421
  if (this.#isClicked) return;
4491
4422
  this.#isClicked = true;
4492
4423
  const onClickElement = this.#onClickElement;
4493
- if (!(0, import_isFunction.default)(onClickElement)) return;
4424
+ if (!(0, import_lodash_es2.isFunction)(onClickElement)) return;
4494
4425
  this.#onClickElement(e);
4495
4426
  this.#isClicked = false;
4496
4427
  };
@@ -4543,7 +4474,7 @@ var RendererManager = class extends EventTarget {
4543
4474
  });
4544
4475
  units.filter((u4) => u4.properties.category === "room").forEach((unit) => {
4545
4476
  const openingRelationships = relationships.filter((r) => r.properties.origin?.id === unit.id || r.properties.destination?.id === unit.id);
4546
- const roomOpenings = (0, import_compact2.default)(openingRelationships.map((rel) => {
4477
+ const roomOpenings = (0, import_lodash_es2.compact)(openingRelationships.map((rel) => {
4547
4478
  const openingId = rel?.properties.intermediary[0].id;
4548
4479
  return openings.find((o) => o.id === openingId);
4549
4480
  }));
@@ -4629,7 +4560,7 @@ var RendererManager = class extends EventTarget {
4629
4560
  this.markerRenderer.showMarkers(markers, ordinal - baseOrdinal);
4630
4561
  }
4631
4562
  } else {
4632
- const baseOrdinal = Array.isArray(targetOrdinal) ? (0, import_min.default)(targetOrdinal) : targetOrdinal;
4563
+ const baseOrdinal = Array.isArray(targetOrdinal) ? (0, import_lodash_es2.min)(targetOrdinal) : targetOrdinal;
4633
4564
  for (const [ordinal, elements] of this.elementsByOrdinal) {
4634
4565
  const inOrdinal = Array.isArray(targetOrdinal) ? targetOrdinal.includes(ordinal) : ordinal === targetOrdinal;
4635
4566
  if (inOrdinal) {
@@ -4656,7 +4587,7 @@ var RendererManager = class extends EventTarget {
4656
4587
  const elements = elemIds.map((id) => this.elementsMap.get(id)).flat();
4657
4588
  elements.forEach((element) => {
4658
4589
  const controller = this.elementRenderer.createHighlightController(element);
4659
- if (controller && (0, import_isFunction.default)(controller.start)) {
4590
+ if (controller && (0, import_lodash_es2.isFunction)(controller.start)) {
4660
4591
  controller.start();
4661
4592
  this.highlightControllers.push(controller);
4662
4593
  }
@@ -4664,7 +4595,7 @@ var RendererManager = class extends EventTarget {
4664
4595
  };
4665
4596
  clearHighlightElements = () => {
4666
4597
  this.highlightControllers.forEach((controller) => {
4667
- if ((0, import_isFunction.default)(controller?.clear)) controller.clear();
4598
+ if ((0, import_lodash_es2.isFunction)(controller?.clear)) controller.clear();
4668
4599
  });
4669
4600
  };
4670
4601
  /**
@@ -4940,18 +4871,12 @@ var IndoorMap = class extends EventTarget {
4940
4871
  async #legacy_createElements() {
4941
4872
  const {
4942
4873
  // 2D
4943
- createVenue,
4944
4874
  createOpening,
4945
4875
  createSection,
4946
- createFixture,
4947
- createOccupant,
4948
4876
  createDecoration,
4949
4877
  // 3D
4950
- create3DFootprint,
4951
4878
  create3DBillboard,
4952
- createExtrudedUnit,
4953
4879
  create3DAmenityMarker,
4954
- create3DOccupantAmenityMarker,
4955
4880
  create3DOpeningMarker
4956
4881
  } = this.#styler;
4957
4882
  let elements = {};