Hello Map
This example demonstrates how to create a basic interactive map using the Maps SDK for TypeScript.
Overview
The example demonstrates the following features:
- Initializing the Maps SDK for TypeScript
- Creating and displaying an interactive map
- Basic map container setup
Code Implementation
Initialize GemKit and create a map
Live Demo
HTML Structure
Add a container element for the map in your HTML:
Key Features
- Simple Setup: Minimal code required to display a map
- Async Initialization: GemKit initializes asynchronously for optimal performance
- View Management: Each map view has a unique ID for managing multiple maps
- Callback Pattern: Map instance is provided via callback when ready
Explanation of Key Components
- GemKit.initialize(): Initializes the SDK with your API token and returns a GemKit instance
- createView(): Creates a map view with a unique ID and returns a wrapper element
- Map Callback: The callback function receives the
GemMapinstance when ready - Container Element: A DOM element where the map will be rendered
Next Steps
- Center Coordinates - Control map camera position
- Map Gestures - Handle user interactions