Select to view content in your preferred language

Zooming to a point from a search result

946
3
02-03-2013 06:42 PM
NigelDsouza
Frequent Contributor
Hi,
I have a search bar where it searches for results on a web service and displays the results on the map. However i want to zoom to the results. The results i get are stored in an array. So if i get one result, then the map should zoom to that point. But if the results are more than one then the map should zoom to an envelope such that both/ (whatever the search results) are encapsulated.
I have taken help from the ArcGis queryTask sample for android to get results in an array.
can anyone help?
Reagrds Nigel.
0 Kudos
3 Replies
JohnAllen
Deactivated User
nigel_ngl,

Can you post your code that explains how to search a webservice and displays on the map?
0 Kudos
NigelDsouza
Frequent Contributor
Hi,
My code is same as the sample code given in the ArcGIS Query Task sample for android except that I am a value from the user with the help of an alert dialog box.
Regards,
Nigel.
0 Kudos
Andréde_Mattos_Ferraz
Deactivated User
I suggest you to verify the total of returned results and if total is equal to one , you create a multipoint (http://resources.esri.com/help/9.3/arcgisserver/apis/flex/apiref/com/esri/ags/geometry/Multipoint.ht...) and insert a new point with minor changes on X and Y. And then you apply zoom with this:

map.extent = multiPoint.extent.expand(1.5);
0 Kudos