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 将根据 MapLibre 渲染库的需要提供您的样式。

要编辑这些样式,我们建议使用 https://maputnik.github.io/editor/。

API

Martin 可以提供 MapLibre 样式规范。 目前,Martin 将使用任何有效的 JSON 文件作为样式, 但将来,我们可能会优化 Martin,这可能会导致额外的限制。

使用 /catalog API 查看所有 <style_id>。

地图样式

使用 /style/<style_id> API 获取 <style_id> 的 JSON 内容。

样式的更改或删除会立即反映,但添加不会。 需要重启 Martin 才能看到新样式。

服务器端栅格瓦片渲染

warning

此功能目前不稳定,因此未包含在默认构建中。 其行为可能会在补丁版本中发生变化。

要尝试它,安装 Rust 并运行 just install-dependencies。 安装完这些后,运行以下命令以安装带有不稳定功能的 martin:

cargo build --features=unstable-rendering

由于当前实现的限制,它不稳定:

我们欢迎贡献以帮助稳定此功能!

我们支持为给定样式的 XYZ 瓦片生成栅格化图像。

为此,您需要在配置文件中启用该功能:

styles:
    rendering: true

完成后,您可以使用 /style/<style_id>/{z}/{x}/{y}.{filetype} API 获取 <style_id> 的渲染 png/jpeg 内容。

静态图像准备

我们目前没有与 Tileserver-GL 相同的能力来布局图像。 我们正在努力添加此功能,并非常欢迎贡献。