venue-js 1.2.0-next.14 → 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
@@ -394,6 +394,29 @@ type Page = {
394
394
  id: Id;
395
395
  attributes: Record<string, unknown>;
396
396
  };
397
+ type Model3dGeometry = null;
398
+ type Model3dProperties = {
399
+ name: {
400
+ en: string;
401
+ };
402
+ model: string;
403
+ level_id: null;
404
+ project_id: string;
405
+ rotation_x: number;
406
+ rotation_y: number;
407
+ rotation_z: number;
408
+ center: number[];
409
+ scale: number;
410
+ altitude: 0;
411
+ translation_x: number;
412
+ translation_y: number;
413
+ translation_z: number;
414
+ createdAt: string;
415
+ updatedAt: string;
416
+ publishedAt: string;
417
+ locale: string;
418
+ };
419
+ type Model3dFeature = ImdfFeature<Model3dGeometry, Model3dProperties>;
397
420
  type FeatureResponseMap = {
398
421
  address: ImdfFeature;
399
422
  amenity: AmenityFeature;
@@ -417,6 +440,7 @@ type FeatureResponseMap = {
417
440
  promotion: PromotionFeature;
418
441
  label: LabelFeature;
419
442
  element: ElementFeature;
443
+ model3d: Model3dFeature;
420
444
  "sponsored-content": SponsoredContentFeature;
421
445
  page: Page;
422
446
  };
@@ -642,6 +666,7 @@ type FeaturePopulatedResponseMap = {
642
666
  promotion: PromotionFeature;
643
667
  label: LabelFeature;
644
668
  element: ImdfFeature;
669
+ model3d: Model3dFeature;
645
670
  "sponsored-content": SponsoredContentFeature;
646
671
  page: Page;
647
672
  };
@@ -1169,8 +1194,6 @@ declare function styledFeatureGenerator(mapTheme: any): {
1169
1194
  createLineStringFromGeometries: (geometries: any) => LineString$1;
1170
1195
  create3DStepPath: (feature: any, threeLayer: any, option?: {}) => NavigationPath;
1171
1196
  createDecoration: (decoration: any, options: any) => LineString$1 | Polygon$1 | MultiPolygon$1 | MultiLineString;
1172
- /** Three JS */
1173
- create3DFootprint: (feature: any, threeLayer: any, options: any) => Promise<any[]>;
1174
1197
  create3DBillboard: (billboard: any, threeLayer: any) => Billboard;
1175
1198
  create3DAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
1176
1199
  create3DOccupantAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
@@ -1263,4 +1286,4 @@ declare const VENUE_EVENTS: {
1263
1286
  VENUE_MOVEINTOVIEW: string;
1264
1287
  };
1265
1288
 
1266
- export { ALL_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, BASE_LAYER_NAME, DEFAULT_BASE_URL, DEFAULT_LOCALE, DESTINATION_MARKER_ID, type DetailFeature, type DetailGeometry, type DetailProperties, type ElementFeature, type ElementGeometry, type ElementProperties, type EventFeature, type EventGeometry, type EventProperties, type FeaturePopulatedResponseMap, type FeatureQueryOptions, type FeatureResponseMap, type FeatureType, type FilterParams, type FindParams, type FixtureFeature, type FixtureFeaturePopulated, type FixtureGeometry, type FixtureProperties, GEOJSON_FEATURE_TYPES, HIGHLIGHT_LAYER_NAME, type IAllVenuesViewConfig, type IExtrudeConfig, type IGraphFeatureOptions, type IGraphOptions, type IHighlightOptions, IMDF_FEATURE_TYPES, type IMapAnimation, type IMapConfig, type IMapExtrudeConfig, type ISetHighlight2DElementIdsOptions, type IUnitDistanceModifier, type IVerticalGraphOptions, type Id, type ImdfFeature, IndoorMap, type IndoorMapOptions, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, LAST_USER_LOCATION_ELEMENT_ID_PREFIX, LAYERS, LAYER_FEATURE_TYPE_OBJ, LAYER_OPTIONS, LOCALE_SYMBOL_KEY, type LabelFeature, type LabelGeometry, type LabelProperties, type LevelFeature, type LevelFeaturePopulated, type LevelGeometry, type LevelProperties, MARKER_LAYER_NAME, type Media, type MediaFile, type Model3d, NONIMDF_FEATURE_TYPES, ORIGIN_MARKER_ID, type OccupantFeature, type OccupantFeaturePopulated, type OccupantGeometry, occupantHelper as OccupantHelpers, type OccupantProperties, type OpeningFeature, type OpeningFeaturePopulated, type OpeningGeometry, type OpeningProperties, POI_MARKER_LAYER_NAME, type Page, type PolygonalFeature, type PopulatableFeatureType, type PopulatedParams, type PrivilegeFeature, type PrivilegeGeometry, type PrivilegeProperties, type PromotionFeature, type PromotionProperties, PulsingMarker, type RelationshipFeature, type RelationshipGeometry, type RelationshipProperties, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentStrapiV4ApiResponse, type SymbolSet, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, type TextMarkerOptions, TextSpriteMarker, USER_LOCATION_ELEMENT_ID, USER_LOCATION_LAYER_NAME, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitProperties, VENUE_EVENTS, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, createPolygonFromLineString, createSpriteMaterialByLabelSymbol, createStyledUIMarkerElement, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getBearingBetweenPoints, getCenterFromGeometry, getDataClient, getExtrudeConfigByFeature, getFeatureByLocationId, getLocationByAmenity, getLocationByFeature, getLocationByOccupant, getLocationIdByFeature, getOrdinalByLocationId, getRelatedLocationIdsByFeature, getRelatedLocationsByAmenity, getRelatedLocationsByFeature, getRelatedLocationsByOccupant, getSuitablyValueBetweenBearings, isClickableFeature, isValidCoordinate, isValidLineString, isValidLineStringCoordinates, isValidMultiPolygon, isValidMultiPolygonCoordinates, isValidPoint, isValidPolygon, isValidPolygonCoordinates, matchFilter, matchFilters, safeFetchFeature, styledFeatureGenerator };
1289
+ export { ALL_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, BASE_LAYER_NAME, DEFAULT_BASE_URL, DEFAULT_LOCALE, DESTINATION_MARKER_ID, type DetailFeature, type DetailGeometry, type DetailProperties, type ElementFeature, type ElementGeometry, type ElementProperties, type EventFeature, type EventGeometry, type EventProperties, type FeaturePopulatedResponseMap, type FeatureQueryOptions, type FeatureResponseMap, type FeatureType, type FilterParams, type FindParams, type FixtureFeature, type FixtureFeaturePopulated, type FixtureGeometry, type FixtureProperties, GEOJSON_FEATURE_TYPES, HIGHLIGHT_LAYER_NAME, type IAllVenuesViewConfig, type IExtrudeConfig, type IGraphFeatureOptions, type IGraphOptions, type IHighlightOptions, IMDF_FEATURE_TYPES, type IMapAnimation, type IMapConfig, type IMapExtrudeConfig, type ISetHighlight2DElementIdsOptions, type IUnitDistanceModifier, type IVerticalGraphOptions, type Id, type ImdfFeature, IndoorMap, type IndoorMapOptions, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, LAST_USER_LOCATION_ELEMENT_ID_PREFIX, LAYERS, LAYER_FEATURE_TYPE_OBJ, LAYER_OPTIONS, LOCALE_SYMBOL_KEY, type LabelFeature, type LabelGeometry, type LabelProperties, type LevelFeature, type LevelFeaturePopulated, type LevelGeometry, type LevelProperties, MARKER_LAYER_NAME, type Media, type MediaFile, type Model3d, type Model3dFeature, type Model3dGeometry, type Model3dProperties, NONIMDF_FEATURE_TYPES, ORIGIN_MARKER_ID, type OccupantFeature, type OccupantFeaturePopulated, type OccupantGeometry, occupantHelper as OccupantHelpers, type OccupantProperties, type OpeningFeature, type OpeningFeaturePopulated, type OpeningGeometry, type OpeningProperties, POI_MARKER_LAYER_NAME, type Page, type PolygonalFeature, type PopulatableFeatureType, type PopulatedParams, type PrivilegeFeature, type PrivilegeGeometry, type PrivilegeProperties, type PromotionFeature, type PromotionProperties, PulsingMarker, type RelationshipFeature, type RelationshipGeometry, type RelationshipProperties, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentStrapiV4ApiResponse, type SymbolSet, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, type TextMarkerOptions, TextSpriteMarker, USER_LOCATION_ELEMENT_ID, USER_LOCATION_LAYER_NAME, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitProperties, VENUE_EVENTS, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, createPolygonFromLineString, createSpriteMaterialByLabelSymbol, createStyledUIMarkerElement, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getBearingBetweenPoints, getCenterFromGeometry, getDataClient, getExtrudeConfigByFeature, getFeatureByLocationId, getLocationByAmenity, getLocationByFeature, getLocationByOccupant, getLocationIdByFeature, getOrdinalByLocationId, getRelatedLocationIdsByFeature, getRelatedLocationsByAmenity, getRelatedLocationsByFeature, getRelatedLocationsByOccupant, getSuitablyValueBetweenBearings, isClickableFeature, isValidCoordinate, isValidLineString, isValidLineStringCoordinates, isValidMultiPolygon, isValidMultiPolygonCoordinates, isValidPoint, isValidPolygon, isValidPolygonCoordinates, matchFilter, matchFilters, safeFetchFeature, styledFeatureGenerator };
package/dist/index.d.ts CHANGED
@@ -394,6 +394,29 @@ type Page = {
394
394
  id: Id;
395
395
  attributes: Record<string, unknown>;
396
396
  };
397
+ type Model3dGeometry = null;
398
+ type Model3dProperties = {
399
+ name: {
400
+ en: string;
401
+ };
402
+ model: string;
403
+ level_id: null;
404
+ project_id: string;
405
+ rotation_x: number;
406
+ rotation_y: number;
407
+ rotation_z: number;
408
+ center: number[];
409
+ scale: number;
410
+ altitude: 0;
411
+ translation_x: number;
412
+ translation_y: number;
413
+ translation_z: number;
414
+ createdAt: string;
415
+ updatedAt: string;
416
+ publishedAt: string;
417
+ locale: string;
418
+ };
419
+ type Model3dFeature = ImdfFeature<Model3dGeometry, Model3dProperties>;
397
420
  type FeatureResponseMap = {
398
421
  address: ImdfFeature;
399
422
  amenity: AmenityFeature;
@@ -417,6 +440,7 @@ type FeatureResponseMap = {
417
440
  promotion: PromotionFeature;
418
441
  label: LabelFeature;
419
442
  element: ElementFeature;
443
+ model3d: Model3dFeature;
420
444
  "sponsored-content": SponsoredContentFeature;
421
445
  page: Page;
422
446
  };
@@ -642,6 +666,7 @@ type FeaturePopulatedResponseMap = {
642
666
  promotion: PromotionFeature;
643
667
  label: LabelFeature;
644
668
  element: ImdfFeature;
669
+ model3d: Model3dFeature;
645
670
  "sponsored-content": SponsoredContentFeature;
646
671
  page: Page;
647
672
  };
@@ -1169,8 +1194,6 @@ declare function styledFeatureGenerator(mapTheme: any): {
1169
1194
  createLineStringFromGeometries: (geometries: any) => LineString$1;
1170
1195
  create3DStepPath: (feature: any, threeLayer: any, option?: {}) => NavigationPath;
1171
1196
  createDecoration: (decoration: any, options: any) => LineString$1 | Polygon$1 | MultiPolygon$1 | MultiLineString;
1172
- /** Three JS */
1173
- create3DFootprint: (feature: any, threeLayer: any, options: any) => Promise<any[]>;
1174
1197
  create3DBillboard: (billboard: any, threeLayer: any) => Billboard;
1175
1198
  create3DAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
1176
1199
  create3DOccupantAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
@@ -1263,4 +1286,4 @@ declare const VENUE_EVENTS: {
1263
1286
  VENUE_MOVEINTOVIEW: string;
1264
1287
  };
1265
1288
 
1266
- export { ALL_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, BASE_LAYER_NAME, DEFAULT_BASE_URL, DEFAULT_LOCALE, DESTINATION_MARKER_ID, type DetailFeature, type DetailGeometry, type DetailProperties, type ElementFeature, type ElementGeometry, type ElementProperties, type EventFeature, type EventGeometry, type EventProperties, type FeaturePopulatedResponseMap, type FeatureQueryOptions, type FeatureResponseMap, type FeatureType, type FilterParams, type FindParams, type FixtureFeature, type FixtureFeaturePopulated, type FixtureGeometry, type FixtureProperties, GEOJSON_FEATURE_TYPES, HIGHLIGHT_LAYER_NAME, type IAllVenuesViewConfig, type IExtrudeConfig, type IGraphFeatureOptions, type IGraphOptions, type IHighlightOptions, IMDF_FEATURE_TYPES, type IMapAnimation, type IMapConfig, type IMapExtrudeConfig, type ISetHighlight2DElementIdsOptions, type IUnitDistanceModifier, type IVerticalGraphOptions, type Id, type ImdfFeature, IndoorMap, type IndoorMapOptions, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, LAST_USER_LOCATION_ELEMENT_ID_PREFIX, LAYERS, LAYER_FEATURE_TYPE_OBJ, LAYER_OPTIONS, LOCALE_SYMBOL_KEY, type LabelFeature, type LabelGeometry, type LabelProperties, type LevelFeature, type LevelFeaturePopulated, type LevelGeometry, type LevelProperties, MARKER_LAYER_NAME, type Media, type MediaFile, type Model3d, NONIMDF_FEATURE_TYPES, ORIGIN_MARKER_ID, type OccupantFeature, type OccupantFeaturePopulated, type OccupantGeometry, occupantHelper as OccupantHelpers, type OccupantProperties, type OpeningFeature, type OpeningFeaturePopulated, type OpeningGeometry, type OpeningProperties, POI_MARKER_LAYER_NAME, type Page, type PolygonalFeature, type PopulatableFeatureType, type PopulatedParams, type PrivilegeFeature, type PrivilegeGeometry, type PrivilegeProperties, type PromotionFeature, type PromotionProperties, PulsingMarker, type RelationshipFeature, type RelationshipGeometry, type RelationshipProperties, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentStrapiV4ApiResponse, type SymbolSet, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, type TextMarkerOptions, TextSpriteMarker, USER_LOCATION_ELEMENT_ID, USER_LOCATION_LAYER_NAME, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitProperties, VENUE_EVENTS, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, createPolygonFromLineString, createSpriteMaterialByLabelSymbol, createStyledUIMarkerElement, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getBearingBetweenPoints, getCenterFromGeometry, getDataClient, getExtrudeConfigByFeature, getFeatureByLocationId, getLocationByAmenity, getLocationByFeature, getLocationByOccupant, getLocationIdByFeature, getOrdinalByLocationId, getRelatedLocationIdsByFeature, getRelatedLocationsByAmenity, getRelatedLocationsByFeature, getRelatedLocationsByOccupant, getSuitablyValueBetweenBearings, isClickableFeature, isValidCoordinate, isValidLineString, isValidLineStringCoordinates, isValidMultiPolygon, isValidMultiPolygonCoordinates, isValidPoint, isValidPolygon, isValidPolygonCoordinates, matchFilter, matchFilters, safeFetchFeature, styledFeatureGenerator };
1289
+ export { ALL_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, BASE_LAYER_NAME, DEFAULT_BASE_URL, DEFAULT_LOCALE, DESTINATION_MARKER_ID, type DetailFeature, type DetailGeometry, type DetailProperties, type ElementFeature, type ElementGeometry, type ElementProperties, type EventFeature, type EventGeometry, type EventProperties, type FeaturePopulatedResponseMap, type FeatureQueryOptions, type FeatureResponseMap, type FeatureType, type FilterParams, type FindParams, type FixtureFeature, type FixtureFeaturePopulated, type FixtureGeometry, type FixtureProperties, GEOJSON_FEATURE_TYPES, HIGHLIGHT_LAYER_NAME, type IAllVenuesViewConfig, type IExtrudeConfig, type IGraphFeatureOptions, type IGraphOptions, type IHighlightOptions, IMDF_FEATURE_TYPES, type IMapAnimation, type IMapConfig, type IMapExtrudeConfig, type ISetHighlight2DElementIdsOptions, type IUnitDistanceModifier, type IVerticalGraphOptions, type Id, type ImdfFeature, IndoorMap, type IndoorMapOptions, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, LAST_USER_LOCATION_ELEMENT_ID_PREFIX, LAYERS, LAYER_FEATURE_TYPE_OBJ, LAYER_OPTIONS, LOCALE_SYMBOL_KEY, type LabelFeature, type LabelGeometry, type LabelProperties, type LevelFeature, type LevelFeaturePopulated, type LevelGeometry, type LevelProperties, MARKER_LAYER_NAME, type Media, type MediaFile, type Model3d, type Model3dFeature, type Model3dGeometry, type Model3dProperties, NONIMDF_FEATURE_TYPES, ORIGIN_MARKER_ID, type OccupantFeature, type OccupantFeaturePopulated, type OccupantGeometry, occupantHelper as OccupantHelpers, type OccupantProperties, type OpeningFeature, type OpeningFeaturePopulated, type OpeningGeometry, type OpeningProperties, POI_MARKER_LAYER_NAME, type Page, type PolygonalFeature, type PopulatableFeatureType, type PopulatedParams, type PrivilegeFeature, type PrivilegeGeometry, type PrivilegeProperties, type PromotionFeature, type PromotionProperties, PulsingMarker, type RelationshipFeature, type RelationshipGeometry, type RelationshipProperties, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentStrapiV4ApiResponse, type SymbolSet, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, type TextMarkerOptions, TextSpriteMarker, USER_LOCATION_ELEMENT_ID, USER_LOCATION_LAYER_NAME, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitProperties, VENUE_EVENTS, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, createPolygonFromLineString, createSpriteMaterialByLabelSymbol, createStyledUIMarkerElement, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getBearingBetweenPoints, getCenterFromGeometry, getDataClient, getExtrudeConfigByFeature, getFeatureByLocationId, getLocationByAmenity, getLocationByFeature, getLocationByOccupant, getLocationIdByFeature, getOrdinalByLocationId, getRelatedLocationIdsByFeature, getRelatedLocationsByAmenity, getRelatedLocationsByFeature, getRelatedLocationsByOccupant, getSuitablyValueBetweenBearings, isClickableFeature, isValidCoordinate, isValidLineString, isValidLineStringCoordinates, isValidMultiPolygon, isValidMultiPolygonCoordinates, isValidPoint, isValidPolygon, isValidPolygonCoordinates, matchFilter, matchFilters, safeFetchFeature, styledFeatureGenerator };
package/dist/index.js CHANGED
@@ -168,7 +168,8 @@ var defaultFeatureQueryOptionsMap = {
168
168
  // refresh every 5 min
169
169
  },
170
170
  element: {},
171
- page: {}
171
+ page: {},
172
+ model3d: {}
172
173
  };
173
174
 
174
175
  // src/data/api/delivery-project.ts
@@ -184,6 +185,14 @@ async function fetchDeliveryApi(projectId, apiKey, featureType, baseUrl = DEFAUL
184
185
  const items = await res.json();
185
186
  return items;
186
187
  }
188
+ case "model3d": {
189
+ const res = await fetch(
190
+ `${baseUrl}/delivery/projects/${projectId}/${featureType}.geojson?api-key=${apiKey}`
191
+ );
192
+ if (res.status !== 200) return [];
193
+ const items = await res.json();
194
+ return items.features;
195
+ }
187
196
  case "sponsored-content": {
188
197
  const res = await fetch(
189
198
  `${baseUrl}/delivery/projects/${projectId}/sponsored-content.json?api-key=${apiKey}`
@@ -866,6 +875,13 @@ function featureCollection(features, options = {}) {
866
875
  fc.features = features;
867
876
  return fc;
868
877
  }
878
+ function multiPoint(coordinates, properties, options = {}) {
879
+ const geom = {
880
+ type: "MultiPoint",
881
+ coordinates
882
+ };
883
+ return feature(geom, properties, options);
884
+ }
869
885
  function isNumber(num) {
870
886
  return !isNaN(num) && num !== null && !Array.isArray(num);
871
887
  }
@@ -956,7 +972,6 @@ var import_maptalks4 = require("maptalks");
956
972
  var import_center2 = __toESM(require("@turf/center"));
957
973
  var import_buffer = __toESM(require("@turf/buffer"));
958
974
  var import_three4 = require("three");
959
- var import_GLTFLoader = require("three/examples/jsm/loaders/GLTFLoader.js");
960
975
 
961
976
  // src/IndoorMap/object3d/Billboard.js
962
977
  var maptalks = __toESM(require("maptalks"));
@@ -1542,36 +1557,6 @@ var createPedestrianOpening = (feature2, style, options = {}) => {
1542
1557
  console.log(`error creating pedestrian opening:`, feature2);
1543
1558
  }
1544
1559
  };
1545
- var loadModel3d = (model3d, coordinate, threeLayer) => {
1546
- return new Promise((resolve, reject) => {
1547
- const loader = new import_GLTFLoader.GLTFLoader();
1548
- const { url, properties: modelProperties } = model3d;
1549
- loader.load(
1550
- url,
1551
- (gltf) => {
1552
- const object3d = gltf.scene;
1553
- object3d.rotation.x = import_lodash4.default.get(modelProperties, "rotation.x");
1554
- object3d.rotation.y = import_lodash4.default.get(modelProperties, "rotation.y");
1555
- object3d.scale.set(...import_lodash4.default.get(modelProperties, "scale") || []);
1556
- const object = threeLayer.toModel(object3d, {
1557
- coordinate
1558
- });
1559
- object.getObject3d().traverse((child) => {
1560
- if (child.isMesh === true) {
1561
- child.material.transparent = true;
1562
- child.material.metalness = 0.1;
1563
- }
1564
- });
1565
- resolve(object);
1566
- },
1567
- (xhr) => {
1568
- },
1569
- (error) => {
1570
- reject(error);
1571
- }
1572
- );
1573
- });
1574
- };
1575
1560
  var createExtrudePolygon = (geometry, threeLayer, material, height, properties = {}, options) => {
1576
1561
  const { offset = 0, altitude = 0 } = options;
1577
1562
  const offsetGeometry = (0, import_buffer.default)(geometry, offset, { units: "meters" });
@@ -2245,42 +2230,6 @@ var styledFeatureGenerator = (mapTheme) => {
2245
2230
  return null;
2246
2231
  }
2247
2232
  },
2248
- /** Three JS */
2249
- create3DFootprint: async (feature2, threeLayer, options) => {
2250
- const objects = [];
2251
- const extrudeHeight = import_lodash4.default.get(options, "height");
2252
- if (!extrudeHeight) return objects;
2253
- const { properties } = feature2;
2254
- const footprintProperties = getFeatureProperties(feature2);
2255
- const hasModel3ds = Array.isArray(properties.model3d) && properties.model3d.length > 0;
2256
- if (hasModel3ds) {
2257
- const models = properties.model3d;
2258
- const center2 = (0, import_center2.default)(feature2);
2259
- const coordinate = import_lodash4.default.get(center2, "geometry.coordinates");
2260
- for (const model of models) {
2261
- const object = await loadModel3d(model, coordinate, threeLayer);
2262
- object.properties = footprintProperties;
2263
- objects.push(object);
2264
- }
2265
- } else {
2266
- const color = footprintProperties.defaultColor;
2267
- if (color === "transparent") return;
2268
- const material = new import_three4.MeshLambertMaterial({
2269
- color,
2270
- transparent: true
2271
- });
2272
- const object = createExtrudePolygon(
2273
- feature2.geometry,
2274
- threeLayer,
2275
- material,
2276
- extrudeHeight,
2277
- footprintProperties,
2278
- {}
2279
- );
2280
- objects.push(object);
2281
- }
2282
- return objects;
2283
- },
2284
2233
  create3DBillboard: (billboard, threeLayer) => {
2285
2234
  const { id, feature_type, properties } = billboard;
2286
2235
  const {
@@ -2781,8 +2730,7 @@ var CameraManager = class {
2781
2730
  };
2782
2731
 
2783
2732
  // src/IndoorMap/renderer/RendererManager.ts
2784
- var import_isFunction = __toESM(require("lodash/isFunction"));
2785
- var import_min = __toESM(require("lodash/min"));
2733
+ var import_lodash_es2 = require("lodash-es");
2786
2734
  var import_center3 = require("@turf/center");
2787
2735
  var THREE3 = __toESM(require("three"));
2788
2736
 
@@ -2791,6 +2739,12 @@ var maptalks4 = __toESM(require("maptalks-gl"));
2791
2739
  var THREE = __toESM(require("three"));
2792
2740
  var import_maptalks7 = require("maptalks.three");
2793
2741
  var import_buffer2 = __toESM(require("@turf/buffer"));
2742
+ var import_clean_coords = require("@turf/clean-coords");
2743
+ var import_polygon_to_line = require("@turf/polygon-to-line");
2744
+ var import_nearest_point_on_line = require("@turf/nearest-point-on-line");
2745
+ var import_length = require("@turf/length");
2746
+ var import_along = require("@turf/along");
2747
+ var import_point_to_line_distance = require("@turf/point-to-line-distance");
2794
2748
 
2795
2749
  // src/IndoorMap/renderer/3d/objects/GroundLabel.ts
2796
2750
  var maptalks3 = __toESM(require("maptalks-gl"));
@@ -3093,15 +3047,15 @@ var GroundLabel = class extends import_maptalks6.BaseObject {
3093
3047
  // src/IndoorMap/renderer/3d/element3DRendererOptions.ts
3094
3048
  var element3DRendererOptions = {
3095
3049
  unit: {
3096
- default: { color: "#ffffff", height: 4 },
3050
+ default: { color: "#ffffff", height: 0.2 },
3097
3051
  byCategory: {
3098
3052
  walkway: { color: "#cccccc", height: 0.1 },
3099
3053
  terrace: { color: "#cccccc", height: 0.1 },
3100
3054
  unenclosedarea: { color: "#cccccc", height: 0.2 },
3101
3055
  nonpublic: { color: "#999999", height: 0.3 },
3102
3056
  escalator: { height: 0.2 },
3103
- parking: { height: 0.1 },
3104
- room: { color: "#ffffff", height: 2, bottomHeight: 0.12 }
3057
+ parking: { color: "#999999", height: 0.1 },
3058
+ room: { color: "#ffffff", height: 0.5, bottomHeight: 0.12 }
3105
3059
  }
3106
3060
  },
3107
3061
  kiosk: {
@@ -3133,6 +3087,7 @@ var get3DRendererOption = (featureType, category, options) => {
3133
3087
  };
3134
3088
 
3135
3089
  // src/IndoorMap/renderer/3d/Element3DRenderer.ts
3090
+ var import_line_split = __toESM(require("@turf/line-split"));
3136
3091
  var HEIGHT_METER = 4;
3137
3092
  var MULTIORDINAL_HEIGHT_METER = 9;
3138
3093
  var Element3DRenderer = class extends EventTarget {
@@ -3264,6 +3219,68 @@ var Element3DRenderer = class extends EventTarget {
3264
3219
  console.log(`error createGeometry`, err, { feature: feature2, options });
3265
3220
  }
3266
3221
  };
3222
+ createRoomWall(unit, openings = []) {
3223
+ const polygons = unit.geometry.type === "Polygon" ? [unit.geometry.coordinates] : unit.geometry.coordinates;
3224
+ return polygons.map((plg) => {
3225
+ return plg.map((ring) => {
3226
+ const roomWall = (0, import_clean_coords.cleanCoords)((0, import_polygon_to_line.polygonToLine)(polygon([ring])));
3227
+ if (openings.length === 0) {
3228
+ const color = "#ababab";
3229
+ const material = this.getOrCreateMaterialByColor(color);
3230
+ const extrudedWall = this.threeLayer.toExtrudeLine(
3231
+ new maptalks4.LineString(roomWall.geometry.coordinates),
3232
+ { height: 4, width: 1 },
3233
+ material
3234
+ );
3235
+ return extrudedWall;
3236
+ }
3237
+ let openingPoints = [];
3238
+ openings.forEach((opening) => {
3239
+ const doorCoords = opening?.geometry?.coordinates;
3240
+ const p0 = point(doorCoords[0]);
3241
+ const p1 = point(doorCoords[doorCoords.length - 1]);
3242
+ const s0 = (0, import_nearest_point_on_line.nearestPointOnLine)(roomWall, p0, { units: "meters" });
3243
+ const s1 = (0, import_nearest_point_on_line.nearestPointOnLine)(roomWall, p1, { units: "meters" });
3244
+ const d0 = s0.properties.dist;
3245
+ const d1 = s1.properties.dist;
3246
+ if (d0 > 1 || d1 > 1) {
3247
+ } else {
3248
+ openingPoints = openingPoints.concat([s0.geometry.coordinates, s1.geometry.coordinates]);
3249
+ }
3250
+ });
3251
+ try {
3252
+ const split = (0, import_line_split.default)(roomWall, multiPoint(openingPoints));
3253
+ const wallsOnly = split.features.filter((seg) => {
3254
+ const mid = (0, import_along.along)(seg, (0, import_length.length)(seg, { units: "meters" }) / 2, { units: "meters" });
3255
+ for (const opening of openings) {
3256
+ const dist = (0, import_point_to_line_distance.pointToLineDistance)(mid, opening, { units: "meters" });
3257
+ if (dist < 0.05) return false;
3258
+ }
3259
+ return true;
3260
+ });
3261
+ const wallMeshes = wallsOnly.map((feature2, i) => {
3262
+ const color = "#ababab";
3263
+ const material = this.getOrCreateMaterialByColor(color);
3264
+ const extrudedLine = this.threeLayer.toExtrudeLine(
3265
+ new maptalks4.LineString(feature2.geometry.coordinates),
3266
+ { height: 3, width: 0.4, id: unit.id },
3267
+ material
3268
+ );
3269
+ extrudedLine.getObject3d().userData = {
3270
+ unitId: unit.id,
3271
+ coords: feature2.geometry.coordinates
3272
+ };
3273
+ return extrudedLine;
3274
+ }).flat();
3275
+ this.threeLayer.addMesh(wallMeshes);
3276
+ return wallMeshes;
3277
+ } catch (e) {
3278
+ console.log(e.message, { unit, roomWall });
3279
+ return [];
3280
+ }
3281
+ }).flat();
3282
+ }).flat();
3283
+ }
3267
3284
  async createEscalator(f, coordinate, options) {
3268
3285
  const model = {
3269
3286
  url: "https://cdn.venue.in.th/static/glb/escalator.glb",
@@ -3293,14 +3310,14 @@ var Element3DRenderer = class extends EventTarget {
3293
3310
  this.threeLayer.addMesh(groundLabel);
3294
3311
  return groundLabel;
3295
3312
  }
3296
- async createTree(coordinate, ordinal) {
3297
- const treeMarker = new maptalks4.GLTFMarker(coordinate, {
3313
+ async createModel3d(f) {
3314
+ const marker = new maptalks4.GLTFMarker(f.properties.center, {
3298
3315
  symbol: {
3299
- url: "https://dashboard.situm.com/uploads/3dmodels/demoaccount/new_escalator.glb"
3316
+ url: f.properties.model
3300
3317
  }
3301
3318
  });
3302
- treeMarker.addTo(this.gltfLayer);
3303
- return treeMarker;
3319
+ marker.addTo(this.gltfLayer);
3320
+ return marker;
3304
3321
  }
3305
3322
  async createBuilding(coordinate, ordinal) {
3306
3323
  return Promise.resolve(null);
@@ -3459,6 +3476,9 @@ var Element2DRenderer = class extends EventTarget {
3459
3476
  return geometry;
3460
3477
  }
3461
3478
  };
3479
+ createRoomWall(unit, openings) {
3480
+ return null;
3481
+ }
3462
3482
  async createEscalator(f, coordinates) {
3463
3483
  return Promise.resolve(null);
3464
3484
  }
@@ -3467,9 +3487,6 @@ var Element2DRenderer = class extends EventTarget {
3467
3487
  const bound = f.geometry.coordinates[0];
3468
3488
  return null;
3469
3489
  }
3470
- async createTree(coordinates) {
3471
- return Promise.resolve(null);
3472
- }
3473
3490
  async createBuilding(coordinate, ordinal) {
3474
3491
  return Promise.resolve(null);
3475
3492
  }
@@ -4341,6 +4358,38 @@ var RendererManager = class extends EventTarget {
4341
4358
  const groupLayer = this.map.getLayer("group");
4342
4359
  const threeLayer = groupLayer.getLayer("three");
4343
4360
  threeLayer.prepareToDraw = function(gl, scene, camera) {
4361
+ function findBadMeshes(scene2) {
4362
+ const bad = [];
4363
+ scene2.traverse((obj) => {
4364
+ if (!obj?.isMesh) return;
4365
+ const geom = obj.geometry;
4366
+ const pos = geom?.attributes?.position?.array;
4367
+ if (!pos || pos.length === 0) return;
4368
+ for (let i = 0; i < pos.length; i++) {
4369
+ const v2 = pos[i];
4370
+ if (!Number.isFinite(v2)) {
4371
+ bad.push({ mesh: obj, index: i, value: v2 });
4372
+ break;
4373
+ }
4374
+ }
4375
+ });
4376
+ if (bad.length) {
4377
+ console.group(`\u274C Found ${bad.length} meshes with invalid positions`);
4378
+ for (const b of bad) {
4379
+ console.log({
4380
+ name: b.mesh.name,
4381
+ userData: b.mesh.userData,
4382
+ uuid: b.mesh.uuid,
4383
+ badIndex: b.index,
4384
+ badValue: b.value
4385
+ });
4386
+ }
4387
+ console.groupEnd();
4388
+ } else {
4389
+ console.log("\u2705 No invalid meshes found");
4390
+ }
4391
+ return bad;
4392
+ }
4344
4393
  const ambientLight = new THREE3.AmbientLight(16777215, 0.3);
4345
4394
  scene.add(ambientLight);
4346
4395
  const dirColor = 16777215;
@@ -4355,6 +4404,9 @@ var RendererManager = class extends EventTarget {
4355
4404
  options.onRendererReady();
4356
4405
  }
4357
4406
  _this.#createElements();
4407
+ setTimeout(() => {
4408
+ findBadMeshes(scene);
4409
+ }, 3e3);
4358
4410
  };
4359
4411
  } else {
4360
4412
  this.elementRenderer = new Element2DRenderer(map, options.elements);
@@ -4369,7 +4421,7 @@ var RendererManager = class extends EventTarget {
4369
4421
  if (this.#isClicked) return;
4370
4422
  this.#isClicked = true;
4371
4423
  const onClickElement = this.#onClickElement;
4372
- if (!(0, import_isFunction.default)(onClickElement)) return;
4424
+ if (!(0, import_lodash_es2.isFunction)(onClickElement)) return;
4373
4425
  this.#onClickElement(e);
4374
4426
  this.#isClicked = false;
4375
4427
  };
@@ -4396,6 +4448,9 @@ var RendererManager = class extends EventTarget {
4396
4448
  const levels = await this.#dataClient.filterByType("level", {
4397
4449
  populate: true
4398
4450
  });
4451
+ const openings = await this.#dataClient.filterByType("opening", {
4452
+ populate: true
4453
+ });
4399
4454
  const relationships = await this.#dataClient.filterByType("relationship");
4400
4455
  const fixtures = await this.#dataClient.filterByType("fixture", { populate: true });
4401
4456
  fixtures.forEach((fixture) => {
@@ -4409,7 +4464,7 @@ var RendererManager = class extends EventTarget {
4409
4464
  populate: true
4410
4465
  });
4411
4466
  units.filter(
4412
- (u4) => !["opentobelow", "escalator"].includes(u4.properties.category)
4467
+ (u4) => !["opentobelow", "escalator", "room"].includes(u4.properties.category)
4413
4468
  ).forEach((unit) => {
4414
4469
  const element = this.elementRenderer.createGeometry(unit);
4415
4470
  if (element) {
@@ -4417,6 +4472,22 @@ var RendererManager = class extends EventTarget {
4417
4472
  this.addElementsToManager(unit.id, _elements, unit.properties.level.properties.ordinal);
4418
4473
  }
4419
4474
  });
4475
+ units.filter((u4) => u4.properties.category === "room").forEach((unit) => {
4476
+ const openingRelationships = relationships.filter((r) => r.properties.origin?.id === unit.id || r.properties.destination?.id === unit.id);
4477
+ const roomOpenings = (0, import_lodash_es2.compact)(openingRelationships.map((rel) => {
4478
+ const openingId = rel?.properties.intermediary[0].id;
4479
+ return openings.find((o) => o.id === openingId);
4480
+ }));
4481
+ const innerElements = this.elementRenderer.createGeometry(unit);
4482
+ const wallElements = this.elementRenderer.createRoomWall(unit, roomOpenings);
4483
+ if (innerElements || wallElements) {
4484
+ const _innerElements = Array.isArray(innerElements) ? innerElements : [innerElements];
4485
+ const _wallElements = Array.isArray(wallElements) ? wallElements : [wallElements];
4486
+ const _elements = [..._innerElements, ..._wallElements];
4487
+ const ordinal = unit.properties.level.properties.ordinal;
4488
+ this.addElementsToManager(unit.id, _elements, ordinal);
4489
+ }
4490
+ });
4420
4491
  const kiosks = await this.#dataClient.filterByType("kiosk", {
4421
4492
  populate: true
4422
4493
  });
@@ -4464,12 +4535,17 @@ var RendererManager = class extends EventTarget {
4464
4535
  const center2 = (0, import_center3.center)(polygon(label.geometry.coordinates)).geometry.coordinates;
4465
4536
  const unit = findUnitOnPoint(units, center2);
4466
4537
  const element = this.elementRenderer.createGroundLabel(label, unit);
4467
- console.log({ element });
4468
4538
  if (element) {
4469
4539
  const _elements = Array.isArray(element) ? element : [element];
4470
4540
  this.addElementsToManager(label.id, _elements, label.properties.ordinal);
4471
4541
  }
4472
4542
  }
4543
+ if (this.options.type === "3D") {
4544
+ const model3ds = await this.#dataClient.filterByType("model3d");
4545
+ for (const model3d of model3ds) {
4546
+ this.elementRenderer.createModel3d(model3d);
4547
+ }
4548
+ }
4473
4549
  this.changeLevelByOrdinal(this.currentOrdinals);
4474
4550
  this.dispatchEvent(new CustomEvent("renderermanager:elements_created"));
4475
4551
  }
@@ -4484,7 +4560,7 @@ var RendererManager = class extends EventTarget {
4484
4560
  this.markerRenderer.showMarkers(markers, ordinal - baseOrdinal);
4485
4561
  }
4486
4562
  } else {
4487
- const baseOrdinal = Array.isArray(targetOrdinal) ? (0, import_min.default)(targetOrdinal) : targetOrdinal;
4563
+ const baseOrdinal = Array.isArray(targetOrdinal) ? (0, import_lodash_es2.min)(targetOrdinal) : targetOrdinal;
4488
4564
  for (const [ordinal, elements] of this.elementsByOrdinal) {
4489
4565
  const inOrdinal = Array.isArray(targetOrdinal) ? targetOrdinal.includes(ordinal) : ordinal === targetOrdinal;
4490
4566
  if (inOrdinal) {
@@ -4511,7 +4587,7 @@ var RendererManager = class extends EventTarget {
4511
4587
  const elements = elemIds.map((id) => this.elementsMap.get(id)).flat();
4512
4588
  elements.forEach((element) => {
4513
4589
  const controller = this.elementRenderer.createHighlightController(element);
4514
- if (controller && (0, import_isFunction.default)(controller.start)) {
4590
+ if (controller && (0, import_lodash_es2.isFunction)(controller.start)) {
4515
4591
  controller.start();
4516
4592
  this.highlightControllers.push(controller);
4517
4593
  }
@@ -4519,7 +4595,7 @@ var RendererManager = class extends EventTarget {
4519
4595
  };
4520
4596
  clearHighlightElements = () => {
4521
4597
  this.highlightControllers.forEach((controller) => {
4522
- if ((0, import_isFunction.default)(controller?.clear)) controller.clear();
4598
+ if ((0, import_lodash_es2.isFunction)(controller?.clear)) controller.clear();
4523
4599
  });
4524
4600
  };
4525
4601
  /**
@@ -4795,18 +4871,12 @@ var IndoorMap = class extends EventTarget {
4795
4871
  async #legacy_createElements() {
4796
4872
  const {
4797
4873
  // 2D
4798
- createVenue,
4799
4874
  createOpening,
4800
4875
  createSection,
4801
- createFixture,
4802
- createOccupant,
4803
4876
  createDecoration,
4804
4877
  // 3D
4805
- create3DFootprint,
4806
4878
  create3DBillboard,
4807
- createExtrudedUnit,
4808
4879
  create3DAmenityMarker,
4809
- create3DOccupantAmenityMarker,
4810
4880
  create3DOpeningMarker
4811
4881
  } = this.#styler;
4812
4882
  let elements = {};