<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Franklin Gothic Book";
        panose-1:2 11 5 3 2 1 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">I looked at the onMeshCreated callback but I don’t think I understand it very well.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">In my small sample app, I have 3 features on the GeometryLayer from a FileSource. As I zoom in and out, I see onMeshCreated get called multiple times – does this mean new ThreeJS objects are being created for all zoom levels?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Also, the values that get passed in to onMeshCreated don’t seem to represent individual features. Is there a one-to-one mapping between a feature defined in the FileSource and a ThreeJS object that gets created? The object passed in to
 onMeshCreated seems to represent something that holds all of the features.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have a use case where I will need to change visibility for individual features in the layer. Am I going about this the wrong way by trying to access the ThreeJS objects? Is there another way to accomplish this?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Chad<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Adrien Berthet <Adrien.Berthet@ign.fr> <br>
<b>Sent:</b> Tuesday, April 21, 2020 12:46 AM<br>
<b>To:</b> Johnston, Chad <Chad.Johnston@parsons.com>; itowns-user@lists.osgeo.org<br>
<b>Subject:</b> [EXTERNAL] RE:Accessing features of a GeometryLayer<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">Hi Chad,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">I assume you are using a
<b>FileSource</b> ? In this case, you can use <b>layer.source.parsedData</b> to access the
<b>FeatureCollection</b> (which is an internal itowns format).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">If you meant the ThreeJS objects, you can get them by setting a
<b>onMeshCreated</b> to your layer, like in this case for example: <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_iTowns_itowns_blob_master_examples_source-5Fstream-5Fwfs-5F3d.html-23L189-2DL192&d=DwMF-g&c=Nwf-pp4xtYRe0sCRVM8_LWH54joYF7EKmrYIdfxIq10&r=mQjF0_nPzjZcqOc5JWZp-Sz0OqXtNQ5NEp_IsAW3X-I&m=lbRrkYQRGdYF3aF_Q9iTbEjabC6FpWGbSR2gFv9NP2k&s=jrJw2LpCSd80WmcQQlDuec8u91wxQwfpL-UYrnMBDYA&e=" target="_blank">
https://github.com/iTowns/itowns/blob/master/examples/source_stream_wfs_3d.html#L189-L192 [github.com]</a><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">It allows you to access the mesh once it has been created, and you can even use this method with a stream.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">Hope it helps a bit<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">Adrien<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black">
<hr size="2" width="100%" align="center">
</span></div>
<div id="divRpF587157">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black">De :</span></b><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black"> ITowns-user [itowns-user-bounces@lists.osgeo.org]
 de la part de Johnston, Chad [Chad.Johnston@parsons.com]<br>
<b>Envoyé :</b> lundi 20 avril 2020 19:57<br>
<b>À :</b> <a href="mailto:itowns-user@lists.osgeo.org">itowns-user@lists.osgeo.org</a><br>
<b>Objet :</b> [iTowns-user] Accessing features of a GeometryLayer</span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="color:black">How can I access features that were added to a GeometryLayer from a GeoJSON source? I have to pass in a ThreeJS Group to the GeometryLayer constructor, but that object ends up having no children so I’m not sure
 where the actual features end up in the scene.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">To be clear, I’d like to be able to access individual ThreeJS objects that represent each feature in the layer. I don’t know if that’s how they’re created and added to the scene, but it seems logical since they
 can be different colors.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">Chad<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Franklin Gothic Book",sans-serif;color:black">NOTICE: This email message and all attachments transmitted with it may contain privileged and confidential information, and information that is protected
 by, and proprietary to, Parsons Corporation, and is intended solely for the use of the addressee for the specific purpose set forth in this communication. If the reader of this message is not the intended recipient, you are hereby notified that any reading,
 dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited, and you should delete this message and all copies and backups thereof. The recipient may not further distribute or use any of the information contained
 herein without the express written authorization of the sender. If you have received this message in error, or if you have any questions regarding the use of the proprietary information contained therein, please contact the sender of this message immediately,
 and the sender will provide you with further instructions.<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>