Class: Geocoder

.xyz.maps.service. Geocoder

new Geocoder(config)

providers geocode and reverse geocode services.
Parameters:
Name Type Description
config here.xyz.maps.service.Geocoder.Options configurations for geocoder

Classes

Options

Members Summary

config :Object

Current config of the Geocoder.

reverseUrl :String

the url to the reverse geocode service.

url :String

the url to the geocode service.

Methods Summary

createUrl(baseUrl, params) → {string}

create request url.

geocode(params, onSuccess, onError)

make geocode request.

getIsoCountryCode(location, onSuccess, onError)

make reverse geocode request for ISO country code.

reverseGeocode(params, onSuccess, onError)

make reverse geocode request.

Members Details

config :Object

Current config of the Geocoder.
Type:
Object

reverseUrl :String

the url to the reverse geocode service.
Type:
String

url :String

the url to the geocode service.
Type:
String

Methods Details

createUrl(baseUrl, params) → {string}

create request url.
Parameters:
Name Type Description
baseUrl String
params Object additional params for request url
Returns:
return request url
Type:
string

geocode(params, onSuccess, onError)

make geocode request.
Parameters:
Name Type Description
params Object additional params for request url
onSuccess function success callback
onError function error callback

getIsoCountryCode(location, onSuccess, onError)

make reverse geocode request for ISO country code.
Parameters:
Name Type Description
location Object it is either an array [longitude, latitude] or an object literal {longitude: number, latitude: number}
onSuccess function success callback which contains iso country code
onError function error callback

reverseGeocode(params, onSuccess, onError)

make reverse geocode request.
Parameters:
Name Type Description
params Object additional params for request url
onSuccess function success callback
onError function error callback