I am using printTask to print out my map but the end result is very weird.
This is what the map should look like
and this is what it actually looks like. It's like it's missing a layer or something
function printResult(evt) {
map = new Map("map", {
basemap: new Basemap({
layers: [new BasemapLayer({
url: 'http://10.0.0.10:6080/arcgis/rest/services/DUP_podlogi_Izvodi/MapServer'
})]
}),
extent: new Extent({
'xmin': 7530850.8094923375,
'ymin': 4647910.133863028,
'xmax': 7536270.404088697,
'ymax': 4655172.52276435,
'spatialReference': {
'wkid': 6316
}
}),
sliderStyle: 'small',
zoom: 5,
});
var secondLayer = new ArcGISDynamicMapServiceLayer("http://10.0.0.10:6080/arcgis/rest/services/Karpos_Vector_Izvodi/MapServer", {
"opacity": 1
});
map.addLayer(secondLayer);
map.on("load", selectRoute);
// code shortened for brevity
printTaskLegend = new PrintTask('http://10.0.0.10/arcgis/rest/services/Print_GISKarpos_Sync/GPServer/Export%20Web%20Map');
printPars.map = map;
var template = new PrintTemplate();
template.format = 'JPG';
template.layout = 'Print_legend_included';
template.preserveScale = true;
printPars.template = template;
printTaskLegend.execute(printPars).then(printImageLegend);
}
This is my code.
Couple questions:
What version of the ArcGIS API for JavaScript are you using?
What is the ArcGIS Server version of the print service?
What did you use to publish the print service (ArcGIS Pro or ArcMap)?