How use an image as Feature style?

539
2
01-10-2018 11:00 AM
JuanOropeza
New Contributor III

In arcgis online I can change the symbol for all the features in the layer to be a png image. 

But I want every feature be a different symbol. Most like it the picture in user profile. So I will have the image url from the user information.

I see In this example Symbols and renderers—ArcGIS Runtime SDK for .NET | ArcGIS for Developers  you can create a pictureMarkerSym then use it to create a Graphic and add it to an Overlays.

    var graphic = new Graphic(location, pictureMarkerSym);

    MyMapView.GraphicsOverlays[0].Graphics.Add(graphic);

But right now I only have a FeatureLayer?

var attributes = new Dictionary<string, object>
{
    { "worker_id", 3 },
    { "x_lat", -66.88 },
    { "y_long", 10.55 },
    { "time", "2017-12-24 18:00:00" }
};

MapPoint structureLocation = new MapPoint(-66.88, 10.55);

// create a new feature in the damage table, pass in the attributes and geometry
Feature newFeature = tblWorkers.CreateFeature(attributes, structureLocation);

Do I need create an extra Overlay Layer to show the symbol of each feature? Or I can change the Feature symbol as in ArcGis Online?

0 Kudos
2 Replies
dotMorten_esri
Esri Notable Contributor

Only FeatureCollectionTables supports per-feature symbology:

     myTable.SetSymbolOverride(feature, symbol);

Just be aware that creating individual picture marker symbols for each feature could use up a significant amount of texture memory on your GPU and exhaust its resources, so don't do this for 1000s of features.

0 Kudos
JuanOropeza
New Contributor III

Ok, that layer have very few feature. I will check it out. Please if you can take a look again to my previous question. Still have problem with adding the features. https://community.esri.com/message/740729-re-how-add-style-to-the-new-feature-on-a-servicefeaturetab...  Still not sure if is a problem with style or georeferencing the new feature.

0 Kudos