Contents
A function calls queryObjectIds () whenever the user clicks on the map, which returns the objectId of the corresponding hexagon in the layer. We highlight the hexagon, then use the queryRelatedFeatures () method to query for the related features attached to this object id.
Is it necessary to query multiple layers in a map service?
Occasionally, it is necessary to query multiple layers simultaneously. If the requirement is to query all layers in a map service, then an identify task should be used. Otherwise, it can be useful to use multiple query tasks to query different layers. The potential hangup with this approach is how to know when all queries have finished.
How to query related features from a featurelayer?
This sample demonstrates how to query related features from a FeatureLayer by using the queryRelatedFeatures () method. Each hexagon on the map represents one or more major cities in the U.S. Clicking on a hexagon will trigger a query for its related features, which will be displayed in a table added to the view’s UI.
Can a SQL query be executed on a feature layer?
Learn how to execute a SQL query to access polygon features from a feature layer. A feature layer can contain a large number of features stored in ArcGIS. To access a subset of the features, you can execute either a SQL or spatial query, or both at the same time.
Where can I find the relationship Id of a table?
The relationship id is the id of the related table of interest. You can use the Services Directory to find the relationship id. The related table has a field called AGREE_WITH_INCIDENT that contains a numeric value defining how many people agree that the incident is important.
How to add a relationship to a table?
The application listens for an event, layers-add-result, which fires after layers added with map.addLayers () have been added to the map. To query and edit a related table, create a RelationshipQuery and specify the outfields and relationship id. The relationship id is the id of the related table of interest.
How to query and edit related records?
How to query and edit related records. The sample has an operational layer that displays service incidents for the city of San Francisco, including graffiti complaints, damaged streets and sidewalks, and requests for city services.