How do I retrieve a Feature for a given esri.Graphic in html5 viewer 2.6.1
I have subscribed to the "MapClickedEvent" which includes an esri.Graphic in the event parameters. How can I used this to retrieve the Geocortex Feature associated with that graphic?
0
-
This is the best way I've found for getting the clicked on feature (this is how the Map Tips dialog works): this.app.command("ShowMapTipResults").register(this, this.onShowMapTipResults); onShowMapTipResults(mapTipId: string): void { this.app.waitUntilViewInitialized("MapTipView").then(event => { var collection = this.app.featureSetManager.getCollectionById(mapTipId); var feature = null; if (collection.featureSets.length() > 0) { if (collection.featureSets.getAt(0).features.length() > 0) { feature = collection.featureSets.getAt(0).features.getAt(0); } } } }) }0
Please sign in to leave a comment.
Comments
1 comment