Select to view content in your preferred language

GenerateRendererTask creating always symbols with outline

1022
1
07-10-2013 07:32 AM
MatthesRieke
Deactivated User
Hi all,

I am desperately trying to create a Renderer on my dynamic MapServer without any sort of outline for my symbols. Here is the code I am using for the request (in analogy to this sample😞

function createRenderer(c1, c2) {
        var classDef = new esri.tasks.ClassBreaksDefinition();
        classDef.classificationField = dijit.byId("fieldNames").get("value") || "speed";
        classDef.classificationMethod = "natural-breaks";
        classDef.breakCount = 7;

        var colorRamp = new esri.tasks.AlgorithmicColorRamp();
        colorRamp.fromColor = new dojo.colorFromHex(c1);
        colorRamp.toColor = new dojo.colorFromHex(c2);
        colorRamp.algorithm = "hsv";
        
        classDef.baseSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SOLID, 4,
   null,
   new dojo.Color([0,255,0,0.25]));
        classDef.colorRamp = colorRamp;

        var params = new esri.tasks.GenerateRendererParameters();
        params.classificationDefinition = classDef;
        var generateRenderer = new esri.tasks.GenerateRendererTask(app.dataUrl);
        generateRenderer.execute(params, applyRenderer, errorHandler);
      }


the outgoing generateRenderer REST request is not reflecting my symbol style. In fact it defines an outline and a size of 12 (?!) for my symbols in every case. Am I missing something? I have followed the SimpleMarkerSymbol API.

The classDefinition parameter transports this JSON:
{
   "baseSymbol":{
      "color":[
         255,
         255,
         255,
         64
      ],
      "size":12,
      "angle":0,
      "xoffset":0,
      "yoffset":0,
      "type":"esriSMS",
      "style":"esriSMSCircle",
      "outline":{
         "color":[
            0,
            0,
            0,
            255
         ],
         "width":1,
         "type":"esriSLS",
         "style":"esriSLSSolid"
      }
   },
   "colorRamp":{
      "type":"algorithmic",
      "algorithm":"esriHSVAlgorithm",
      "fromColor":[
         255,
         255,
         204,
         255
      ],
      "toColor":[
         0,
         104,
         55,
         255
      ]
   },
   "type":"classBreaksDef",
   "classificationField":"speed",
   "classificationMethod":"esriClassifyNaturalBreaks",
   "breakCount":7
}


Thanks for any help!
Matthes
0 Kudos
1 Reply
MatthesRieke
Deactivated User
any hint very much appreciated! I just checked if the server (AGS 10.1) might be the issue. But it responds with a very nicely rendered result when I invoke the /MapServer/export manually. The POST paramter "dynamicLayers" defines the rendereing symbols without outline and with my preferred size.

Obviously I am using the API incorrect or this might be an issue. But I somehow have a feeling it is me 🙂
0 Kudos