venue-js 1.3.0 → 1.3.1
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 +27 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -322,6 +322,7 @@ import {
|
|
|
322
322
|
} from "@tanstack/query-core";
|
|
323
323
|
|
|
324
324
|
// src/data/populator/index.ts
|
|
325
|
+
import { compact as compact2 } from "lodash-es";
|
|
325
326
|
import { booleanWithin } from "@turf/boolean-within";
|
|
326
327
|
var createPopulator = ({
|
|
327
328
|
internalFindById,
|
|
@@ -405,7 +406,14 @@ var createPopulator = ({
|
|
|
405
406
|
const anchor = await internalFindById(kiosk.properties.anchor_id);
|
|
406
407
|
const units = await internalFilterByType("unit");
|
|
407
408
|
const unit = units.find(
|
|
408
|
-
(unit2) =>
|
|
409
|
+
(unit2) => {
|
|
410
|
+
try {
|
|
411
|
+
return unit2.properties.category === "walkway" && unit2.properties.level_id === kiosk.properties.level_id && booleanWithin(kiosk, unit2);
|
|
412
|
+
} catch (e) {
|
|
413
|
+
console.log(`Cannot find kiosk(${kiosk.id})'s units:`, e.message);
|
|
414
|
+
return false;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
409
417
|
);
|
|
410
418
|
let section = null;
|
|
411
419
|
if (anchor) {
|
|
@@ -468,7 +476,7 @@ var createPopulator = ({
|
|
|
468
476
|
...occupant.properties,
|
|
469
477
|
anchor: anchor ? await populateAnchor(anchor) : null,
|
|
470
478
|
local_categories: await Promise.all(
|
|
471
|
-
localCategories.map(populateTaxonomy)
|
|
479
|
+
compact2(localCategories).map(populateTaxonomy)
|
|
472
480
|
),
|
|
473
481
|
venue,
|
|
474
482
|
promotions,
|
|
@@ -2673,7 +2681,7 @@ var CameraManager = class {
|
|
|
2673
2681
|
};
|
|
2674
2682
|
|
|
2675
2683
|
// src/IndoorMap/renderer/RendererManager.ts
|
|
2676
|
-
import { min, compact as
|
|
2684
|
+
import { min, compact as compact3, isFunction } from "lodash-es";
|
|
2677
2685
|
import { center as turfCenter2 } from "@turf/center";
|
|
2678
2686
|
import * as THREE3 from "three";
|
|
2679
2687
|
|
|
@@ -4421,7 +4429,7 @@ var RendererManager = class extends EventTarget {
|
|
|
4421
4429
|
});
|
|
4422
4430
|
units.filter((u4) => u4.properties.category === "room").forEach((unit) => {
|
|
4423
4431
|
const openingRelationships = relationships.filter((r) => r.properties.origin?.id === unit.id || r.properties.destination?.id === unit.id);
|
|
4424
|
-
const roomOpenings =
|
|
4432
|
+
const roomOpenings = compact3(openingRelationships.map((rel) => {
|
|
4425
4433
|
const openingId = rel?.properties.intermediary[0].id;
|
|
4426
4434
|
return openings.find((o) => o.id === openingId);
|
|
4427
4435
|
}));
|