The lightweight and modern Map SDK for Android and iOS

Overview

Open Mobile Maps




The lightweight and modern Map SDK for Android (6.0+) and iOS (10+)

openmobilemaps.io

Getting started

Readme Android

Readme iOS

Features

  • Multi-platform graphics engine based on OpenGL for Android and Metal for iOS
  • Touch and gesture handling
  • Tiled Map Layers
  • Polygon Layers

...and more to come! See our roadmap at openmobilemaps.io

Architecture

To support both the Android and iOS, most of the code-base is written in C++ and shared between the two platforms. The Kotlin and Swift interface bindings are generated with a fork of the Djinni library. The library intentionally is designed to have a modular structure, so that most parts of it can be adjusted or completely replaced with custom implementations. Most of the interfaces are also exposed to Swift and Kotlin, so extensions can also conveniently be programmed in those languages.

The internal structure of the project is split into two main modules: the graphics-core and the maps-core. While the first implements a generic structure for rendering basic graphic primitives on Android and iOS, the latter is a collection of classes that provide the basics for creating a digital map.

Graphics Core

MapCore diagram

The rendering concept in the graphics core is built around generic graphics primitives to achieve a versatile base structure. While the basic logic for organizing the primitives is shared, the implementations of those graphics object interfaces are platform-specific. For Android, the OpenGL code is kept in C++, while the Metal-implementations for iOS are written in Swift. The SceneInterface is the shared, central collection of the necessary interfaces for both creating and rendering such graphics objects.

Maps Core

MapCore diagram

Building on top of the graphics core, the MapCore wraps the generic render code into a more accessible collection of higher-level classes with the functionality to build and display a digital map.

MapView

On both platforms, the MapView builds the central ui element that can directly be added to the app and be interacted with. It handles the interactions between each platform and the shared library, the lifecycle of the view, as well as setting up relevant platform-specific components and exposing the necessary methods for manipulating all elements of the map.

MapScene

The MapScene, implementing the MapInterface, holds the necessary resources for interacting with the underlying render system and creating the graphics primitives, but also builds the main access point for the other components that are relevant for a functioning map. For instance, the map requires a configuration file, a camera, a touch handler and others. The MapScene also holds the collection of all layers in the scene and provides the necessary methods to adjust it.

Map Configuration & Coordinates

When setting up the map, a coordinate system for it needs to be specified. In the current implementation, the system is assumed to be a uniform, two-dimensional grid.

All map positions handled within maps core are of the type Coord. Along with the three-dimensional position values, it holds a coordinate system identifier with the purpose of specifically exposing to the system in which the values should be interpreted at that time. To switch between different coordinate systems, the MapScene holds a CoordinateConversionHelper. This helper uses pre-defined and additionally registered custom converters to transform coordinates between two systems, specified by their system identifier.

This library comes with the implementations for two prominent coordinate systems: EPSG:2056 (LV95/LV03+) and EPSG:3857 (Pseudo-Mercator). They can be created using the CoordinateSystemFactory.

Camera & Interaction

The camera attached to the MapScene defines the section of the map that is rendered when a frame is drawn. It also handles and interprets interaction events passed to it by a TouchHandler. MapCore contains an implementation for a simple orthographic camera moving in the x/y-plane and a DefaultTouchHandler for a matching gesture recognition. The camera component offers an interface for querying and setting its current position in the space defined by the map's coordinate system.

Layers

The graphical content displayed in the MapScene is grouped in layers. A layer contains one to many LayerObjects. These are collections of the information necessary to place a graphics primitive in the maps coordinate space and that define their appearance. Before a new frame is drawn, the MapScene queries all added layers for a configuration, specifying which graphics need to be drawn in which respective order.

Two layer types are available with MapCore: Tiled2dMapRasterLayer and PolygonLayer.

TiledRasterLayer

The content of most digital maps is split into hierarchical layers of map tiles. This layer supports both the loading and displaying of the relevant tiles for a given camera position and zoom-value. On creation of such a layer, a Tiled2dMapLayerConfig needs to be defined. It specifies the layers coordinate system by setting the bounds coordinates, as well as the different zoom layers and provides the url/identifier for loading the tiles.

In addition to the configuration, an implementation of the TextureLoaderInterface needs to be supplied. A default implementation to load tiles from a given URL is contained in maps core on both platforms.

PolygonLayer

The PolygonLayer provides an interface to create and draw uniformly colored polygons in the map space.

License

This project is licensed under the terms of the MPL 2 license. See the LICENSE file.

