AnsweredAssumed Answered

How to know when a layer is actually done being applied?

Question asked by David.Kucharski@23 on Jan 21, 2020
Latest reply on Jan 22, 2020 by David.Kucharski@23

I have the following code that shows a MapImageLayer. After the last line is called, = "default"; there is a lag time of 20 seconds before the layer is actually visible on the map. 


Since the cursor is set back to default, the user is thinking the process is over and the layer should be there. I would like to set the cursor back to default when the layer is actually shown on the map. How do I get that?


function OnAppliedMarketsSuccess(response, userContext, methodName) {
   var geographies = response.toString();

   var marketLayer = appliedMarketLayer.findSublayerById(0);
   marketLayer.definitionExpression = "ID_ in (" + geographies + ")";
   marketLayer.visible = true; = "default";