[iTowns-user] Accessing features of a GeometryLayer

Adrien Berthet Adrien.Berthet at ign.fr
Mon Apr 20 23:46:26 PDT 2020


Hi Chad,

I assume you are using a FileSource ? In this case, you can use layer.source.parsedData to access the FeatureCollection (which is an internal itowns format).

If you meant the ThreeJS objects, you can get them by setting a onMeshCreated to your layer, like in this case for example: https://github.com/iTowns/itowns/blob/master/examples/source_stream_wfs_3d.html#L189-L192
It allows you to access the mesh once it has been created, and you can even use this method with a stream.

Hope it helps a bit

Adrien

________________________________
De : ITowns-user [itowns-user-bounces at lists.osgeo.org] de la part de Johnston, Chad [Chad.Johnston at parsons.com]
Envoyé : lundi 20 avril 2020 19:57
À : itowns-user at lists.osgeo.org
Objet : [iTowns-user] Accessing features of a GeometryLayer

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.

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.

Thanks,
Chad

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/itowns-user/attachments/20200421/14d3ac34/attachment.html>


More information about the ITowns-user mailing list