Select to view content in your preferred language

UniqueValueRenderer SimpleMakerSymbol not working anymore

2241
10
12-01-2016 08:34 AM
LouisDeSantis
New Contributor II

UniqueValueRenderer and ArcGISDynamicMapServiceLayer and SimpleMarkerSymbol

no longer seem to work properly together.

I'm using ARCGIS Server 10.2 and ARCGIS Javasript API 3.18.


I use the unique value render with SImpleFillSymbols and it works perfectly and at one point our application did have UniqueRendering working with Symbols.

Not sure if this was broken at some point within 3.1x or if its simply not possibly any more.

When I DO choose to use UniqueValueRender with SimpleMarkerSymbol the features render as gray filled symbols.
Picture attached.


Any insights would be enormously helpful.

**I know that the general code I have developed does in fact work and render using SimpleFillSymbols on the same field that won't generate a render with SimpleMarkerSymbols**


Thanks.


0 Kudos
10 Replies
thejuskambi
Regular Contributor

Please share the code, how you are creating the UniqueValueRenderer. It would help us to understand what might be the issue.

LouisDeSantis
New Contributor II

I can't share all the code, its just too much to show but I will share snippets.

Just as a note, The exact same code works for UniqueValue Rendering with SimpleFillSymbols but does not work with SimpleMarkerSymbols.

I know the values exist and can render because it works with the SimpleFillSymbol but not SimpleMarkerSymbol


So I think it might be more handy to show the JSON for the created renderer.


