Global

Methods

geocode(obj, cb) → {Promise.<module:index~GeocodeResponse>}

It geocodes an address. The found position is transmitted to the callback function as parameter.

Parameters:
Name Type Description
obj module:index~GeocodeOptions

The hash object representing the address to geocode.

cb function

The callback to call. Called with the position in EPSG:2169 (LUREF) of the geocoded address.

Source:
Returns:

Promise that returns the geocoding response.

Type
Promise.<module:index~GeocodeResponse>
Examples
lux.geocode({
  queryString: '54 avenue gaston diderich 1420 luxembourg'
}, function(position) {
	 console.log (position);
});
lux.geocode({
num: 54,
  street: 'avenue gaston diderich',
  zip: 1420,
  locality: 'luxembourg'
}, function(position) {
	console.log (position);
});

reverseGeocode(coordinate, cb) → {Promise.<module:index~ReverseGeocodeResponse>}

It returns the most closest address of a given point.

Parameters:
Name Type Description
coordinate ol.Coordinate

The coordinates to look for an address. Coordinates must be given in EPSG:2169.

cb function

The callback function to call. Called with the address represented by ReverseGeocodeResult.

Source:
Returns:

Promise that returns the reverse geocoding response.

Type
Promise.<module:index~ReverseGeocodeResponse>
Example
lux.reverseGeocode([75979,75067], function(address) {
  var html = [address.number, address.street, address.postal_code + ' ' + address.locality] .join(', ');
  console.log(html);console.log(address);
});