Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Im having an issue trying to get the url of the map being printed with a dynamic layer. WIth just tiled services and basemap it prints just fine.

 // USED FOR PRINTING OF MAPS
    function print(map_div_id)
    {
        var printUrl = "http://prodgis.agriculture.purdue.edu:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task/execute";
    printTask = new esri.tasks.PrintTask(printUrl);

    var template = new esri.tasks.PrintTemplate();

    template.format = "JPG";
    template.layout = "MAP_ONLY";
    template.preserveScale = true;

    var params = new esri.tasks.PrintParameters();
    params.map = map[map_div_id];
    params.template = template;

    printTask.execute(params, printComplete);
}

My Error I get is

0: "Error executing tool.: Layer "prime_soil_map_graphics": Missing 'style' in symbol.↵Failed to execute (Export Web Map).↵Failed to execute (Export Web Map Task)."

Any ideas what is happening ?

Here is a JS fiddle to test with just press the print button !

http://jsfiddle.net/YMzfM/1/

share|improve this question
    
Did you applied any security to REST layer? –  Sunil May 8 '13 at 17:58
    
No I did not apply any security to the REST layer –  user1212047 May 8 '13 at 18:09
    
Are you using something custom for the symbology of layer prime_soil_map_graphics? –  Mintx May 8 '13 at 21:17
    
No , just regular stuff –  user1212047 May 8 '13 at 21:18

2 Answers 2

up vote 3 down vote accepted

The symbol for your polygon from your query task is not valid. While it still works within the API, the print task is less tolerant.

Change this:

// Executes after the query ahs been completed
dojo.connect(queryTask, "onComplete", function (results) {
    //QueryTask returns a featureSet.  Loop through features in the featureSet avd add them to the map.
    dojo.forEach(results.features, function (feature) {
        var graphic = feature;
        var symbol = new esri.symbol.SimpleFillSymbol(new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([102, 255, 230]), 3));
        graphic.setSymbol(symbol);
        map[map_div_id].graphics.add(graphic);
    });
});

To this:

// Executes after the query ahs been completed
dojo.connect(queryTask, "onComplete", function (results) {
    //QueryTask returns a featureSet.  Loop through features in the featureSet avd add them to the map.
    dojo.forEach(results.features, function (feature) {
        var graphic = feature;
        var symbol = new esri.symbol.SimpleFillSymbol(
          "solid",
          new esri.symbol.SimpleLineSymbol(
            esri.symbol.SimpleLineSymbol.STYLE_SOLID, 
            new dojo.Color([102, 255, 230]), 
            3
          ),
          null
        );
        graphic.setSymbol(symbol);
        map[map_div_id].graphics.add(graphic);
    });
});

Working JS fiddle: http://jsfiddle.net/FtWYs/

share|improve this answer

You modify

var printUrl = "http://prodgis.agriculture.purdue.edu:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task/execute";

to

var printUrl = "http://prodgis.agriculture.purdue.edu:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task";
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.