AnsweredAssumed Answered

need map to include all surrounding areas

Question asked by tr_transcendent on Jan 23, 2012
Latest reply on Jan 23, 2012 by DSwingley-esristaff
I am attempting to have a map that highlights areas within a certain mile radius of a user selected point.  I am using a query task to return the geometry of those areas but I am having some trouble expanding the map to include all the areas returned by the query task.  Code snippets:
  function init() {             map = new esri.Map("mapDiv");             var layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://lrs.co.columbia.wi.us/ArcGIS/rest/services/LRS/TaxParcels_Parcels/MapServer")             map.addLayer(layer);     for (j = 0; j < parnums.length; j++) {                 queryTask = new esri.tasks.QueryTask("http://lrs.co.columbia.wi.us/ArcGIS/rest/services/LRS/TaxParcels_Parcels/MapServer/1");                 query = new esri.tasks.Query();                 query.returnGeometry = true;                 query.text = parnums[j]                 queryTask.execute(query, gettingResults);      function gettingResults(resultFeatures) {    featholding.push(resultFeatures); // this is the area the end user selected  var newExtent = esri.graphicsExtent(SearchPar[0].features)  //this is where I attempt to enclude the other areas that were returned by the  queryTask  for (j = 0; j < featholding.length; j++){                 var Uextent=esri.graphicsExtent(featholding[j].features)                 newExtent.union(Uextent)              }                               map.setExtent(newExtent.expand(1.1),true); }


I found union in the api docs but I am wondering if I am using it correctly
Thanks

Outcomes