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.
This looks like a duplicate of https://community.esri.com/thread/237767-how-to-change-rest-service-url-in-printtasks-json