Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Desplandis committed Feb 7, 2025
1 parent 3a10456 commit b312f44
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 2 deletions.
2 changes: 1 addition & 1 deletion itowns/dev/dist/itowns.js

Large diffs are not rendered by default.

75 changes: 74 additions & 1 deletion itowns/dev/docs/api/Layer/OGC3DTilesLayer.html
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ <h3>


intersects:
<span class="type">Array</span>
<span class="type">Array.&lt;THREE.Intersection></span>


)
Expand Down Expand Up @@ -462,6 +462,79 @@ <h4>Parameters</h4>



</div>

<hr/>



<div class="method">
<h3>
<span class="method-name">getMetadataFromIntersections</span>
(




intersections:
<span class="type">Array.&lt;THREE.Intersection></span>


)
:

<span class="type">Promise.&lt;(Object|null)></span>



</h3>



<div class="description">
<p>Get the <a href="https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata">metadata</a>
of the closest intersected object from a list of intersections.</p>
<p>This method retrieves structured metadata stored in GLTF 2.0 assets using
the <a href="https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata"><code>EXT_structural_metadata</code></a>
extension.</p>
<p>Internally, it uses the closest intersected point to index metadata
stored in property attributes and textures.</p>
<p>If present in GLTF 2.0 assets, this method leverages the
<a href="%60https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_mesh_features"><code>EXT_mesh_features</code></a>
extension and the returned featured to index metadata stored in property tables.</p>
</div>




<h4>Returns</h4>

<ul>
<li>the intersected object's metadata</li>
</ul>



<h4>Parameters</h4>


<ul class="params">

<li>
<code>intersections</code>




</li>

</ul>






</div>

<hr/>
Expand Down
5 changes: 5 additions & 0 deletions itowns/dev/examples/jsm/OGC3DTilesHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export function fillHTMLWithPickingInfo(event, pickingArg) {
// eslint-disable-next-line
htmlDiv.appendChild(createHTMLListFromObject(closestC3DTileFeature));
}

layer.getMetadataFromIntersections(intersects).then((metadata) => {
// eslint-disable-next-line
metadata?.forEach(m => htmlDiv.appendChild(createHTMLListFromObject(m)));
});
}

function zoomToSphere(view, tile, sphere) {
Expand Down

0 comments on commit b312f44

Please sign in to comment.