Maps SDK for Web
tt.services.nearbySearch
Makes a search request using the TomTom Search API - Nearby Search.
Parameters need to be be passed to the constructor. The method go performs the actual call.
This service supports batch calls.
In order to make batch call, pass an object which will contain the 'key' property, 'batchMode' property set to the correct value (sync, async, or redirect) and batchItems, which will contain an array of objects which represent options for each call. For more information, please refer to batch documentation:
tt.services.<service name>({
batchMode: 'sync'
key: <Your API key>,
batchItems: [{
...
}, {
...
} //... more objects
]
})
.go()
.then(callback);
Constructor
tt.services.nearbySearch([options])
Example
function callbackFn(result) {
console.log(result);
};
tt.services.nearbySearch({
key: <Your API key>,
center: [0,0],
radius: 1000
})
.go()
.then(callbackFn);
The SDK provides a Promise polyfill for browsers (IE<9) without native ECMAScript 6 support.
Parameters
Name | Description |
---|---|
options
Object default:None |
Options to be passed to the search call, or an array of such options objects to perform a batch request. |
Methods
go( ): Promise
Executes a predefined asynchronous task using the current configuration.
Returns