Overview
The Open Mobile Maps SDK is designed to support both Android and iOS platforms through a shared C++ codebase. Most of the library is written in C++, with platform-specific bindings generated for Kotlin (Android) and Swift (iOS) using a fork of the Djinni library. The SDK is intentionally modular, allowing most components to be adjusted or completely replaced with custom implementations. Interfaces are exposed to Swift and Kotlin, enabling developers to write extensions in those languages.Two-Module Architecture
The SDK is split into two main modules:Graphics Core
Generic rendering structure for basic graphic primitives
Maps Core
Higher-level classes for building and displaying digital maps
Graphics Core
The Graphics Core implements a generic structure for rendering basic graphic primitives on both Android and iOS. It provides a versatile base for the mapping functionality.Cross-Platform Rendering
The rendering concept is built around generic graphics primitives:- Shared Logic: Core logic for organizing primitives is written in C++
- Platform-Specific Implementations: Graphics object interfaces have platform-specific implementations
- Android: OpenGL code is kept in C++
- iOS: Metal implementations are written in Swift
SceneInterface
TheSceneInterface is the central, shared collection of interfaces for both creating and rendering graphics objects. It provides methods for:
The Graphics Core can be used independently for any graphics rendering needs, not just maps.
Maps Core
Building on top of the Graphics Core, the Maps Core wraps the generic render code into a more accessible collection of higher-level classes with functionality to build and display a digital map.MapView
On both platforms, theMapView is the central UI element that:
- Can be directly added to your app
- Handles interactions between each platform and the shared library
- Manages the lifecycle of the view
- Sets up relevant platform-specific components
- Exposes methods for manipulating all elements of the map
MapScene
TheMapScene (implementing MapInterface) is the main access point for map functionality:
MapScene provides:
- Resources for interacting with the underlying render system
- Methods for creating graphics primitives
- Configuration management (coordinate system, camera, touch handler)
- Collection of all layers in the scene
- Methods to manipulate the layer collection
Key Components
The Maps Core integrates several essential components:Platform Bindings
The C++ shared core is exposed to native platforms through generated bindings:Android (Kotlin)
iOS (Swift)
The Djinni generator ensures that the API is consistent across platforms while respecting platform-specific conventions.
Benefits of the Architecture
Code Sharing
Code Sharing
Most functionality is written once in C++ and shared across platforms, reducing duplication and maintenance.
Performance
Performance
C++ provides native performance, while platform-specific rendering implementations leverage Metal and OpenGL optimally.
Flexibility
Flexibility
Modular design allows you to replace or extend any component, either in C++ or in Kotlin/Swift.
Platform Integration
Platform Integration
Native bindings ensure seamless integration with Android and iOS ecosystems.
Next Steps
Coordinate Systems
Learn about supported coordinate systems
Layers
Understand the layer system
Camera
Explore camera concepts and controls