A class that acts as a simple interface to the Search Ahead API. The class provides predictive location results based on the provided input parameters.
L.mapquest.key = 'KEY';
var options = {
q: 'Denver, CO',
collection: 'address,adminArea,airport,poi'
};
L.mapquest.searchAhead.prediction(options, searchAheadCallback);
function searchAheadCallback(error, result) {
console.log(result);
}
An object containing options from the Search Ahead API.
The q
and collection
fields are required.
An error-first callback to be invoked upon completion of the search ahead prediction function call.
The Search Ahead API response will be returned.