Maps SDK for Web

tt.services.crossStreetLookup

It converts geographical coordinates into a textual address representation using the TomTom Search API - CrossStreet lookup.

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

The final response from the service is a JSON object with the following structure:

{
  address: {
    buildingNumber: 19,
    streetNumber: 19,
    street: 'N 2nd St',
    streetName: 'N 2nd St',
    crossStreet: 'E SANTA CLARA ST'
    streetNameAndNumber: '',
    speedLimit: '',
    countryCode: 'US",
    countrySubdivision: "'A',
    countrySecondarySubdivision: 'Santa Clara',
    countryTertiarySubdivision: '',
    municipality: 'San Jose',
    postalCode: '95113',
    municipalitySubdivision: "San Francisco Bay Area',
    freeformAddress: 'E SANTA CLARA ST & N 2nd St, San Jose, CA, 95113'
  },
  position: '37.337083, -121.8898'
}

Constructor

tt.services.crossStreetLookup([options])

Example
tt.services.crossStreetLookup({
  key: <Your API key>,
  position: '19.449,51.759'
})
.go()
.then(function(response) {
  console.log(response);
});
Parameters
Name Description
options
Object
default:None
options.heading
Number
default:None

The directional heading of the vehicle in degrees for travel along a segment of roadway. 0 is North, 90 is East and so on. Values range from -360 to 360. The precision can include up to one decimal place.


Makes it possible to get the address information of the road, keeping in mind the direction.
options.key
String
default:None

A valid API Key for the requested service.


A valid API Key is required to make use of the given service. It can be issued in the Developer Portal.
options.language
String
default:null

Language code that decides in which language the search results should be returned.


The value should correspond to one of the supported IETF language codes. The list is available here. The code is case insensitive.
options.limit
Number
default:10

The maximum number of responses that will be returned.


Represents the maximum number of responses that will be returned per request. The maximum value is 100.
options.position
String | Number[] | String[] | Object
default:None

Longitude and latitude data in one of the supported formats.


This option's value should have the location to be reverse geocoded. This option is able to convert a number of popular formats into a geographic coordinate. The supported formats are listed below:
  • Maps.LngLat Class instance.
  • [0, 0] A one-dimensional array with two indexes for longitude and latitude respectively.
  • ["0", "0"] A one-dimensional array with two indexes for longitude and latitude respectively.
  • "0,1" A string with longitude and latitude divided by a comma.
  • {lng: Function, lat: Function} An object with two functions returning longitude and latitude.
  • {lon: 0, lat: 1} An object with two keys: lat and lon.
  • {lng: 0, lat: 1} An object with two keys: lat and lng.
  • {x: 0, y: 1} An object with two keys: x as longitude and y as latitude.
  • {longitude: 0, latitude: 1} An object with two keys: longitude and latitude.
options.protocol
"http" | "https"
default:"https"

The protocol type to be used in the calls.


Represents the type of protocol used to perform a service call.
options.radius
Number
default:None

A positive integer value in meters.


This option specifies the search radius in meters using the coordinates given to the center option as origin.

Methods

go( ): Promise

Executes a predefined asynchronous task using the current configuration.

Returns