AtlasCT.com
User Manual v5.0

Geocode

Inheritance: EventListener > Geocode

The Geocode class is used to convert an address to a geographical location, and a geographical location to an address.

Summary
Inheritance: EventListener > Geocode
The Geocode constructor.
Convert an address to geographical location.
Convert a geographical location to an address.
Convert an ip address to a geographical location.
An integer that contains the geocode result code.
A string that contains the geocode result id.
An Address object that contains the geocode response address.
An array that contains a list of addresses that matching the requested address/coordinate.
A geoIP object which hold information about the IP location.
This event dispatches after a geocode response has arrived from the server.

Constructors

Geocode

Geocode()

The Geocode constructor.

Methods

addressToCoordinate

addressToCoordinate(Address address
string countryCode)

Convert an address to geographical location. this action initialize the geocode properties:

This action goes to the AtlasNET Server, therefor, you should use the addListener method in order to receive the Map.EVENT_GEO_RESULT event.

Parameters

addressA new address to convert.
countryCodeISO ALPHA-3 country code(optional).

coordinateToAddress

coordinateToAddress(Coordinate coordinate)

Convert a geographical location to an address. this action initialize the geocode properties:

This action goes to the AtlasNET Server, therefor, you should use the addListener method in order to receive the Map.EVENT_GEO_RESULT event.

Parameters

coordinateA new coordinate to convert.

ipToCoordinate

ipToCoordinate( string ip)

Convert an ip address to a geographical location. This action initialized the geocode properties:

This action goes to the AtlasNET Server, therefor, you should use the addListener method in order to receive the Map.EVENT_GEO_RESULT event.

Parameters

ipThe required IP (optional).

Properties

resultCode

int resultCode

An integer that contains the geocode result code.

Geocoding Status codes and meanings

The list below describes the available gecode status codes:

  • -5 - Country not found
  • -4 - State not found
  • -3 - City not found
  • -2 - Street not found
  • -1 - House number not found
  • 0 - General Error
  • 1 - Exact address found
  • 2 - List of address possibilities found.

resultId

string resultId

A string that contains the geocode result id.

Geocoding result id's and meanings

The list below describes the available gecode result id's:

  • "geocode" - address to coordinate or coordinate to address.
  • "geoip" - IP to coordinate.

geoResult

Address geoResult

An Address object that contains the geocode response address.  This property is initialized only when the resultCode value is equal to 1 or 2.  If the resultCode value equal to 1, then this property will contain the geocode response address.  If the resultCode value equal to 2, then this property will contain the first address of the geoResultList list. 

geoResultList

Array[] Address geoResultList

An array that contains a list of addresses that matching the requested address/coordinate.  This property is initialized only when the resultCode value is equal to 2. 

geoIP

geoIP(string ip
Coordinate coordinate
string zoomLevel
string countryCode
string countryName
string city
string postalCode
string areaCode
string region)

A geoIP object which hold information about the IP location.

Parameters

ipThe requested IP.
coordinateThe coordinate location of the IP.
zoomLevelThe zoom level of the IP.
countryCodeThe country code of the IP.
countryNameThe country name of the IP.
cityThe city of the IP.
postalCodeThe postal code of the IP.
areaCodeThe area code of the IP.
regionThe region of the IP.

Constants

Geocode Events

Map. EVENT_GEO_RESULT

This event dispatches after a geocode response has arrived from the server.

The EventListener class helps you to register event handlers defined by this API.
Some of the classes that inherit from this class are: Map, OverviewMap, LayersManager
Geocode()
The Geocode constructor.
addressToCoordinate(Address address)
Convert an address to geographical location.
coordinateToAddress(Coordinate coordinate)
Convert a geographical location to an address.
An integer that contains the geocode result code.
An Address object that contains the geocode response address.
An array that contains a list of addresses that matching the requested address/coordinate.
This event dispatches after a geocode response has arrived from the server.
The Address class represent a specific address information, with its coordinates.
This is the base class of the provided coordinates classes.