Thanks Ken.I just tried using the centerAndZoom method and it worked perfectly.map.centerAndZoom(resultFeatures[0].geometry, .01);Will
map.centerAndZoom(resultFeatures[0].geometry, .01);
if(resultFeatures.length == 1) { map.centerAt(resultFeatures[0].geometry); }
//zoom to graphics on the var graphicsExtent = esri.graphicsExtent(map.graphics.graphics) if (graphicsExtent !== null) { map.setExtent(graphicsExtent); //map.setExtent(graphicsExtent.expand(1.5)); //use this if you want to expand the extent }
var myFeatureExtent = esri.graphicsExtent(myFeatureSet.features); map.setExtent(myFeatureExtent);
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.