AnsweredAssumed Answered

Missing value in AT

Question asked by lkoumis on Jan 10, 2020
Latest reply on Jan 10, 2020 by lkoumis

I have this very simple script to define a single pt, and create a feature layer. The featurelayer is displayed on the map and it is listed under the layer list. The infotemplate works too. But the AT just displays the field names but not the values. I know it is something very simple to fix, but I need a fresh pair of eyes to take a look to see what I am missing. THanks.

 

 

var layerDefinitionPts = {
          "geometryType": "esriGeometryPoint",
          "fields": [{
              name: "ObjectID",
              type: "esriFieldTypeOID"
            },
            {
              "name": "Field1",
              "type": "esriFieldTypeString"
            },
            {
              "name": "Field2",
              "type": "esriFieldTypeString"
            }
          ]
        }


        var featureCollection = {
          layerDefinition: layerDefinitionPts,
          featureSet: null
        };

        renderer = new SimpleRenderer(symbolPinstart);

        fLayer = new FeatureLayer(featureCollection, {
          id: "Test Layer",
          infoTemplate: infoTemplate
        })


        fLayer.setRenderer(renderer);




        var infoTemplate = new InfoTemplate();
        var point1 = new Point(-118.852, 34.350);
        thegraphic = new Graphic(point1);
        infoTemplate.setContent("My graphic")
        infoTemplate.setTitle("The Graphic")
        thegraphic.setInfoTemplate(infoTemplate)
        thegraphic.setAttributes({
          "ObjectID": 1,
          "field1": 999999,
          "field2": 'LA'
        })

        fLayer.add(thegraphic);
        this.map.addLayer(fLayer)
      },

Outcomes