Skip to main content

Routing & Navigation Examples

|

Explore interactive examples demonstrating routing and navigation features of the Maps SDK for TypeScript. Each example includes a live demo that you can interact with directly in your browser.

Getting Started

All examples follow a similar pattern:

  1. Initialize the SDK with your API token
  2. Create a map view in your HTML container
  3. Implement the feature using SDK methods
  4. Update the UI based on events and callbacks

Example Structure

Each example page includes:

  • Live Demo: An interactive iframe where you can test the feature
  • Code Snippets: Highlighted code blocks showing the implementation
  • Explanation: Description of how the feature works
  • Key Features: Summary of what you'll learn

Running Examples Locally

To run these examples in your own project:

# Install the SDK
npm install @magiclane/maps-sdk

Important: Before running any example, you need to add your API token:

  1. Open the src/token.js file in the example folder
  2. Replace the token placeholder with your actual token:
export const GEMKIT_TOKEN = "YOUR_API_TOKEN_HERE";

Then start your development server:

npm start