Print map using layers from multiple map services

1862
10
10-14-2016 09:38 AM
ThomasPuthusserry
New Contributor III

Is it possible to print map layers from multiple map services using ArcGIS Java Script API? I have situation where more than 2 map services needs to be included in a single JavaScript application and layers from any of these services (as selected by the user) needs to be exported as a map using the Export Webmap service (using a defined map template published from my server). However, when using the Export WebMap print service, there is only option to pass one map service as a parameter. Is there any way around?

0 Kudos
10 Replies
RobertScheitlin__GISP
MVP Emeritus

Thomas,

   Maybe I am missing something, but yes the printtask supports printing multiple map services in the map. When you use the print task you specify the url to the print service not the url to a particular webmap or map service.

0 Kudos
BrettCummings
New Contributor II

I have found that if the 'Export Map' operation is not enabled on remote services that I can not print that service's data.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Makes sense

0 Kudos
ThomasPuthusserry
New Contributor III

Hi all

I can frame the situation a bit more clearly:

I can print layers from a SINGLE map service by passing that as a parameter to the ExportWebmap task. If I want to print layers from TWO or MORE map services, is it possible to pass these as parameters under url option below?

"operationalLayers" : [

{

"id" : "

}

]

Thanks Thomas

0 Kudos
BrettCummings
New Contributor II

Are you adding the secondary services dynamically or do they already exist in the same map application? 

0 Kudos
ThomasPuthusserry
New Contributor III

Three services from same ArcGIS server are being used in the map application. The user might turn on any layer(s) from any of the three map services. Nothing is added dynamically

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Thomas,

  What really has me confused is why you are asking about such low level things like ExportWebmap task and the actual json provided to it. If you use PrintTask and provide the printtask the url to your print service (which is the consumer of the ExportWebmap GP) then you just provide the map object and it does all the work for you.

0 Kudos
ThomasPuthusserry
New Contributor III

Rob,

Thanks for this. The reason is, the developer I am working with says there is no option to pass more than one URL (of the map service), and hence my question.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Thomas,

   You need to ask the developer if they are using the PrintTask then.

0 Kudos