Select to view content in your preferred language

print map with large custom features

2132
10
08-29-2016 02:09 AM
yanli
by
Emerging Contributor

I create  100 polygon features in map,then  i print the map with the features,But  I run the printTask , the server is collapse; I create 20 polygon the print the result is ok.  the  number for printTask is limit? 

I use the arcgis api for js 3.17!

function ShowByZhen(id) {
 var queryTask = new esri.tasks.QueryTask("http://192.168.20.1:6080/arcgis/rest/services/zhen/MapServer/0");
 var query = new esri.tasks.Query();
 query.returnGeometry = true;
 query.outFields = ["*"];
 query.where = "1=1";
 queryTask.execute(query, ShowByZhen_ShowResults);
 queryTask.on("error", queryTaskErrorHandler);

}

function ShowByZhen_ShowResults(results) {

// var symbol = new esri.symbol.SimpleFillSymbol().setColor(new esri.Color([205, 192, 197,0.5])).outline.setColor(new esri.Color([189, 0, 38, 0.5]));
 var symbol = new esri.symbol.SimpleFillSymbol().setColor(new esri.Color([205, 193, 197, 0.5]));
 var fss = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
 new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, new esri.Color([205, 192, 197]), 2),
 new esri.Color([255,255,0,0.25]));
 alert(results.features.length);
 var resultCount = results.features.length;
 for(var i=0;i<resultCount;i++)
 {
 var mFeature = results.features;
 var mFeatureAttribute = results.features.attributes;
 mFeatureAttribute["moneyfinish"] = 10000*i;
 
 if (i < 130) {
 mFeature.symbol = fss;
 map.graphics.add(mFeature);
 
 }
 }
}


function Print() {
 var printUrl="http://192.168.20.1:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"
 printTask = new esri.tasks.PrintTask(printUrl, { async: true });
 params = new esri.tasks.PrintParameters();
 params.map = map;


 //*****print
 var ptemplate = new esri.tasks.PrintTemplate();
 ptemplate.layout = "A3 Landscape";
 // ptemplate.layout = "MAP_ONLY";
 ptemplate.format = "jpg";
 ptemplate.layoutOptions = {
 legendlayers: [],
 scalebarUnit: "Meters",
 titleText: Titletxt
 }
 // use the extent of the webmap in the output PDF
 ptemplate.preserveScale = false;
 params.template = ptemplate;

// params.template = "A3 Landscape";
 printTask.execute(params, printComplete);


}
0 Kudos
10 Replies
PanagiotisPapadopoulos
Esri Regular Contributor

May you have to create a database view between Polygon Table and Attribute Table on database level .This spatial view can be used for publishing. 

0 Kudos