Packagecom.afcomponents.umap.display.geocodermanager
Classpublic class GeocoderManager
InheritanceGeocoderManager Inheritance Manager Inheritance MapObjectContainer Inheritance MapObject Inheritance flash.display.Sprite

GeocoderManager


Example
Here is how you can create a geocoder manager object.
 import com.afcomponents.umap.display.geocodermanager.GeocoderManager;
 import com.afcomponents.umap.core.UMap;
 import com.afcomponents.umap.events.GeocoderEvent;
 import com.afcomponents.umap.types.GeocoderRequest;
 
 var map:UMap = new UMap();
 map.setSize (500,400);
 stage.addChild (map);
 
 var geo:GeocoderManager = new GeocoderManager();
 
 geo.addEventListener(GeocoderEvent.SUCCESS,ready); 
    var results:GeocoderRequest = geo.service.geocodeAddress("Rome",20);
 
 function ready(event:GeocoderEvent):void
 {
  if (event.request == results)
   map.addOverlay(geo.getLayer(event.results));
 }
 



Public Properties
 PropertyDefined by
 InheritedasDisplayObject : DisplayObject
Returns reference to the object as a DisplayObject instance.
MapObject
 Inheritedcore : UMap
Returns reference to the core UMap object.
MapObject
  defaultParam : Object
Object witch contains default paramets for geocodingRequest
GeocoderManager
 Inheritedid : uint
Gets or sets the ID of the object.
MapObject
  maxCacheSize : uint
Gets or sets maximum size of cache.
GeocoderManager
 Inheritedname : String
Gets or sets the name of the object.
MapObject
 Inheritedowner : IMapObjectContainer
Returns reference to the owner container object.
MapObject
  service : IGeocoderService
[read-only] Gets or sets reference to the сurrent geocoder service.
GeocoderManager
Public Methods
 MethodDefined by
  
GeocoderManager(service:* = null, defaultParam:Object = null)
GeocoderManager constructor creates new grocoder manager.
GeocoderManager
 Inherited
addObject(object:IMapObject):void
Adds new IMapObject to the container.
MapObjectContainer
 Inherited
bringForward(object:IMapObject):void
Moves the attached IMapObject forward in the display list.
MapObjectContainer
 Inherited
bringToFront(object:IMapObject):void
Brings the attached IMapObject to the top of the display list.
MapObjectContainer
  
Cancel current request.
GeocoderManager
 Inherited
clearObjects(filter:Class = null):void
Removes all attached objects.
MapObjectContainer
  
dispose():void
Releases all the resources accuired by the object.
GeocoderManager
  
findById(requestId:uint):GeocoderRequest
Find GeocoderRequest in cache by requestId.
GeocoderManager
  
geocodeAddress(address:String, maxRows:int, param:Object = null):GeocoderRequest
GeocoderManager
  
geocodeByBounds(bounds:LatLngBounds, maxRows:int, param:Object = null):GeocoderRequest
GeocoderManager
  
geocodeLatLng(latLng:LatLng, maxRows:int, param:Object = null):GeocoderRequest
GeocoderManager
  
getLatLng(results:Array = null):Array
Convert an array of GeocoderResults objects to an array of LalLng objects.
GeocoderManager
  
getLayer(results:Array, markerStyle:Object = null, infoWindowStyle:Object = null):Layer
Convert an array of GeocoderResults objects to a Layer with Marker objects
GeocoderManager
  
getMarker(results:Array = null, markerStyle:Object = null, infoWindowStyle:Object = null):Array
GeocoderManager
 Inherited
getObject(id_or_name:*, filter:Class = null):IMapObject
Searches for an object with specified id or name.
MapObjectContainer
 Inherited
getObjectById(id:uint, filter:Class = null):IMapObject
Searches for an object with specified id.
MapObjectContainer
 Inherited
getObjectByName(name:String, matchCase:Boolean = false, filter:Class = null):IMapObject
Searches for an object with specified name.
MapObjectContainer
 Inherited
getObjects(filter:Class = null):Array
Returns an array of IMapObjects that where added to the container.
MapObjectContainer
 Inherited
init():void
Manager
 Inherited
isOwnerVisible():Boolean
Recursevly checks visibility of parent objects
MapObjectContainer
 Inherited
ready():void
Manager
 Inherited
remove():void
Removes the object from the owner container object.
MapObject
  
removeFromCache(requestId:uint):Boolean
Remove GeocoderRequest from cache by requestId
GeocoderManager
 Inherited
removeObject(object:IMapObject):void
Removes IMapObject from the container.
MapObjectContainer
  
resetCache():void
Clears cache request.
GeocoderManager
  
resetQueue():void
Clears queue request.
GeocoderManager
 Inherited
sendBackward(object:IMapObject):void
Sends the attached IMapObject backward in the display list.
MapObjectContainer
 Inherited
sendToBack(object:IMapObject):void
Sends the attached IMapObject to the bottom of the display list.
MapObjectContainer
 Inherited
Adds the object to the specified IMapObjectContainer.
MapObjectContainer
  
setService(value:*):Boolean
GeocoderManager
 Inherited
toString():String
Returns a textual representation of the object.
MapObject
 Inherited
updateComponentProperty(property:String, value:*):void
Manager
 Inherited
updateMapType(mapType:IMapType):void
Manager
 Inherited
updatePosition(latlng:LatLng):void
Manager
 Inherited
updateSize(width:Number, height:Number):void
Manager
 Inherited
