Packagecom.afcomponents.umap.display.geocodermanager
Classpublic class BingSearchService
InheritanceBingSearchService Inheritance DefaultGeocoderService Inheritance flash.events.EventDispatcher
ImplementsIGeocoderService

Specifies a Bing search service. This service can be used separetly or through the GeocoderManager class. The service requires a valid MapPoint proxy singleton configured and token acquired.


Example
Consider a short usage example:
 import com.afcomponents.umap.core.UMap;
 import com.afcomponents.umap.display.geocodermanager.GeocoderManager;
 import com.afcomponents.umap.display.geocodermanager.BingSearchService;
 import com.afcomponents.umap.events.GeocoderEvent;
 import com.afcomponents.umap.providers.microsoft.MapPointProxy;
 import com.afcomponents.umap.providers.microsoft.MapPointTokenRequest;
 import com.afcomponents.umap.events.MapPointProxyEvent;
  
 // create UMap instance
 var map:UMap = new UMap();
 map.setSize (550,400);
 addChild (map);
  
 // initalize proxy
 MapPointProxy.initialize("http://www.umapper.com/demo/dmitry/msproxy.php");
  
 // request token, and wait for valid token
 var proxy:MapPointProxy = MapPointProxy.getInstance();
 proxy.getToken();
 proxy.addEventListener(MapPointProxyEvent.REQUEST_COMPLETE, proxyComplete);
  
 // create geocoder manager
 var geo:GeocoderManager = new GeocoderManager(GeocoderManager.BING_SEARCH_SERVICE);
 geo.addEventListener(GeocoderEvent.SUCCESS, geocoderSuccess);
  
 // wait for token ready event and do geocoding
 function proxyComplete(event:MapPointProxyEvent):void
 {
   if (event.request is MapPointTokenRequest)
   {
     // token ready, perform geocoding
     geo.geocodeAddress("Cinema Denver", 25, {listingType:BingSearchService.BUSINESS});
   }
 }
  
 // GeocoderEvent.SUCCESS listener function
 function geocoderSuccess(event:GeocoderEvent):void
 {
   // extract result marker, add it to map and open the info window
   map.addOverlay(geo.getMarker(event.results)[0]).openInfoWindow();
 }
 

See also

com.afcomponents.umap.display.geocodermanager.GeocoderManager
com.afcomponents.umap.providers.microsoft.MapPointProxy
com.afcomponents.umap.events.GeocoderEvent


Public Properties
 PropertyDefined by
 Inheritedcache : Array
DefaultGeocoderService
 InheriteddefaultParam : Object
DefaultGeocoderService
  language : String
Gets or sets the language 2-letter ISO code.
BingSearchService
 InheritedmaxCacheSize : uint
DefaultGeocoderService
 Inheritedqueue : Array
DefaultGeocoderService
 Inheritedrequest : GeocoderRequest
DefaultGeocoderService
  results : Array
[read-only] Returns array of GeocoderResults objects.
BingSearchService
  token : String
BingSearchService
Protected Properties
 PropertyDefined by
 Inherited_cache : Array
DefaultGeocoderService
 Inherited_defaultParam : Object
DefaultGeocoderService
 Inherited_loader : *
DefaultGeocoderService
 Inherited_pipe : Boolean
DefaultGeocoderService
 Inherited_queue : Array
DefaultGeocoderService
 Inherited_request : GeocoderRequest
DefaultGeocoderService
 Inherited_requestCounter : uint
DefaultGeocoderService
 Inherited_results : Array
DefaultGeocoderService
 Inherited_xmlData : XML
DefaultGeocoderService
Public Methods
 MethodDefined by
  
BingSearchService(param:Object = null)
BingSearchService
 Inherited
DefaultGeocoderService
 Inherited
dispose():void
DefaultGeocoderService
  
geocodeAddress(address:String, maxRows:int, param:Object = null):GeocoderRequest
BingSearchService
 Inherited
geocodeByBounds(bounds:LatLngBounds, maxRows:int, param:Object = null):GeocoderRequest
DefaultGeocoderService
 Inherited
DefaultGeocoderService
  
geocodeLatLng(latLng:LatLng, maxRows:int, param:Object = null):GeocoderRequest
BingSearchService
 Inherited
DefaultGeocoderService
 Inherited
loadQuery(server:*, param:Object = null):GeocoderRequest
DefaultGeocoderService
 Inherited
reload():void
DefaultGeocoderService
Protected Methods
 MethodDefined by
  
createLoader():void
BingSearchService
  
BingSearchService
 Inherited
error():void
DefaultGeocoderService
  
loadComplete(event:Event):void
BingSearchService
  
loadError(event:IOErrorEvent):void
BingSearchService
  
BingSearchService
  
loadSecurityError(event:SecurityError):void
BingSearchService
 Inherited
parse(data:String):Boolean
DefaultGeocoderService
 Inherited
ready():void
DefaultGeocoderService
Public Constants
 ConstantDefined by
  BUSINESS : String = "Business"
[static] The search result is from business listings
BingSearchService
 InheritedLIMIT_ROWS : int = 30
[static]
DefaultGeocoderService
  PERSON : String = "Person"
[static] The search result is from people listings
BingSearchService
  UNKNOWN : String = "Unknown"
[static] The search result source is unknown
BingSearchService
Property detail
languageproperty
language:String  [read-write]

Gets or sets the language 2-letter ISO code.

Implementation
    public function get language():String
    public function set language(value:String):void
resultsproperty 
results:Array  [read-only]

Returns array of GeocoderResults objects.

Implementation
    public function get results():Array
tokenproperty 
token:String  [read-write]

Implementation
    public function get token():String
    public function set token(value:String):void
Constructor detail
BingSearchService()constructor
public function BingSearchService(param:Object = null)

Parameters
param:Object (default = null)
Method detail
createLoader()method
protected override function createLoader():void
disposeLoader()method 
protected override function disposeLoader():void
geocodeAddress()method 
public override function geocodeAddress(address:String, maxRows:int, param:Object = null):GeocoderRequest

Parameters
address:String
 
maxRows:int
 
param:Object (default = null)

Returns
GeocoderRequest
geocodeLatLng()method 
public override function geocodeLatLng(latLng:LatLng, maxRows:int, param:Object = null):GeocoderRequest

Parameters
latLng:LatLng
 
maxRows:int
 
param:Object (default = null)

Returns
GeocoderRequest
loadComplete()method 
protected override function loadComplete(event:Event):voidParameters
event:Event
loadError()method 
protected override function loadError(event:IOErrorEvent):voidParameters
event:IOErrorEvent
loadRequest()method 
protected override function loadRequest(request:GeocoderRequest):voidParameters
request:GeocoderRequest
loadSecurityError()method 
protected override function loadSecurityError(event:SecurityError):voidParameters
event:SecurityError
Constant detail
BUSINESSconstant
public static const BUSINESS:String = "Business"

The search result is from business listings

PERSONconstant 
public static const PERSON:String = "Person"

The search result is from people listings

UNKNOWNconstant 
public static const UNKNOWN:String = "Unknown"

The search result source is unknown