var myFeatureExtent = esri.graphicsExtent(myFeatureSet.features); map.setExtent(myFeatureExtent);
//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 }
if(resultFeatures.length == 1) { map.centerAt(resultFeatures[0].geometry); }
map.centerAndZoom(resultFeatures[0].geometry, .01);
Thanks Ken.I just tried using the centerAndZoom method and it worked perfectly.map.centerAndZoom(resultFeatures[0].geometry, .01);Will
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.