Guidance

The guidance parameter enables turn-by-turn navigation instructions in route responses. When specified, the calculated route includes detailed maneuvers, road names, distances, and optional phonetic pronunciations for voice guidance.

Basic Usage

Request guidance instructions with default settings:

import { calculateRoute } from '@tomtom-org/maps-sdk/services';
const route = await calculateRoute({
locations: [[4.9041, 52.3676], [2.3522, 48.8566]],
guidance: {
type: 'coded'
}
});

Configuration

Instruction Format

Currently only 'coded' format is supported:

const route = await calculateRoute({
locations: [[4.9041, 52.3676], [2.3522, 48.8566]],
guidance: {
type: 'coded',
}
});

Phonetic Transcriptions

Include phonetic pronunciations for street names to enable accurate voice guidance:

// International Phonetic Alphabet (default)
const route = await calculateRoute({
locations: [[4.9041, 52.3676], [2.3522, 48.8566]],
guidance: {
type: 'coded',
phonetics: 'IPA'
}
});
// Language-specific phonetic representation
const route = await calculateRoute({
locations: [[4.9041, 52.3676], [2.3522, 48.8566]],
guidance: {
type: 'coded',
phonetics: 'LHP'
}
});

Available phonetic formats:

  • IPA - International Phonetic Alphabet (default)
  • LHP - Language-specific phonetic representation

Road Shield References

Include references to road sign images for visual display:

const route = await calculateRoute({
locations: [[4.9041, 52.3676], [2.3522, 48.8566]],
guidance: {
type: 'coded',
roadShieldReferences: 'all'
}
});

When enabled, the response includes references to road shield images that can be fetched from the TomTom Road Shield API.

Accessing Guidance Data

Route instructions are included in the response properties:

const route = await calculateRoute({
locations: [[4.9041, 52.3676], [2.3522, 48.8566]],
guidance: {
type: 'coded'
}
});
// Access guidance instructions
const instructions = route.features[0].properties.guidance?.instructions;

API Reference

For complete documentation of all route guidance properties and types, see the GuidanceParams API Reference .