Select to view content in your preferred language

Print

3693
1
09-25-2014 10:07 PM
FrankyFergus
New Contributor

Hello,

 

I am trying to print a map using a print service. I have followed the example on the ArcGIS site namely:

Print templates with esri.request | ArcGIS API for JavaScript

However I can't get it to work using a local feature layer.

 

Can someone please give some advice.

 

Thanks

 

Frank

Tags (2)
0 Kudos
1 Reply
FrankyFergus
New Contributor

This is what I have done so far:

parser.parse();

  app
.printUrl = "http://aphrodite/arcgis/rest/services/Layout/WSC_LAYOUT1/GPServer/Export%20Web%20Map";

  esri
.config.defaults.io.corsEnabledServers.push("local_server");

  app
.map = new Map("map");

  
//Base map
  
var basemap = new ArcGISDynamicMapServiceLayer("http://local_server/arcgis/rest/services/NAME/Basemap/MapServer/");
  basemap
.setVisibleLayers([0, 1, 2, 3, 4, 5, 6, 7]);

  app
.map.addLayer(basemap);

  
// add graphics for feature
  
var url = "http://local_server/arcgis/rest/services/NAME/NAME/FeatureServer/n";
  
var pipeFeatureLayer = new FeatureLayer(url, {
  
"mode": FeatureLayer.MODE_SNAPSHOT
  
});
  app
.map.addLayer(pipeFeatureLayer);

0 Kudos