{
"_cache":{

},
"values":[
"E",
"A-",
"A+",
"A",
"B-",
"C",
" ",
"AA",
"B+",
"D+",
"D",
"AA+",
"C-",
"C+",
"D-",
"B"
],
"_symbols":{
"E":{
"value":"E",
"symbol":{
"color":{
"r":207,
"g":143,
"b":130,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"E",
"description":"The Sunflower State"
},
"A-":{
"value":"A-",
"symbol":{
"color":{
"r":238,
"g":213,
"b":110,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"A-",
"description":"The Sunflower State"
},
"A+":{
"value":"A+",
"symbol":{
"color":{
"r":166,
"g":150,
"b":110,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"A+",
"description":"The Sunflower State"
},
"A":{
"value":"A",
"symbol":{
"color":{
"r":24,
"g":8,
"b":27,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"A",
"description":"The Sunflower State"
},
"B-":{
"value":"B-",
"symbol":{
"color":{
"r":150,
"g":43,
"b":164,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"B-",
"description":"The Sunflower State"
},
"C":{
"value":"C",
"symbol":{
"color":{
"r":242,
"g":83,
"b":95,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"C",
"description":"The Sunflower State"
},
" ":{
"value":" ",
"symbol":{
"color":{
"r":239,
"g":79,
"b":24,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"NO VALUE",
"description":"The Sunflower State"
},
"AA":{
"value":"AA",
"symbol":{
"color":{
"r":164,
"g":2,
"b":45,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"AA",
"description":"The Sunflower State"
},
"B+":{
"value":"B+",
"symbol":{
"color":{
"r":3,
"g":207,
"b":189,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"B+",
"description":"The Sunflower State"
},
"D+":{
"value":"D+",
"symbol":{
"color":{
"r":195,
"g":127,
"b":183,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"D+",
"description":"The Sunflower State"
},
"D":{
"value":"D",
"symbol":{
"color":{
"r":181,
"g":35,
"b":255,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"D",
"description":"The Sunflower State"
},
"AA+":{
"value":"AA+",
"symbol":{
"color":{
"r":157,
"g":75,
"b":1,
"a":1
},

{
"_cache":{

},
"values":[
"E",
"A-",
"A+",
"A",
"B-",
"C",
" ",
"AA",
"B+",
"D+",
"D",
"AA+",
"C-",
"C+",
"D-",
"B"
],
"_symbols":{
"E":{
"value":"E",
"symbol":{
"color":{
"r":207,
"g":143,
"b":130,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"E",

},
"A-":{
"value":"A-",
"symbol":{
"color":{
"r":238,
"g":213,
"b":110,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"A-",

},
"A+":{
"value":"A+",
"symbol":{
"color":{
"r":166,
"g":150,
"b":110,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"A+",

},
"A":{
"value":"A",
"symbol":{
"color":{
"r":24,
"g":8,
"b":27,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"A",

},
"B-":{
"value":"B-",
"symbol":{
"color":{
"r":150,
"g":43,
"b":164,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"B-",

},
"C":{
"value":"C",
"symbol":{
"color":{
"r":242,
"g":83,
"b":95,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"C",

},
" ":{
"value":" ",
"symbol":{
"color":{
"r":239,
"g":79,
"b":24,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"NO VALUE",

},
"AA":{
"value":"AA",
"symbol":{
"color":{
"r":164,
"g":2,
"b":45,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"AA",

},
"B+":{
"value":"B+",
"symbol":{
"color":{
"r":3,
"g":207,
"b":189,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"B+",

},
"D+":{
"value":"D+",
"symbol":{
"color":{
"r":195,
"g":127,
"b":183,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"D+",

},
"D":{
"value":"D",
"symbol":{
"color":{
"r":181,
"g":35,
"b":255,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"D",

},
"AA+":{
"value":"AA+",
"symbol":{
"color":{
"r":157,
"g":75,
"b":1,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"AA+",

},
"C-":{
"value":"C-",
"symbol":{
"color":{
"r":119,
"g":34,
"b":245,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"C-",

},
"C+":{
"value":"C+",
"symbol":{
"color":{
"r":122,
"g":178,
"b":109,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"C+",

},
"D-":{
"value":"D-",
"symbol":{
"color":{
"r":2,
"g":223,
"b":60,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"…" type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"A-",

},
{
"value":"A+",
"symbol":{
"color":{
"r":166,
"g":150,
"b":110,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"A+",

},
{
"value":"A",
"symbol":{
"color":{
"r":24,
"g":8,
"b":27,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"A",

},
{
"value":"B-",
"symbol":{
"color":{
"r":150,
"g":43,
"b":164,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"B-",

},
{
"value":"C",
"symbol":{
"color":{
"r":242,
"g":83,
"b":95,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"C",

},
{
"value":" ",
"symbol":{
"color":{
"r":239,
"g":79,
"b":24,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"NO VALUE",

},
{
"value":"AA",
"symbol":{
"color":{
"r":164,
"g":2,
"b":45,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"AA",

},
{
"value":"B+",
"symbol":{
"color":{
"r":3,
"g":207,
"b":189,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"B+",

},
{
"value":"D+",
"symbol":{
"color":{
"r":195,
"g":127,
"b":183,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"D+",

},
{
"value":"D",
"symbol":{
"color":{
"r":181,
"g":35,
"b":255,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"D",

},
{
"value":"AA+",
"symbol":{
"color":{
"r":157,
"g":75,
"b":1,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"AA+",

},
{
"value":"C-",
"symbol":{
"color":{
"r":119,
"g":34,
"b":245,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"C-",

},
{
"value":"C+",
"symbol":{
"color":{
"r":122,
"g":178,
"b":109,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"C+",

},
{
"value":"D-",
"symbol":{
"color":{
"r":2,
"g":223,
"b":60,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"D-",

},
{
"value":"B",
"symbol":{
"color":{
"r":125,
"g":242,
"b":132,
"a":1
},
"size":13.333333333333332,
"type":"simplemarkersymbol",
"style":"square",
"originalSize":10,
"outline":{
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"width":4,
"type":"simplelinesymbol",
"style":"solid"
},
"xoffset":0,
"yoffset":0
},
"label":"B",

}
],
"defaultSymbol":{
"style":"circle",
"color":{
"r":255,
"g":0,
"b":0,
"a":0.25
},
"size":"4.2",
"outline":{
"width":1.3333333333333333,
"color":{
"r":0,
"g":0,
"b":0,
"a":1
},
"style":"solid"
}
},
"attributeField":"Quality",
"_multiple":false
}

0 Kudos
LouisDeSantis
New Contributor II

I would imagine, there is no real fundmental difference between a unique render with SimpleFill vs Simple Marker.    

0 Kudos
thejuskambi
Regular Contributor

What is the Geometry type of the Layer in question?

LouisDeSantis
New Contributor II

esriGeometryPolygon is the feature type on the layer type of ArcGISDynamicMapServiceLayer

   

0 Kudos
thejuskambi
Regular Contributor

If the Geometry type is Polygon, you cannot apply SimpleMarkerSymbol to it as they are meant for Point Type of Geometry.

LouisDeSantis
New Contributor II

But I can use Symbols, when I do a ClassBreaksRenderer on the same layer, Same geometry.

0 Kudos
thejuskambi
Regular Contributor

Looks like I was wrong, The UniqueValueRenderer and ClassBreakRenderer both can symbolize Polygon with Point symbols, and it is working fine in sandbox. My guess is, some other code it updating the symbols back again or the polygon layer is on top of the point layer.

0 Kudos
thejuskambi
Regular Contributor

From what I can see you have just shared the json that you use to create the Renderer. Is that correct?

In that case, type and style does not have valid values. Here is a sample json format for SimpleMarkerSymbol.

{
    "color": [
        255,
        255,
        255,
        64
    ],
    "size": 12,
    "angle": 0,
    "xoffset": 0,
    "yoffset": 0,
    "type": "esriSMS",
    "style": "esriSMSCircle",
    "outline": {
        "color": [
            255,
            255,
            0,
            255
        ],
        "width": 1,
        "type": "esriSLS",
        "style": "esriSLSSolid"
    }
}

Here is a playground provided by ESRI where you can generate any symbols.