MapLibre Native Documentation

repository·main·Indexed 24 days ago

https://github.com/maplibre/maplibre-native

An open-source library for high-performance, GPU-accelerated vector tile map rendering. Supports mobile (Android, iOS), desktop (Qt, Linux, Windows, macOS), and Node.js platforms. Version 5.4.0.

Tokens
81.1K
Snippets
162
Records
446
Agent score
85%

What's inside MapLibre Native

  1. Overview of MapLibre Native for iOS

    main

    MapLibre Native is a powerful, free, and open-source map rendering toolkit for iOS. It serves as an alternative to Apple's MapKit, providing developers with full control over data sources and map styling.

    Key capabilities include:

    • Full control over data sources and styling.
    • Support for various data formats like GeoJSON and PMTiles.
    • Offline map support.
    • Advanced styling via the MapLibre Style Spec.

    For detailed information on creating and modifying map styles, refer to the MapLibre Style Spec documentation.

  2. Overview of the MapLibre Metal Port Proposal

    main
    The Metal Port proposal aims to transition MapLibre Native's iOS and macOS rendering from the deprecated OpenGL SDK to Metal. This is being implemented as part of a broader 'Rendering Modularization' effort, which allows the toolkit to support multiple rendering SDKs (like OpenGL and Metal) as plugins. The goal is to provide a high-performance Metal implementation that follows the modular rendering patterns while maintaining compatibility with existing OpenGL implementations via compile-time flags.
  3. Supported Platforms for MapLibre Native

    main

    MapLibre Native is available across multiple platforms, primarily managed within a single monorepo.

    • Android: Integrates with the C++ core via JNI. Located in platform/android.
    • iOS: Integrates with the C++ core via Objective-C++. Located in platform/ios and platform/darwin.
    • Linux: Used for development and production raster tile generation. Located in platform/linux.
    • Windows: Located in platform/windows.
    • macOS: Mainly used for development; contains some legacy AppKit code. Located in platform/macos and platform/darwin.
    • Node.js: Uses NAN. Available on npm as @maplibre/maplibre-gl-native. Located in platform/node.
    • Qt: Partially split into a separate repository. Located in platform/qt and maplibre/maplibre-qt.

    Android and iOS are considered core projects of the MapLibre Organization.

  4. Understand the MapLibre Rendering Modularization Proposal

    main

    The rendering modularization design proposal aims to transition MapLibre Native from a dependency on OpenGL to a modular architecture that supports multiple rendering SDKs (such as Metal for iOS, Vulkan for Android, or Direct3D for Windows).

    Key objectives include:

    • Simplifying Metal migration on iOS: Reducing the overhead required to move away from deprecated OpenGL support.
    • Extensibility: Allowing developers to modify visual rendering, replace layer rendering logic, and add new visual representations (e.g., animated markers) more easily.
    • Modular Shaders: Organizing shader (program) code within the maplibre-native repository so that individual shaders can be replaced without impacting others, moving away from compiling directly from WebGL source.
    • Style-driven Rendering: Enabling style sheets to specify specific visual representations for layers beyond the defaults.
    • Compile-time Optimization: Allowing unused layer types to be dropped via compile flags to manage binary size.
  5. What is Feature State and when to use it

    main

    Feature state allows you to attach runtime JSON values to individual features within a map source. These values can then be read back inside style expressions to create interactive, data-driven UI.

    Common use cases include:

    • Selection: Highlighting a specific feature when tapped.
    • Highlighting: Changing the visual appearance of a feature based on user interaction.
    • Temporary Analysis: Storing transient state for data analysis without modifying the underlying source data.