[GIS] Overlaping graphics not visible in featureLayer

arcgis-javascript-apifeature-datasetfeature-layeroverlapping-features

I have constructed a featureCollection from JSON and the feature collection has 44 features.

I have given this feature collection as input to the Featurelayer which is showing only 32 graphics objects of the featurecollection.

I found out that overlapping features are not rendered at all in the feature layer.

How could I resolve this issue?

Best Answer

var featureCollection = {
                                layerDefinition: {
                                    "geometryType": "esriGeometryPolygon",
                                    "fields": [
                                   {
                                       "name": "ID",
                                       "type": "esriFieldTypeOID",  //$Expects to be unique
                                       "alias": "ID"
                                   },
                                   {
                                       "name": "miles",
                                       "type": "esriFieldTypeString",
                                       "alias": "miles"
                                   }
                                ]
                                },
                                featureSet: fs
                            };

                            var FeatureLayer = new esri.layers.FeatureLayer(featureCollection, {
                                mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
                                infoTemplate: template,
                                outFields: ['ID', 'miles']
                            });

when we give feature collection as input to the Featurelayer it was treating id as field with unique value and and expects to be of type esriFieldTypeOID when it may be of any other type.The feature collection shows all duplicates value also but when we give feature collection as input to Featurelayer it takes only one features with duplicate value and drops other features.

Related Question