Wondering if anyone knows how to identify a dynamiclayer as in a joindatasource layer?
The REST API has a DynamicLayers text box in the identify request where I can successfully get results from a layer that does not exist on the mapservice. You can see it here:
I just can't find a way to do this in Javascript. Do I really need to build the request manually? It seems weird... dynamiclayers exist since 10.1, I suppose there is a way in the JS API?
Thanks.
Solved! Go to Solution.
Well this turned out to be very easy... but has some loopholes...
So, if you have already added your dynamiclayer to your map, this will be defined:
dynamicMapServiceLayer.dynamicLayerInfos
For the identify task to target your dynamiclayer, you have to put the above into the IdentifyParams:
identifyParams.dynamicLayerInfos = dynamicMapServiceLayer.dynamicLayerInfos;
The caveat: you cannot put anything in identifyParams.layerIds.
My understanding (for now) is that layerIds are for the original mapservice layers. If you need to identify dynamiclayers you added on the fly *and* layers that were already in the mapservice, you should create 2 separate identifyTask.
So I hope this helps someone else... sorry I don't have a complete sample... theoretically a sample can be made using a dynamicMapService from esri that supports dynamic symbology.
Well this turned out to be very easy... but has some loopholes...
So, if you have already added your dynamiclayer to your map, this will be defined:
dynamicMapServiceLayer.dynamicLayerInfos
For the identify task to target your dynamiclayer, you have to put the above into the IdentifyParams:
identifyParams.dynamicLayerInfos = dynamicMapServiceLayer.dynamicLayerInfos;
The caveat: you cannot put anything in identifyParams.layerIds.
My understanding (for now) is that layerIds are for the original mapservice layers. If you need to identify dynamiclayers you added on the fly *and* layers that were already in the mapservice, you should create 2 separate identifyTask.
So I hope this helps someone else... sorry I don't have a complete sample... theoretically a sample can be made using a dynamicMapService from esri that supports dynamic symbology.