AnsweredAssumed Answered

How to get SimpleRenderer.ToJson to include Symbol?

Question asked by kirkKuykendall on Mar 19, 2020
Latest reply on Mar 20, 2020 by PMaske-esristaff

With a featurelayer created from this:

https://services2.arcgis.com/ZQgQTuoyBrtmoGdP/arcgis/rest/services/Redlands_Restaurants/FeatureServer/0 

 

featureLayer.Renderer.ToJson() returns json that lacks the symbol:

{
"symbol": {},
"type": "simple"
}

But ((SimpleRenderer)featureLayer.Renderer).Symbol.ToJson() returns this:

{
  "symbol": {
    "angleAlignment": "Display",
    "symbolLayers": [
      {
        "anchorPoint": {
          "x": 0,
          "y": 0
        },
        "anchorPointUnits": "Relative",
        "billboardMode3D": "FaceNearPlane",
        "dominantSizeAxis3D": "Z",
        "enable": true,
        "frame": {
          "xmax": 2,
          "xmin": -2,
          "ymax": 2,
          "ymin": -2
        },
        "markerGraphics": [
          {
            "geometry": {
              "rings": [
                [
                  [
                    0,
                    2
                  ],
                  [
                    0.35,
                    1.97
                  ],
                  [
                    0.68,
                    1.88
                  ],
                  [
                    1,
                    1.73
                  ],
                  [
                    1.29,
                    1.53
                  ],
                  [
                    1.53,
                    1.29
                  ],
                  [
                    1.73,
                    1
                  ],
                  [
                    1.88,
                    0.68
                  ],
                  [
                    1.97,
                    0.35
                  ],
                  [
                    2,
                    0
                  ],
                  [
                    1.97,
                    -0.35
                  ],
                  [
                    1.88,
                    -0.68
                  ],
                  [
                    1.73,
                    -1
                  ],
                  [
                    1.53,
                    -1.29
                  ],
                  [
                    1.29,
                    -1.53
                  ],
                  [
                    1,
                    -1.73
                  ],
                  [
                    0.68,
                    -1.88
                  ],
                  [
                    0.35,
                    -1.97
                  ],
                  [
                    0,
                    -2
                  ],
                  [
                    -0.35,
                    -1.97
                  ],
                  [
                    -0.68,
                    -1.88
                  ],
                  [
                    -1,
                    -1.73
                  ],
                  [
                    -1.29,
                    -1.53
                  ],
                  [
                    -1.53,
                    -1.29
                  ],
                  [
                    -1.73,
                    -1
                  ],
                  [
                    -1.88,
                    -0.68
                  ],
                  [
                    -1.97,
                    -0.35
                  ],
                  [
                    -2,
                    0
                  ],
                  [
                    -1.97,
                    0.35
                  ],
                  [
                    -1.88,
                    0.68
                  ],
                  [
                    -1.73,
                    1
                  ],
                  [
                    -1.53,
                    1.29
                  ],
                  [
                    -1.29,
                    1.53
                  ],
                  [
                    -1,
                    1.73
                  ],
                  [
                    -0.68,
                    1.88
                  ],
                  [
                    -0.35,
                    1.97
                  ],
                  [
                    0,
                    2
                  ]
                ]
              ]
            },
            "symbol": {
              "symbolLayers": [
                {
                  "capStyle": "Round",
                  "color": [
                    0,
                    0,
                    0,
                    255
                  ],
                  "enable": true,
                  "joinStyle": "Round",
                  "lineStyle3D": "Strip",
                  "miterLimit": 10,
                  "type": "CIMSolidStroke",
                  "width": 0.7
                },
                {
                  "color": [
                    0,
                    0,
                    0,
                    255
                  ],
                  "enable": true,
                  "type": "CIMSolidFill"
                }
              ],
              "type": "CIMPolygonSymbol"
            },
            "type": "CIMMarkerGraphic"
          }
        ],
        "respectFrame": true,
        "size": 4,
        "type": "CIMVectorMarker"
      }
    ],
    "type": "CIMPointSymbol"
  },
  "type": "CIMSymbolReference"
}

Outcomes