Maps SDK for Web

tt.services.geometrySearch

Makes a search request using the TomTom Search API - Geometry Search.

Parameters need to be passed to the constructor. The method go performs the actual call.

Constructor

tt.services.geometrySearch([options])

Example
const geometryList = [
  {
    type: 'POLYGON',
    vertices: [
      '37.7524152343544,-122.43576049804686',
      '37.70660472542312,-122.43301391601562',
      '37.712059855877314,-122.36434936523438',
      '37.75350561243041,-122.37396240234374'
    ]
  },
  {
    type: 'CIRCLE',
    position: '37.71205,-121.36434',
    radius: 6000
  },
  {
    type: 'CIRCLE',
    position: '37.31205,-121.36434',
    radius: 1000
  }
];

function callbackFn(results) {
  console.log(results);
}

tt.services.geometrySearch({
  key: <Your API key>,
  geometryList: geometryList
})
.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