MapQuest.js

L.mapquest.searchAhead(options, callback)

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.

Syntax

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);
}

Parameters

  • options required object

    An object containing options from the Search Ahead API. The q and collection fields are required.

  • callback required Function

    An error-first callback to be invoked upon completion of the search ahead prediction function call.

Return Value

The Search Ahead API response will be returned.