AnsweredAssumed Answered

Use buffer extent to query layer

Question asked by alex.gole_ELDORADOCOUNTY on Nov 30, 2016
Latest reply on Nov 30, 2016 by alex.gole_ELDORADOCOUNTY

Hi all,

I am trying to use the buffer extent into my query but I am not successful. Any idea why I get the following error?

Thanks,

Alex

 

 

arrayUtil.forEach(bufferedGeometries, function (geometry) {
                      var graphic = new Graphic(geometry, symbol);
                      map.setExtent(graphicsUtils.graphicsExtent(graphic), true);
                      map.graphics.add(graphic);
                      var queryTask = new QueryTask("http://itas46:6080/arcgis/rest/services/Alex_test/TreeMortalityLayers/MapServer/9");
                      var query = new Query();
                      query.returnGeometry = true;
                      query.geometry = geometry;
                      query.outFields = ["OWNER_NAME", "OWNER_ADDR", "OWNER_CITY"];
                      query.outSpatialReference = map.spatialReference;
                      queryTask.execute(query, addToMap);
                  });

              }
              function addToMap(results) {
                  var symbol8 = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID,
                                   new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
                                     new Color([255, 0, 0]), 3), new Color([18, 29, 224, 0.35]));
                  var featureArray = results.features;
                  if (featureArray && featureArray.length > 0) {
                      // do stuff with the features
                      arrayUtils.forEach(featureArray, function (feat) {
                          feat.setSymbol(symbol8);
                          map.graphics.add(feat);
                      });
                  } else {
                      alert("No features found")
                  }

Outcomes