Feature Layer from JSON

1054
1
Jump to solution
09-04-2020 06:33 AM
Vakhtang_Zubiashvili
Occasional Contributor III

Hi Guys,

i have some JSON data and wantto display it on map, but i cant.

what i do wrong?

var flayer = new FeatureLayer ({
    objectIdFieldName: "OBJECTID",
     globalIdFieldName: "",
     geometryType: "point",
    
 fields: [
  {
   name: "OBJECTID",
   alias: "OBJECTID",
   type: "oid"
  },
  {
   name: "Wis_kam_ID",
   alias: "Wis_kameris_ID",
   type: "string",
   length: 12
  },
  {
   name: "nomeri_planSetze",
   alias: "nomeri_planSetze",
   type: "string",
   length: 50
  }],
  features: [{
    geometry: {
      x: 477262.23610000033,
      y: 4637311.2296999991
    }
  }],
  attributes: {
    OBJECTID: 1,
    Wis_kam_ID: "WA-AR-1",
    nomeri_planSetze: null,
  }
    })
    map.add(flayer)
0 Kudos
1 Solution

Accepted Solutions
JoshuaBixby
MVP Esteemed Contributor

Include a spatial reference: Geometry objects—Common Data Types | ArcGIS for Developers 

Point

A point contains x and y fields along with a spatialReference field. A point can also contain m and z fields. A point is empty when its x field is present and has the value null or the string "NaN". An empty point has no location in space.

View solution in original post

1 Reply
JoshuaBixby
MVP Esteemed Contributor

Include a spatial reference: Geometry objects—Common Data Types | ArcGIS for Developers 

Point

A point contains x and y fields along with a spatialReference field. A point can also contain m and z fields. A point is empty when its x field is present and has the value null or the string "NaN". An empty point has no location in space.