map.addeLayers([ndOperationalLayer]);
var selectQuery = new esri.tasks.Query(); operationalLayer.on("click", function(e){ dojo.byId("details").innerHTML = ""; selectQuery.objectIds = [e.graphic.attributes.ID]; operationalLayer.selectFeatures(selectQuery); });
Money! That did the trick. So are saying that I should have used the layer's event listener instead of the map's to activate the AttributeInspector? Sounds like I need to watch some more of your video tutorials. Thanks Kelly!!
operationalLayer.on("click", function (e) { dojo.byId("details").innerHTML = ""; selectQuery.objectIds = [e.graphic.attributes.ID]; operationalLayer.selectFeatures(selectQuery); });
dojo.connect(map, "onClick", function (evt) { dojo.byId('details').innerHTML = ''; selectQuery.geometry = evt.mapPoint; operationalLayer.selectFeatures(selectQuery, esri.layers.FeatureLayer.SELECTION_NEW, null); });
Peter,If you have multiple layers you'll need to setup listeners for each layers click event. So you'll have to do the same for the geology layer as you do for your point layer.
Peter,The code snippet has the objectid field hard-coded into it. In the earlier snippet the objectid field was named ID. For the geology layer its objectid. Here's a fiddle showing the code working with the geology layer. http://jsfiddle.net/xBDKb/13/
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.