AnsweredAssumed Answered

view.hitTest Response array empty when using AGO WebMap & MapServer

Question asked by JKirtzCOG on Jul 14, 2017
Latest reply on Jul 19, 2017 by JKirtzCOG

Hi all,

 

I'm currently trying to configure a map that 'highlights selected feature', as discussed in previous topics like this:

 

jsapi 4.0 popup: set highlight graphic on feature layer click? 

 

I'm attempting to use a AGO WebMap with a MapServer. I can get the highlight to work when I add in an individual layer from the MapServer, URL similar to below:

 

"...arcgis/rest/services/xxx/xxx/MapServer/0"

 

This works just fine. However, if I attempt to add in the entire map server, URL similar to below:

 

"...arcgis/rest/services/xxx/xxx/MapServer"

 

The response object returned is empty so the highlight doesn't work.

 

Is there a way to get this to work without having to add every single layer from the MapService in individually? Some of our larger MapServers have dozens and dozens of layers, many of them grouped together, and I'd rather not have to add each one in individually if I don't have to. 

 

Here is a paste of the code:

 

Code Paste Here 

 

Thanks for the info!

Outcomes