updateZoom(zoom:Number):void
Manager
Events
 EventSummaryDefined by
   Dispatched when request has been canceled.GeocoderManager
   Dispatched when error occurs while loading data for the request.GeocoderManager
   Dispatched when request startes loading.GeocoderManager
   Dispatched when request has been completed.GeocoderManager
Public Constants
 ConstantDefined by
  GEO_NAMES_SERVICE : Class
[static] Defines the class for the Geonames Service.
GeocoderManager
  YAHOO_GEO_PLANET_SERVICE : Class
[static] Defines the class for the Yahoo GeoPlanet Service.
GeocoderManager
  YAHOO_LOCAL_SERVICE : Class
[static] Defines the class for the Yahoo Local Service.
GeocoderManager
Property detail
defaultParamproperty
defaultParam:Object  [read-write]

Object witch contains default paramets for geocodingRequest

Implementation
    public function get defaultParam():Object
    public function set defaultParam(value:Object):void
maxCacheSizeproperty 
maxCacheSize:uint  [read-write]

Gets or sets maximum size of cache. If number of requests exceeds cache length the oldest result will be erased.

Implementation
    public function get maxCacheSize():uint
    public function set maxCacheSize(value:uint):void
serviceproperty 
service:IGeocoderService  [read-only]

Gets or sets reference to the сurrent geocoder service.

Implementation
    public function get service():IGeocoderService
Constructor detail
GeocoderManager()constructor
public function GeocoderManager(service:* = null, defaultParam:Object = null)

GeocoderManager constructor creates new grocoder manager. You can defined geocoderService witch will be used by geocoderManager.

Parameters
service:* (default = null) — type of geocoder service
 
defaultParam:Object (default = null) — object witch contains default paramets for geocodingRequest
Method detail
cancelRequest()method
public function cancelRequest():void

Cancel current request.

dispose()method 
public override function dispose():void

Releases all the resources accuired by the object.

findById()method 
public function findById(requestId:uint):GeocoderRequest

Find GeocoderRequest in cache by requestId.

Parameters
requestId:uint — id of request.

Returns
GeocoderRequestGeocoderRequest object if it was fond in cache and null if wasn't.
geocodeAddress()method 
public function geocodeAddress(address:String, maxRows:int, param:Object = null):GeocoderRequest

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

Returns
GeocoderRequest
geocodeByBounds()method 
public function geocodeByBounds(bounds:LatLngBounds, maxRows:int, param:Object = null):GeocoderRequest

Parameters
bounds:LatLngBounds
 
maxRows:int
 
param:Object (default = null)

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

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

Returns
GeocoderRequest
getLatLng()method 
public function getLatLng(results:Array = null):Array

Convert an array of GeocoderResults objects to an array of LalLng objects.

Parameters
results:Array (default = null) — Array witch contains geocoding results returned by a service. If a value of null is passed results for a previous request will be used.

Returns
Array — array of LatLng objects.
getLayer()method 
public function getLayer(results:Array, markerStyle:Object = null, infoWindowStyle:Object = null):Layer

Convert an array of GeocoderResults objects to a Layer with Marker objects

Parameters
results:Array — Array witch contains geocoding results returned by a service. If a value of null is passed results for a previous request will be used.
 
markerStyle:Object (default = null) — Object that defines marker's style.
 
infoWindowStyle:Object (default = null) — Info window style object associated with the Overlay.

Returns
LayerLayer with markers
getMarker()method 
public function getMarker(results:Array = null, markerStyle:Object = null, infoWindowStyle:Object = null):ArrayParameters
results:Array (default = null)
 
markerStyle:Object (default = null)
 
infoWindowStyle:Object (default = null)

Returns
Array
removeFromCache()method 
public function removeFromCache(requestId:uint):Boolean

Remove GeocoderRequest from cache by requestId

Parameters
requestId:uint

Returns
Boolean — a value of true if GeocoderRequest was found and removed; false if it wasn't
resetCache()method 
public function resetCache():void

Clears cache request.

resetQueue()method 
public function resetQueue():void

Clears queue request.

setService()method 
public function setService(value:*):Boolean

Parameters
value:*

Returns
Boolean
Event detail
CANCEL_REQUESTevent 
Event object type: com.afcomponents.umap.events.GeocoderEvent
GeocoderEvent.type property = com.afcomponents.umap.events.GeocoderEvent.CANCEL_REQUEST

Dispatched when request has been canceled.

ERRORevent  
Event object type: com.afcomponents.umap.events.GeocoderEvent
GeocoderEvent.type property = com.afcomponents.umap.events.GeocoderEvent.ERROR

Dispatched when error occurs while loading data for the request.

STARTED_LOADevent  
Event object type: com.afcomponents.umap.events.GeocoderEvent
GeocoderEvent.type property = com.afcomponents.umap.events.GeocoderEvent.STARTED_LOAD

Dispatched when request startes loading.

SUCCESevent  
Event object type: com.afcomponents.umap.events.GeocoderEvent

Dispatched when request has been completed.

Constant detail
GEO_NAMES_SERVICEconstant
public static const GEO_NAMES_SERVICE:Class

Defines the class for the Geonames Service.

See also

YAHOO_GEO_PLANET_SERVICEconstant 
public static const YAHOO_GEO_PLANET_SERVICE:Class

Defines the class for the Yahoo GeoPlanet Service.

See also

YAHOO_LOCAL_SERVICEconstant 
public static const YAHOO_LOCAL_SERVICE:Class

Defines the class for the Yahoo Local Service.

See also