How to change rest service URL in PrintTask's json

112
1
07-31-2019 12:12 AM
MamoonRasheed
New Contributor

Due to a requirement, i want to change graphicsLayer (arcgis/rest/services) service URL from Live IP to Local IP. And than want to use in "printTask.execute".

To achieve this task i develop following code;

Step 1: alert(map.getLayer(map.graphicsLayerIds).url)  //Display LiveIP

Step2:

map.getLayer(map.graphicsLayerIds).url = http://<ServerLocalIP:port>/arcgis/rest/services/<serviceName>/MapServer/0          (Map object updated as per requirement)

Step3:

var params = new PrintParameters();

params.map = map;

Step4:

printTask.execute(params, function (evt) {

   // 

}

I checked in fiddler after send request ("printTask.execute"), the created json has LiveIP in Rest service URL instead of LocalIP.

Thanking you in advance.

0 Kudos
1 Reply
Noah-Sager
Esri Regular Contributor