Select to view content in your preferred language

Dynamic CIM Symbol in FeatureLayer

398
1
04-28-2023 01:14 AM
KeremDenizmen
New Contributor

I want to show different types of CimSymbol (images) in a FeatureLayer ( because i want to cluster them.)  based on the source data i receive from my back-end. How can i achieve this ?

const layer = new FeatureLayer({
            renderer: {
              type: "simple",
              symbol: {
                type: "cim",
                data: {} // dynamic data based on data in source
              },
            },
            title: "Orders",
            objectIdField: "ObjectID",
            source: [] // dynamic data with orders with different types of location
          });




0 Kudos
1 Reply
AnneFitz
Esri Regular Contributor

Hi @KeremDenizmen - have you considered using UniqueValueRenderer? This will allow you to symbolize your features based on categorical attributes. You could use a different CIMSymbol for each category, for example. 

It also sounds like you might want to create a FeatureLayer from client-side features - I'd recommend checking out the documentation on creating a FeatureLayer here (specifically look at the section called "Add an array of client-side features"): https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#creating...

 

0 Kudos