Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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
Glad you got it figured out. You should post that as answer and then mark your post as the answer to this question.… – Derek Swingley Aug 1 '12 at 16:31
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

Your Answer


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.