Select to view content in your preferred language

SceneView queryFeatures

737
2
10-21-2022 05:00 PM
Wade
by
New Contributor III

 Can the geometry of Z values ​​be returned when querying?

 

 

 

let btn = sceneView.on('click', (event) => {
             sceneView.hitTest(event).then((response) => {
                    if (response.results.length > 0) {
                        let graphic = response.results[0].graphic;

                        graphic.layer.queryFeatures(
                            {
                                objectIds: [graphic.attributes[graphic.layer.objectIdField]],
                                outFields: "*",
                                returnGeometry: true,
                                returnZ: true,
                                multipatchOption: "xyFootprint"
                            }
                        ).then((result) => {
                          // Can the geometry of Z values ​​be returned when querying?
                        });
                    }
             });
         });

 

 

consoleconsole

0 Kudos
2 Replies
by Anonymous User
Not applicable

Hi @Wade 

Yes this should be possible, but from the screenshot it seem like your features don't have any z-values stored. Or maybe the features are draped on the ground? In this case you could maybe query the height of the elevation service instead, like in this sample.

Either way it would be helpful if you could provide us with a working codepen example so we can find out what the issue is in this case. 

Best, Daniel

0 Kudos
Wade
by
New Contributor III

Hi @Anonymous User 

Thanks, there may be other reasons, I found the possible reason, it should be the reason for publishing the service, 3d to multipatch.

Our current production function is underground.

0 Kudos