laptop and a wrench

Bug

Features always return centroids on a query even though the returnCentroid property in a Query Class is set to false.

Last Published: October 16, 2019 ArcGIS API for JavaScript
Bug ID Number BUG-000124894
SubmittedAugust 29, 2019
Last ModifiedJune 5, 2024
Applies toArcGIS API for JavaScript
Version found4.12
Operating SystemWindows OS
Operating System Version10.0
StatusWill Not Be Addressed

Additional Information

This is by design. The document is correct for Query.returnGeometry. It is set to false by default. The createQuery() method sets it to true, please refer to https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#createQuery The returnCentroid parameter works as expected. When set to false, the query to the server does not request it and it does not come back from the server. When it is set to true it does come back in the payload. All extent geometries have a centroid, so when an extent is created, the centroid is created along with it. It is not really related to the query. However, where the API for the query is confusing is that returnCentroid is currently not very useful to the end user. The payload is returned, the FeatureSet in JavaScript is not displayed.

Steps to Reproduce

Bug ID: BUG-000124894

Software:

  • ArcGIS API for JavaScript

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options