<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Print Widget (JSON based web map print) in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-json-based-web-map-print/m-p/496889#M46146</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I want to change map service url in Web map as JSON&amp;nbsp; before printing the web map? in other words , I don't want to print map object and want specify other map service url in JSON print parameter?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Jun 2016 07:00:06 GMT</pubDate>
    <dc:creator>AnjulPandey</dc:creator>
    <dc:date>2016-06-29T07:00:06Z</dc:date>
    <item>
      <title>Print Widget (JSON based web map print)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-json-based-web-map-print/m-p/496889#M46146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I want to change map service url in Web map as JSON&amp;nbsp; before printing the web map? in other words , I don't want to print map object and want specify other map service url in JSON print parameter?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2016 07:00:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-json-based-web-map-print/m-p/496889#M46146</guid>
      <dc:creator>AnjulPandey</dc:creator>
      <dc:date>2016-06-29T07:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Print Widget (JSON based web map print)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-json-based-web-map-print/m-p/496890#M46147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if I'm understanding your question 100%, but you can change the parameters of any GP task request before it is sent to the server with the setRequestPreCallback funciton: &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/esri.request-amd.html#esrirequest.setrequestprecallback" title="https://developers.arcgis.com/javascript/3/jsapi/esri.request-amd.html#esrirequest.setrequestprecallback" rel="nofollow noopener noreferrer" target="_blank"&gt;esri/request | API Reference | ArcGIS API for JavaScript 3.17&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To change the URL of an operational layer you can add this to your code where you are specifying the print task:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;esriRequest.setRequestPreCallback(function(ioArgs){
&amp;nbsp; // check if request is a web map print request
&amp;nbsp; if (ioArgs.content &amp;amp;&amp;amp; ioArgs.content.Web_Map_as_JSON){
&amp;nbsp;&amp;nbsp;&amp;nbsp; var webMapAsJson = ioArgs.content.Web_Map_as_JSON;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var webMapObj = JSON.parse(webMapAsJson);
&amp;nbsp;&amp;nbsp;&amp;nbsp; // iterate through operational layers on the map
&amp;nbsp;&amp;nbsp;&amp;nbsp; for (o in webMapObj.operationalLayers) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var wmo = webMapObj.operationalLayers&lt;O&gt;;&lt;/O&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (wmo.title = "MyLayer"){
&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wmo.url = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fnewurl" target="_blank"&gt;http://newurl&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }&amp;nbsp; 
&amp;nbsp; return ioArgs;
})&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:50:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-json-based-web-map-print/m-p/496890#M46147</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2021-12-11T21:50:36Z</dc:date>
    </item>
  </channel>
</rss>

