Automatic Search from HTML

354
2
10-25-2011 12:10 AM
ShaunWeston
Occasional Contributor
I'm just wondering if it's possible to automatically send a string to a search/locate widget from the URL. e.g. gis.map.nz/Viewer?1821040200 - going to this URL will go the flex viewer I have setup and automatically search for that property number.

I see you can through the REST API - GeocodeServer/findAddressCandidates?SingleKey=1821040200, but not sure how to do that through the actual application?
Tags (2)
0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus
Shaun,

  You are posting to the wrong forum. Flex Viewer and Widget questions need to be posted to the Flex Viewer forum:

http://forums.arcgis.com/forums/111-ArcGIS-Viewer-for-Flex

The Enhanced Search Widget allows you to search a layer automatically from the URL.

http://www.arcgis.com/home/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e
0 Kudos
ShaunWeston
Occasional Contributor
FYI for anyone who comes across this...

I made the following changes to the Locate widget to allow a search to be done from a URL like this - www.gisviewer.something.nz/?3453453 This will search for that valuation number when the viewer loads.

var browserUrl:String = ExternalInterface.call("window.location.href.toString");
    var urlArray:Array = browserUrl.split("?")     
    var locatefURL:String = urlArray[1];       
    singleAddressTextItem.text = locatefURL; 


and then added a timer to the init()

var exTimer:Timer = new Timer(1000, 1);
  exTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
          exTimer.start();
   
 public function onTimerComplete(event:TimerEvent):void
 {
 locateIfAddressFieldInputValid();
 }
0 Kudos