Class GeoCoder

This class call Nominatim and parse the response

Source : file core/lib/GeoCoder.js at line 42

Constructor

new GeoCoder ( )

The constructor

Source : file core/lib/GeoCoder.js at line 151

Public methods

async getAddressAsync ( latLng )

This async method search an address from a latitude and longitude

Source : file core/lib/GeoCoder.js at line 173

Parameters

Name Type Description
latLng Array of Number

The latitude and longitude to be used to search the address

Returns

The address at the given point. The GeoCoderAddress.statusOk must be verified before using the data.
Type : GeoCoderAddress

getAddressWithPromise ( latLng )

This method search an address from a latitude and longitude with a Promise.

Source : file core/lib/GeoCoder.js at line 184

Parameters

Name Type Description
latLng Array of Number

The latitude and longitude to be used to search the address

Returns

A promise that fulfill with the address at the given point.
Type : Promise

Private properties

#latLng : Array of Number

The Lat and Lng for thr geocoding

Source : file core/lib/GeoCoder.js at line 63

#nominatimDataLoader : NominatimDataLoader

The NominatimDataLoader object

Source : file core/lib/GeoCoder.js at line 77

#overpassAPIDataLoader : OverpassAPIDataLoader

The OverpassAPIDataLoader object

Source : file core/lib/GeoCoder.js at line 70

Private getters and setters

readonly static get #queryDistance : Number

The distance used in the OverpassAPI query for places

Source : file core/lib/GeoCoder.js at line 49

Private methods

async #getAddressAsync ( )

This method search the address

Source : file core/lib/GeoCoder.js at line 128

Returns

The address at the given point.
Type : GeoCoderAddress

async #getAddressWithPromise ( onOk, onError )

This method is executed by the Promise to search an address. The #getAddressAsync return always a response, eventually with empty strings, so the onError function is never called

Source : file core/lib/GeoCoder.js at line 143

Parameters

Name Type Description
onOk Function

The ok handler

onError Function

The error handler

#getOverpassQueries ( )

This method get the Overpass query

Source : file core/lib/GeoCoder.js at line 112

#mergeData ( )

This method merge the data from Nominatim and theOverpassAPI

Source : file core/lib/GeoCoder.js at line 84

Returns

The address at the given point
Type : GeoCoderAddress