vendredi 30 janvier 2015

Unable to print using ArcGIS javascript under IE9


I am trying to print a web map using ArcGIS javascript 3.10 under IE9 but got RequestError: Unable to load /proxy?http://myserver:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task/execute status: 404. However, the same map printed without any problem for IE11, Chorme and Firefox. This seems to me is because of proxy error but only specific to IE9.


The codes as follow:



esriConfig.defaults.io.proxyUrl = "/proxy";
function createPrintDijit() {
var layoutTemplate, templateNames, mapOnlyIndex, templates;
var path = document.getElementById("path").value;
var printTitle = document.getElementById("printTitle").value;
var legendLayers = [];
var legendLayer = new LegendLayer();
legendLayer.layerId = "countryParks"
legendLayers.push(legendLayer);
legendLayer = new LegendLayer();
legendLayer.layerId = "amphibianGridMap"
legendLayers.push(legendLayer);
var layouts = [{
name: "Letter ANSI A Landscape",
label: "Landscape (PDF)",
format: "pdf",
options: {
legendLayers: legendLayers, // empty array means no legend
scalebarUnit: "Kilometers",
titleText: printTitle
}
}];
var templates = arrayUtils.map(layouts, function (lo) {
var t = new PrintTemplate();
t.layout = lo.name;
t.label = lo.label;
t.format = lo.format;
t.layoutOptions = lo.options;
return t;
});
app.printer = new Print({
map: app.map,
templates: templates,
url: "http://myserver/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"
}, dom.byId("printButton"));
app.printer.startup();
}




Aucun commentaire:

Enregistrer un commentaire