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/
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.
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); });
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!!
var selectQuery = new esri.tasks.Query(); operationalLayer.on("click", function(e){ dojo.byId("details").innerHTML = ""; selectQuery.objectIds = [e.graphic.attributes.ID]; operationalLayer.selectFeatures(selectQuery); });
map.addeLayers([ndOperationalLayer]);
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.