@smarterplan/ngx-smarterplan-core 1.4.26 → 1.4.27

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.
@@ -4829,7 +4829,10 @@ class MatterportTagService {
4829
4829
  mattertagData.setObject(object, poiType);
4830
4830
  }
4831
4831
  await setTagIconAndOpacity(mattertagID, mattertagData);
4832
- await injectHtmlInTag(poiType, object, mattertagID);
4832
+ // Without an object (a placement just validated) there is nothing to show yet.
4833
+ if (object) {
4834
+ await injectHtmlInTag(poiType, object, mattertagID);
4835
+ }
4833
4836
  }
4834
4837
  /** Registers a custom texture and applies it to a tag, optionally adjusting opacity. */
4835
4838
  async addNewIconAndSetForTag(sdk, mattertagID, iconPath, applyOpacity, opacity) {
@@ -5979,7 +5982,6 @@ class MatterportService {
5979
5982
  mattertagData.setSweepID(this.navigationService.resolveSweepUuid(this.poseCamera.sweep));
5980
5983
  mattertagData.setRotation(this.poseCamera.rotation);
5981
5984
  mattertagData.setObject(element, poiType);
5982
- this.mattertagToFollow = await this.addMattertagToViewer(mattertagData);
5983
5985
  this.setInteractionMode(ViewerInteractions.POSITIONING);
5984
5986
  await this.addCursorMattertag(mattertagData);
5985
5987
  }
@@ -10629,9 +10631,24 @@ class ViewerService {
10629
10631
  this.matterportService.refreshTagsVisibility();
10630
10632
  }
10631
10633
  }
10634
+ /** Type of a POI recorded without one, deduced from the object it belongs to. */
10635
+ poiTypeFromObject(object) {
10636
+ switch (object?.__typename) {
10637
+ case 'Equipment':
10638
+ return PoiType.EQUIPMENT;
10639
+ case 'Ticket':
10640
+ return PoiType.TICKET;
10641
+ case 'Comment':
10642
+ return PoiType.MEASURE;
10643
+ case 'Feature':
10644
+ return object.type === FeatureType.DESK ? PoiType.DESK : PoiType.DATA;
10645
+ default:
10646
+ return null;
10647
+ }
10648
+ }
10632
10649
  async actionAddObjectFromPOI(object, poi) {
10633
10650
  if (this.checkMode('Matterport')) {
10634
- return this.matterportService.createMattertagFromPOI(poi.type, object, poi);
10651
+ return this.matterportService.createMattertagFromPOI(poi.type ?? this.poiTypeFromObject(object), object, poi);
10635
10652
  }
10636
10653
  if (this.checkMode('threejs')) {
10637
10654
  return this.addThreeJsTagFromPOI(object, poi);
@@ -11198,8 +11215,9 @@ class ViewerService {
11198
11215
  };
11199
11216
  const updatedPoi = await this.poiService.updatePoi(poiInput);
11200
11217
  tagData.setPoi(updatedPoi);
11201
- await this.matterportService.setObjectAndPoiInTag(lastTag, element, PoiType.DESK, updatedPoi);
11202
- await this.matterportService.injectHtmlInTag(poi.type, element, lastTag);
11218
+ const poiType = poi.type ?? tagData.getType();
11219
+ await this.matterportService.setObjectAndPoiInTag(lastTag, element, poiType, updatedPoi);
11220
+ await this.matterportService.injectHtmlInTag(poiType, element, lastTag);
11203
11221
  await this.matterportService.setTagIconAndOpacity(lastTag, tagData);
11204
11222
  this.matterportService.goToTag(lastTag);
11205
11223
  return Promise.resolve(updatedPoi);