AnsweredAssumed Answered

Query issue returning undefined geometry

Question asked by alex.gole_ELDORADOCOUNTY on Dec 27, 2016
Latest reply on Dec 28, 2016 by thejus.kambi

Hi all,

I am not too sure why but one of my queries (against an AGOL layer) is returning no geometry when it should:

 

 

 

 $( "#tags" ).autocomplete({
                  source: ProjectNames,
                  select: function( event, ui ) {
                var value = ui.item.value;
                console.log(value);
                 var queryTaskProjects = new QueryTask("http://services.arcgis.com/UHg8l1wC48WQyDSO/arcgis/rest/services/Projects/FeatureServer/0");
                //build query filter
                var queryProjects = new Query();
                queryProjects.returnGeometry = true;
                queryProjects.outFields = ["Name", "ACRES"];
                queryProjects.where = "Name = " + "'" + value + "'";
                queryTaskProjects.execute(queryProjects, addToMap4);
                 }
              });


function addToMap4(featureSet) {
                    var resultFeatures = featureSet.features;
                    var AOI = featureSet.geometry;
                    console.log(resultFeatures);
                    console.log(AOI);
                    var symbol = new SimpleFillSymbol(
                        SimpleFillSymbol.STYLE_SOLID,
                        new SimpleLineSymbol(
                            SimpleLineSymbol.STYLE_SOLID,
                            new Color([255, 0, 0, 0.65]), 2
                        ),
                        new Color([255, 0, 0, 0.35])
                    );
                    arrayUtil.forEach(resultFeatures, function (feature) {
                        console.log(geometry);
                        var AOI = feature.geometry;
                        projectareaexisting = new Graphic(AOI, symbol);
                        map.graphics.add(projectareaexisting);
                    });
                }

Outcomes