This is the documentation of version 0.48.0. Go to the latest version, 1.0.0-rc.5.

How the SDK works

Your ApplicationMapLibre GL JSMaps SDK for JavaScriptMapServicesCore

Overview

The Maps SDK for JavaScript is built around two core capabilities that can work independently or together:

  1. Map display and interaction - Render and interact with TomTom maps in your web applications
  2. Location-based services - Access TomTom's APIs for search, routing, geocoding, and more

This flexible architecture allows you to use only what you need, whether that's displaying maps, accessing location services, or combining both for full-featured mapping applications.

Map display and interaction

Render TomTom interactive maps in your web applications with:

Location-based services

Access TomTom's location APIs with:

Architecture

The SDK is organized into three modular bundles for flexibility and maintainability:

This separation enables tree-shaking, keeping your application lightweight by including only the features you use.

Map

The Map bundle handles all map rendering and interaction in the browser, built on top of MapLibre GL JS for high-performance, customizable map experiences.

While MapLibre provides the rendering foundation, the Map bundle enhances it with TomTom-specific features and seamless integrations.

Map foundations

  1. TomTomMap: A lightweight wrapper around MapLibre's Map class that simplifies initialization with TomTom configurations, styles, and optimizations
  2. Modules: Tree-shakable components that extend TomTomMap functionality, allowing you to include only what you need

This modular design promotes tree-shaking, since your code only includes the modules you use.

You can learn more about the Map bundle in the Map Introduction Guide.

Services

The Services bundle provides easy-to-use functions that integrate with TomTom's JSON APIs, enabling powerful location-based features:

Service key features

The Services bundle is perfect for server-side applications, CLI tools, or any scenario where you need location data without map visualization.

Core

The Core bundle acts as the foundation that connects the Map and Services bundles, containing:

By centralizing shared logic and types, the Core module promotes code reuse and consistency across the SDK.

Learn more in the Core Quickstart Guide.

Next Steps

Now that you understand how the SDK is structured, you can choose the approach that best fits your needs:

Choose your path

The SDK's modular architecture allows you to build robust mapping applications by combining interactive maps with powerful location services, all while benefiting from a modular and maintainable codebase that promotes tree-shaking.

Map only - Display your own data on TomTom maps

Services only - Access location-based features across platforms

Map + Services - Build full-featured mapping applications