I have a simple picture marker symbol feature layer.
Requirement - When we turn ON cluster for that layer if single feature, then it should display layer original picture marker symbol and if more than 2 features, then it should display cluster symbol (simple marker symbol) with labels. When we turn OFF cluster, then layer will display as its initial state i.e. only picture marker symbols
Solved! Go to Solution.
You can use the layer' queryFeatureCount method to get the count of features in the service/layer. Then you apply Clustering or remove the clustering and apply the original renderer based on the count returned from the method.
Here is a simple test app showcases how this can be done. But please note that it is a contrived app: https://codepen.io/U_B_U/pen/yLPWEgZ?editors=1000
Thank you @UndralBatsukh for responding.
Requirement is when a cluster is ON and on the map some feature is single, some are not. When single feature on the map, then it shows layer original symbol, i.e. picture marker and club features shown as cluster simple circle with labels.
So at same time both picture and simple marker symbols will present on map for same layer.
Oh doh! Completely missed the point. 🙂 Sorry about that.
This is not possible currently. We do have plans to support this scenario. I will update you once we add support for this.
In my project we have simple renderer feature layers and a toggle button to turn ON/OFF cluster. When cluster is ON, I replaced layer simple renderer to class break renderer as shown in https://codepen.io/xiej/pen/oNpLyJY