Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have constructed featureCollection from Json and 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 and what is the possible solution to this problem.? Thank you in advance. Thank you in advance.

share|improve this question
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
add comment

1 Answer

up vote 1 down vote accepted
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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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