Edit Symbology of Feature

170
7
11-30-2017 11:23 AM
AndyWright
Occasional Contributor

I have a scenario where I am using a syncable feature service to create an offline geodatabase and add the layers from that geodatabase to the map.  One of the layers is full of points whose symbology is defined by the source MXD used to create the feature service.  I've got a unique value renderer going there.

So my tool can then add a specific type of point feature to that layer and it will take on the appropriate symbology based on its assigned renderer.  This is all good and works well.  What I'd like to be able to do now is select one of the features on the map and modify some properties about its symbology (i.e size and color).  I only want the symbology for that particular feature to change, not every other feature in the layer of the same type.

The symbology is pretty complex - character marker symbols with multiple layers in the MXD.  I can actually add a graphic with the feature's symbology to the map, but when I check the type of that symbology it is Unknown so I'm not able to manipulate it. 

So is there any way something like this can be done or are we locked into the symbology properties as defined in the renderer?  I'm guessing it's the latter, but I'm also wondering if I'm missing a viable workaround here.  

Thanks in advance for your help ...

0 Kudos
7 Replies
dotMorten_esri
Esri Frequent Contributor

Only the FeatureCollectionTable supports per-feature symbology. The tables in the offline geodatabase only supports symbology specified with the renderer.

Alternatively you can turn the feature off, and render a Graphic in it's place with whatever symbology you want - just know that won't persist in the table.

0 Kudos
AndyWright
Occasional Contributor

Thanks Morten.  I did exactly what you described and I was able to add a new graphic to the map with the feature symbology.  The problem at that point was the symbology type was Unknown so I was unable to manipulate it.  I think this is because the symbology coming from the feature service is not supported in Runtime.  I've got character marker symbols with multiple layers in the MXD.

0 Kudos
dotMorten_esri
Esri Frequent Contributor

> The problem at that point was the symbology type was Unknown so I was unable to manipulate it

Yes you are probably getting the advanced CIM symbology which there was no API support for in 100.1, but is fully supported for rendering. 100.2 will return proper CIM symbology types for you to modify, although all the properties didn't make it for the first round (there'll be more properties coming in the future).

Alternatively you can convert the symbology to json (.ToJson()) then modify the json, and load the symbology back in from JSON. It's obviously a little more work, but will give you the full power today (note though that the CIM JSON is a tiny bit complicated but shouldn't be too hard to reverse engineer).

0 Kudos
AndyWright
Occasional Contributor

Interesting.  Ok, I'll take a look at the JSON stuff.  Thanks Morten ...

0 Kudos
AndyWright
Occasional Contributor

JSON is empty for these bad boys ...

0 Kudos
dotMorten_esri
Esri Frequent Contributor

Oh my bad! Forgot 100.1 doesn't expose the json. That'll be fixed in 100.2 (it's really close), but will also provide you with APIs to modify a big part of the CIM symbology.

0 Kudos
dotMorten_esri
Esri Frequent Contributor

100.2 is out now. Please try again

0 Kudos