Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

前置要求

如果使用 Martin 连接 PostgreSQL 数据库,您必须安装 PostGIS v3.0+。推荐使用 PostGIS v3.1+。

Docker

Martin 也可作为 Docker 镜像使用。您可以通过 -v 参数将主机上的配置文件共享给容器,或者让 Martin 自动发现所有源,例如通过传递 DATABASE_URL 或指定 .mbtiles/.pmtiles 文件或 .pmtiles 的 URL。

export PGPASSWORD=postgres  # 密码!

docker run -p 3000:3000 \
           -e PGPASSWORD \
           -e DATABASE_URL=postgres://user@host:port/db \
           -v /path/to/config/dir:/config \
           ghcr.io/maplibre/martin:0.20.2 \
           --config /config/config.yaml

手动从二进制发行版安装

您可以从 GitHub 发布页面下载 martin。

平台x64ARM-64
Linux.tar.gz (gnu)
.tar.gz (musl)
.deb
.tar.gz (gnu)
.tar.gz (musl)
macOS.tar.gz.tar.gz
Windows.zip

Rust 用户可以使用 cargo-binstall 和 cargo 安装预构建的 martin 二进制文件。

cargo install cargo-binstall
cargo binstall martin
martin --help

从软件包安装

要使用 apt 源和其他方式安装,我们需要您的帮助来改进各种平台的打包。

Homebrew

如果您使用 macOS 和 Homebrew,可以使用 Homebrew tap 安装 martin。

brew tap maplibre/martin
brew install martin
martin --help

手动安装 Debian 软件包 (x86_64)

curl -O https://github.com/maplibre/martin/releases/latest/download/martin-Debian-x86_64.deb
sudo dpkg -i ./martin-Debian-x86_64.deb
martin --help
rm ./martin-Debian-x86_64.deb

从源码构建

如果您安装了 Rust,可以使用 Cargo 从源码构建 martin:

cargo install martin --locked
martin --help