install bazelisk (required for ios builds):
bazeliskclone maplibre-native with submodules at a specific commit: (TODO: maybe there's a better way to do this?)
git clone https://github.com/maplibre/maplibre-native \
--filter=blob:none \
--no-checkout \
third-party/maplibre-native
cd third-party/maplibre-native
git checkout 29428dce42000484d387ffc7825326faf35c093d
git submodule update --init --recursive --depth 1
clean build artifacts:
- install
cmake - Create a new python env with e.g.
venv.
./tool/clean_build.pybuild the dynamic libraries (by default, builds in RelWithDebInfo):
./tool/build-libraries.py # build everything
./tool/build_libraries.py ios
./tool/build_libraries.py macos
./tool/build_libraries.py android
./tool/build-libraries.py --verbose # see build outputgenerate style code:
./tool/generate_style.dartrun ffigen:
./tool/ffigen.pytesting only: create a example/lib/keys.dart file and add your style url/api key:
const styleUrl = 'https://api.maptiler.com/maps/streets-v4-dark/style.json?key=x';
const apiKey = 'x';run the project:
cd example
flutter runlib - Dart code
src - C/C++ code (copied over to third-party/maplibre-native/platform/flutter) during builds
tool - build scripts
ios/flmln/Sources and macos/flmln/Sources - Swift code for texture interfacing with Flutter (NOTE: those two folders are almost exactly the same! i couldn't find a way to share them in a Darwin folder.)
android/src/main - contains some Java code from MapLibre native (some Android stuff uses JNI to use Java objects from C++ code)