AnsweredAssumed Answered

heip me

Question asked by sinharcgis on Aug 26, 2014
Latest reply on Aug 29, 2014 by r.spitzergeosecure-de-esridist

functions  queryTask1.execute(query1, showResults) return of type point(only one point), how are getting  this point and pass to functions centerAndZoom(point, lever).

this is my code

 

queryTask1.execute(query1, showResults);

           

 

 

              function showResults(featureSet) {

 

 

                  //remove all graphics on the maps graphics layer

                  myMap.graphics.clear();

 

 

                  //Performance enhancer - assign featureSet array to a single variable.

                  var resultFeatures = featureSet.features;

 

 

                  //Loop through each feature returned

                  for (var i = 0, il = resultFeatures.length; i < il; i++) {

                      //Get the current feature from the featureSet.

                      //Feature is a graphic

                      var graphic = resultFeatures[i];

                      graphic.setSymbol(symbol1);

 

 

                      //Set the infoTemplate.

                      graphic.setInfoTemplate(infoTemplate);

 

 

                      //Add graphic to the map graphics layer.

                      myMap.graphics.add(graphic);

                  }

 

 

map.centerAndZoom(???, ????);

         

 

 

 

              }

Outcomes