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?

  • 1
    Can you post your .json file somewhere (dropbox or some other free hosting service) so we can reproduce this? That would be the easiest and fastest way to see if this is a bug and/or if there is a workaround. – Derek Swingley Jul 31 '12 at 16:02
  • My bad "esriFieldTypeOID"(Treating as primary key) had duplicate values which where overlapping so even though I was able to see those records in feature collection it was not seen as geometry for the feature layer. I changes one one of the record then geometries where overlapping fine .Thanks for the comments @Derek Swingley. – Gunner Aug 1 '12 at 6:54
  • 1
    Glad you got it figured out. You should post that as answer and then mark your post as the answer to this question. meta.stackexchange.com/questions/12513/… – Derek Swingley Aug 1 '12 at 16:31
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.