Comments
  • Basic Tiled Vector Layer

    Basic Tiled Vector Layer

    Improved version of a vector layer with basic support for mapbox style specifications, including multiple bugfixes and improvements for OpenMobileMaps in general.

    opened by maurhofer-ubique 0
  • Feature: multiple loaders

    Feature: multiple loaders

    This allows passing multiple LoaderInterfaces to a TiledLayers. All loaders are tried to load a given tile starting with the first one in the array. If the loader returns a NOOP error the tile will be tried to be loaded with the next loader. This has the advantage that loaders with high latency (network loader) will not clog up the loading queue of low latency loader (local storage).

    Additionally the tiledMutex of Tiled2dMapSource was replaced with multiple fine-grained locks.

    opened by stmitt 0
  • fixes metal crash when attempting to load empty texture

    fixes metal crash when attempting to load empty texture

    Now the behavior is the same as on android.

    Crash Stacktrace:

    Crashed: com.apple.mtktextureloaderload
    0  MetalKit                       0xd68c +[MTKTextureLoaderKTX isKTXFile:] + 28
    1  MetalKit                       0x9fcc -[MTKTextureLoader _determineFileType:] + 40
    2  MetalKit                       0xa380 -[MTKTextureLoader _loadData:options:uploader:label:completionHandler:] + 72
    3  MetalKit                       0xa0d0 -[MTKTextureLoader _loadData:options:completionHandler:] + 164
    4  MetalKit                       0x94a8 __65-[MTKTextureLoader newTextureWithData:options:completionHandler:]_block_invoke + 56
    5  libdispatch.dylib              0x1e6c _dispatch_call_block_and_release + 32
    6  libdispatch.dylib              0x3a30 _dispatch_client_callout + 20
    7  libdispatch.dylib              0x6eec _dispatch_continuation_pop + 500
    8  libdispatch.dylib              0x6558 _dispatch_async_redirect_invoke + 584
    9  libdispatch.dylib              0x15164 _dispatch_root_queue_drain + 396
    10 libdispatch.dylib              0x1596c _dispatch_worker_thread2 + 164
    11 libsystem_pthread.dylib        0x1080 _pthread_wqthread + 228
    12 libsystem_pthread.dylib        0xe5c start_wqthread + 8```
    opened by stmitt 0
  • IllegalStateException

    IllegalStateException

    During runtime we discovered this exception within our crashlytics, we're using the lib-open-swiss-maps-sdk version 1.1.4:

    Fatal Exception: java.lang.IllegalStateException: GpsLayer is already destroyed! at io.openmobilemaps.gps.GpsLayer.requireLayerInterface(GpsLayer.kt:1) at io.openmobilemaps.gps.GpsLayer.onCompassUpdate(GpsLayer.kt:1) at io.openmobilemaps.gps.compass.CompassProvider.onSensorChanged(CompassProvider.kt:11) at android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent(SystemSensorManager.java:982) at android.os.MessageQueue.nativePollOnce(MessageQueue.java) at android.os.MessageQueue.next(MessageQueue.java:335) at android.os.Looper.loopOnce(Looper.java:186) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8669) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java

    With the following Device: Samsung Galaxy A52 with Android 12

    opened by tdascoli 0
  • RUN TIME ERROR

    RUN TIME ERROR

    JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.ClassNotFoundException: Didn't find class "io.openmobilemaps.mapscore.shared.MapsCoreSharedModule$CppProxy" on at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:230)

    MY CODE IS : FRAGMENT: binding.mapViewDealers.setupMap(MapConfig(CoordinateSystemFactory.getEpsg3857System())) binding.mapViewDealers.registerLifecycle(lifecycle)

    XML: <io.openmobilemaps.mapscore.map.view.MapView android:id="@+id/mapViewDealers" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" />

    opened by mohammedelnady 0
Releases(1.4.1)
  • 1.4.1(Aug 16, 2022)

    • iOS: updates device to ppi mapping
    • iOS: fixes masked line groups
    • iOS: fixes bug that caused the map to be cropped if display zoom is enabled
    • iOS: fixes metal crash when attempting to load empty texture
    • fixes a error in MapCamera2d::getPaddingCorrectedBounds

    Full Changelog: https://github.com/openmobilemaps/maps-core/compare/1.4.0...1.4.1

    Source code(tar.gz)
    Source code(zip)
  • 1.4.0(Jun 20, 2022)

    • Includes earcut.hpp dependency for polygon triangulation
    • Adds polygon and line group rendering objects which can be used to efficiently render many objects with a limited number of styles
    • Expands line style options
    • Adds masking methods to the layerInterface
    • Adds scissoring methods to the layerInterface
    • Adds option to display tiled raster layer density dependent
    • Adds off screen rendering helpers
    • Many improvements and bugfixes
    Source code(tar.gz)
    Source code(zip)
  • 1.3.3(Aug 16, 2021)

  • 1.3.2(Aug 13, 2021)

  • 1.3.1(Aug 11, 2021)

  • 1.3.0(Apr 19, 2021)

    • Native library and relevant header files are now properly included in the published dependency
    • Added a Circle2dLayerObject
    • Bugfixes & improvements
    • Fixes iOS retain cycle
    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(Mar 3, 2021)

    • Add WMTS capability parsing capabilities
    • Add icon layer implementation
    • implemented camera movement inertia
    • improves animation handling
    • bugfixes and improvements
    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Feb 28, 2021)

  • 1.0.0(Feb 19, 2021)

Owner
Open Mobile Maps
The Lightweight And Modern Map SDK
Open Mobile Maps
Indexes points and lines and generates map tiles to display them

Datamaps This is a tool for indexing large lists of geographic points or lines and dynamically generating map tiles from the index for display. Depend

Eric Fischer 331 Sep 8, 2022
iOS 10.x 32 and 64 bit jailbreak with spicy autoexecution

ap0110 ap0110 is an autoexecuting jailbreak for iOS 10.x, on 32 and 64-bit. Developed by the Athenus Dev Team and w212. <3 Credits tihmstar - h

Athenus Dev Team 22 Aug 24, 2022
A cross-platform protocol library to communicate with iOS devices

libimobiledevice A library to communicate with services on iOS devices using native protocols. Features libimobiledevice is a cross-platform software

libimobiledevice 5.2k Oct 6, 2022
A WIP "Vulnerable by Design" kext for iOS/macOS to play & learn *OS kernel exploitation

Vulnerable Kext A WIP (work-in progress) "Vulnerable by Design" kext for iOS/macOS to play/learn with *OS kernel exploitation Usage Documentation can

Chaithu 219 Sep 3, 2022
Random stuff about lower level iOS

Lower Level iOS Random stuff about lower level iOS Topics Macho Parser - study note of Mach-O format Dynamic Linking Exported Symbol - details of how

Qing Yang 93 Sep 26, 2022
Open Source iOS 15 Jailbreak Project

Fugu Fugu is the first open source jailbreak tool based on the checkm8 exploit. UPDATE: Fugu will now install Sileo, SSH and Substitute automatically!

epeth0mus 172 Oct 5, 2022
Unofficial C++ beta SDK for the top.gg API.

topgg-cpp-sdk (Beta) Unofficial C++11 beta SDK for the top.gg API. Please note that the library is currently not completed yet! Requirements: libcurl

7 Nov 16, 2021
Modify Android linker to provide loading module and hook function

fake-linker Chinese document click here Project description Modify Android linker to provide loading module and plt hook features.Please check the det

sanfengAndroid 205 Sep 26, 2022
Juice the carrots from ウマ娘プリティーダービー (Umamusume Pretty Derby) - Android implementation

Riru-CarrotJuicer Hooks the decryption function in libnative.so of ウマ娘プリティーダービー (Umamusume Pretty Derby), to allow inspecting the packets. For Windows

Huang Yue 27 Aug 9, 2022
A simple library to expose the linker namespace functionality in Android 9+ together with symbol hooking

Android Linker Namespace Bypass Library Provides access to the hidden linker namespace functionality in Android 9+ and exposes an interface for hookin

Billy Laws 9 Jul 28, 2022
Simple and lightweight pathname parser for C. This module helps to parse dirname, basename, filename and file extension .

Path Module For C File name and extension parsing functionality are removed because it's difficult to distinguish between a hidden dir (ex: .git) and

Prajwal Chapagain 3 Feb 25, 2022
MMUit is a lightweight toolkit to explore and modify address translation for ARM64.

Overview MMUit is a lightweight toolkit to explore and modify address translation for ARM64. C/C++ interface detailed information on VA, TTE, TCR etc

Alexander Hude 37 Feb 13, 2022
The goal of arrowvctrs is to wrap the Arrow Data C API and Arrow Stream C API to provide lightweight Arrow support for R packages

The goal of arrowvctrs is to wrap the Arrow Data C API and Arrow Stream C API to provide lightweight Arrow support for R packages to consume and produce streams of data in Arrow format. Right now it’s just a fun way for me to learn about Arrow!

Dewey Dunnington 30 Aug 5, 2022
match(it): A lightweight header-only pattern-matching library for C++17 with macro-free APIs.

match(it): A lightweight header-only pattern-matching library for C++17 with macro-free APIs. Features Easy to get started. Single header library. Mac

Bowen Fu 413 Sep 26, 2022
Lightweight state machine implemented in C++

Intro This is my second take on C++ state machine implementation. My first attempt can be found here. The main goals of the implementation are: No dyn

Łukasz Gemborowski 20 Jul 14, 2022
An attempt to restore and adapt to modern Win10 version the Rootkit Arsenal original code samples

rootkit-arsenal-guacamole An attempt to restore and adapt to modern Win10 version the Rootkit Arsenal original code samples All projects have been por

Matteo Malvica 52 Sep 24, 2022
A compile-time enabled Modern C++ library that provides compile-time dimensional analysis and unit/quantity manipulation.

mp-units - A Units Library for C++ The mp-units library is the subject of ISO standardization for C++23/26. More on this can be found in ISO C++ paper

Mateusz Pusz 641 Sep 30, 2022
The most powerful and customizable binary pattern scanner written on modern C++

Sig The most powerful and customizable binary pattern scanner written on modern C++ ✔ Capabilities: Support for all common pattern formats: Pattern +

Александр 142 Sep 29, 2022
A Template Engine for Modern C++

Inja is a template engine for modern C++, loosely inspired by jinja for python. It has an easy and yet powerful template syntax with all variables, lo

pantor 1.2k Sep 30, 2022