Select to view content in your preferred language

Pass a variable to search and auto zoom to

880
5
03-05-2012 01:14 PM
DavidRasmussen
Emerging Contributor
Perhaps someone here might be able to point me in the right direction on this:

I have an Iframe of a Data Access Page embedded into the default.html page of the Flex Viewer.
The data access page allows the user to search for property in the database using some javascript.
This property id corresponds with a property id in the map.
Is there any way that I can pass that value to the search widget and have it auto zoom to the point?

Thanks in advance for any guidance you can offer.
Tags (2)
0 Kudos
5 Replies
IvanBespalov
Frequent Contributor
David,
as a start point search in Flex API (Viewer) forums: http://forums.arcgis.com/search.php - set "ExternalInterface" as keyword
0 Kudos
DavidRasmussen
Emerging Contributor
Thank you Ivan,

I now understand how to pass the variable I want to the Viewer. 
Now I need to understand how to pass that into a search and zoom to.

Any ideas or other posts you can point me to?

Thanks again!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dave,

   That capability does not exist natively in the Flex Viewer. But you can use the eSearch widget:

http://www.arcgis.com/rc/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e

Which give you that ability. Once you download the widget look at the Enhanced Search Widget URL Search Configuration.pdf to details.


BTW: You need to post all Flex Viewer / Widget questions to the Flex Viewer Forum here:
http://forums.arcgis.com/forums/111-ArcGIS-Viewer-for-Flex

Don't forget to click the Mark as answer check and to click the top arrow (promote) as shown below:
0 Kudos
DavidRasmussen
Emerging Contributor
Thank you Robert.

I will post in that forum in the future.

So, is the only way to zoom to a searched point via parameters in the url?

I was hoping to do something along these lines:

http://help.arcgis.com/en/webapi/flex/samples/index.html#/Zoom_to_found_features/01nq0000005n000000/

Using a string passed in via javascript and the ExternalInterface.

I wouldn't need the DataGrid though.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dave,

   Of course you can do that if you write your own code to handle it. I was just pointing out that this is not native to the Viewer out of the box. Also using the eSearch does not mean that you have to use the datagrid (it's an optional capability).

Don't forget to click the Mark as answer check and to click the top arrow (promote) as shown below:
0 Kudos