AnsweredAssumed Answered

On Click -> Layer event works with Hosted Feature Service, but not a AGS MapService?

Question asked by acrateau on Jan 6, 2017
Latest reply on Jan 11, 2017 by acrateau

This code works with a hosted feature service:


// Define hook for Parcel Layer
var parcelLayer = map.getLayer(this._parcelLayerID);

// Define the Selected Parcels Symbol
var highlightSymbol = this._getHighlightSymbol();

// Define OnClick event for clicking on a Parcel
this.onParcelClick = on.pausable(parcelLayer, 'click', lang.hitch(function (e) {
var taxlotString = esriLang.substitute(e.graphic.attributes, "${TAXLOT}");
var ownerString = esriLang.substitute(e.graphic.attributes, "${OWNERNAME}");
if (ownerString.length > 24) ownerString = ownerString.substring(0, 24) + "...";
var attr = { "Taxlot": taxlotString };
var highlightGraphic = new Graphic(e.graphic.geometry, highlightSymbol, attr);;


However when I use a map service hosted on our own AGS, it does not.  I can get a reference to the parcel layer using LayerInfos, but when I click on the map...nothing.   Any ideas?