/maplibre-native-qt

MapLibre Native Qt Bindings and Qt Location Plugin

Primary LanguageC++

MapLibre Logo

maplibre-native-qt

MapLibre Native Qt bindings and Qt Location MapLibre Plugin

Important notice: the repository and code have been reorganised for Qt 6.5 support. Version 3.0 is a major release that includes a lot of build-related changes and improvements and is not backwards compatible.

Qt support

This library fully supports Qt 6.5 and newer. Qt 5.15 is fully supported only on desktop platforms, previous Qt 5 versions down to 5.6 only support widgets but not Qt Location.

Get and build

The project uses submodules, so you need to clone it with the following commands:

git clone https://github.com/maplibre/maplibre-native-qt.git
cd maplibre-native-qt
git submodule update --init --recursive

(On some file systems, the submodule update may yield a Filename too long error which can be ignored.)

For more details on building the project, see How to build.

How to use?

Once installed QMapLibre can be used in any Qt and CMake project. Two example projects based on Qt 6 are available in the examples directory.

To build an example, run the following commands:

export QMapLibre_DIR="<absolute-path-to-install>"
cmake --workflow --preset default

or alternatively

mkdir build-example && cd build-example
qt-cmake ../maplibre-native-qt/examples/<example> -GNinja \
  -DCMAKE_C_COMPILER_LAUNCHER="ccache" \
  -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
  -DCMAKE_PREFIX_PATH="<absolute-path-to-install>"
ninja

For more details on using the library, see Usage.

Copyright

Copyright (C) 2023 MapLibre contributors

The core library may be used under 2-Clause BSD License. QML bindings may be used under the terms of either GNU General Public License version 2.0, GNU General Public License version 3.0 or GNU Lesser General Public License version 3.0. Examples are licensed under MIT. Full texts of the licenses can be found in the LICENSES directory.

Each file contains corresponding license information with SPDX license identifiers to clarify how it can be used.