require([ "esri/layers/FeatureLayer", "esri/tasks/RelationshipQuery", "dojo/_base/connect", ... ], function(FeatureLayer, RelationshipQuery, connect, ... ) { var featureLayer = new FeatureLayer( ... ); var relatedQuery = new RelationshipQuery(); relatedQuery.outFields = ["AGREE_WITH_INCIDENT"]; relatedQuery.relationshipId = 1; //query for the features related to the "clicked" feature connect.connect(featureLayer, "onClick", function(evt) { graphicAttributes = evt.graphic.attributes; relatedQuery.objectIds = [graphicAttributes.OBJECTID]; featureLayer.queryRelatedFeatures(relatedQuery,relatedRecords); } ... });
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.