Packagecom.esri.aws.services
Classpublic class PlaceFinderOptions

Contains parameters for the Place Finder Web Service. Input request for Place Finder.

View the examples.



Public Properties
 PropertyDefined by
  dataSource : String
The name of the data source to use for finding a place.
PlaceFinderOptions
  filterCountry : String
The country, dependency, or area of special sovereignty to search.
PlaceFinderOptions
  filterExtent : Envelope
The geographic area to search.
PlaceFinderOptions
  filterType : String
The type of place to search.
PlaceFinderOptions
  resultSetRange : ResultSetRange
The range for the returned place names.
PlaceFinderOptions
  searchType : String
The type of search to perform.
PlaceFinderOptions
Property detail
dataSourceproperty
public var dataSource:String

The name of the data source to use for finding a place. Required. See Place Finder data sources for valid values. Use the name in parenthesis. List multiple data sources separated by semicolons to create your own automated data source, for example, "ArcWeb:NT.Streets.EU;ArcWeb:TA.Streets.EU".

filterCountryproperty 
public var filterCountry:String

The country, dependency, or area of special sovereignty to search. Use the method getInfo for a list of possible values. Default value is null which searches the whole world. See Geocoding Country Codes for a list of valid country codes.

filterExtentproperty 
public var filterExtent:Envelope

The geographic area to search. The default value is null which means no area restrictions.

filterTypeproperty 
public var filterType:String

The type of place to search. See Place type ID codes for a list of valid values. To choose multiple filters, separate place types with commas and no spaces (for example, "A,B,C"). Default value is null which returns all types.

resultSetRangeproperty 
public var resultSetRange:ResultSetRange

The range for the returned place names. The default values are record "20" and startIndex "0".

searchTypeproperty 
public var searchType:String

The type of search to perform. Valid values are "startsWith" or "exactMatch".

The default value is "startsWith".

Examples
Basic_PlaceFinder
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:awx="http://www.arcwebservices.com/2007/awx"
    pageTitle="Basic PlaceFinder Report"
    implements="mx.rpc.IResponder"
    creationComplete="onComplete()"
    >
    <mx:Script>
        <![CDATA[
            import com.esri.aws.osgi.framework.ServiceTracker;
            import com.esri.aws.services.GeocodeCandidate;
            import com.esri.aws.services.GeocodeInfo;
            import com.esri.aws.services.IPlaceFinder;
            import com.esri.aws.services.PlaceFinderOptions;
            import com.esri.aws.osgi.framework.IServiceReference;
            import flash.utils.getQualifiedClassName;
            import mx.collections.ArrayCollection;
            import mx.controls.Alert;
            import mx.rpc.IResponder;

            [Bindable]
            private var candidates:ArrayCollection;
            private var placeTracker:ServiceTracker;

            private function onComplete():void
            {
                placeTracker = new ServiceTracker(Framework.getInstance().systemContext, getQualifiedClassName(IPlaceFinder));
                placeTracker.open();
            }

            private function doSearch():void
            {
                var placeService:IPlaceFinder = placeTracker.getService() as IPlaceFinder;
                
                if(placeService)
                {
                    //build some simple options
                    var pfOptions:PlaceFinderOptions = new PlaceFinderOptions();
                    pfOptions.dataSource = "auto"; // ArcWeb:ESRI.Gazetteer.World

                    //call the PlaceFinder service using 'this' as the responder.
                    placeService.findPlace(locationText.text,pfOptions,this);
                    m_info.htmlText = "Sending request ...";
                }
            }
            
            public function result(data:Object):void
            {
                var m_geocodeInfo:GeocodeInfo = GeocodeInfo(data);
                m_info.htmlText = "<i>Showing " + m_geocodeInfo.candidates.length ;
                m_info.htmlText += " of " + m_geocodeInfo.totalCount + ".</i><br/>";
                candidates = new ArrayCollection(m_geocodeInfo.candidates);
                if (candidates.length > 0 )
                {
                    for(var i:int=0; i< candidates.length; i++)
                    {
                        var gc:GeocodeCandidate = candidates[i];
                        m_info.htmlText += "<b>" + gc.desc1 + "</b> at <b>"
                            + gc.latLon.y + "," + gc.latLon.x + "</b> [" + gc.type + "]<br>";
                    }
                }
                else
                {
                    m_info.htmlText += "<b>No matches.";
                }
            }
            public function fault(info:Object):void
            {
                Alert.show(info.toString());
            }
        ]]>
    </mx:Script>
    <awx:Framework id="m_framework" apiKey="[MY-API-KEY]" >
        <awx:PlaceFinderActivator/>
    </awx:Framework>
    <mx:Panel paddingTop="5" paddingLeft="5" paddingBottom="5" paddingRight="5"
        width="100%"
            title="Place Finder Search" layout="horizontal">
        <mx:TextInput width="95%" id="locationText" text="Paradise" enter="doSearch()"/>
        <mx:Button label="Find Place" click="doSearch()" id="m_button" />
    </mx:Panel>
    <mx:Text id="m_info" fontSize="14" top="80"/>
</mx:Application>