Skip to main content

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

The SceneInterface is the central, shared collection of interfaces for both creating and rendering graphics objects. It provides methods for:
class SceneInterface {
public:
    virtual void setCamera(const std::shared_ptr<CameraInterface> & camera) = 0;
    virtual std::shared_ptr<CameraInterface> getCamera() = 0;
    virtual std::shared_ptr<RendererInterface> getRenderer() = 0;
    virtual void drawFrame(const std::shared_ptr<RenderTargetInterface> & target) = 0;
    // ...
};
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, the MapView 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

The MapScene (implementing MapInterface) is the main access point for map functionality:
class MapInterface {
public:
    virtual void addLayer(const std::shared_ptr<LayerInterface> & layer) = 0;
    virtual void setCamera(const std::shared_ptr<MapCameraInterface> & camera) = 0;
    virtual std::shared_ptr<MapCameraInterface> getCamera() = 0;
    virtual void drawFrame() = 0;
    // ...
};
The 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:
1

Configuration

Map coordinate system and configuration settings
2

Camera

Defines the visible section and handles interactions
3

Layers

Organizes graphical content in the scene
4

Touch Handler

Processes user interactions

Platform Bindings

The C++ shared core is exposed to native platforms through generated bindings:

Android (Kotlin)

val mapView = MapView(context)
val mapInterface = mapView.getMapInterface()
mapInterface.addLayer(myLayer)

iOS (Swift)

let mapView = MapView()
let mapInterface = mapView.getMapInterface()
mapInterface.addLayer(myLayer)
The Djinni generator ensures that the API is consistent across platforms while respecting platform-specific conventions.

Benefits of the Architecture

Most functionality is written once in C++ and shared across platforms, reducing duplication and maintenance.
C++ provides native performance, while platform-specific rendering implementations leverage Metal and OpenGL optimally.
Modular design allows you to replace or extend any component, either in C++ or in Kotlin/Swift.
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

Build docs developers (and LLMs) love