Skip to content

feat: support martin tile server catalog format#105

Merged
ThomasHalwax merged 1 commit intomainfrom
feature/martin-tile-server-support
Mar 6, 2026
Merged

feat: support martin tile server catalog format#105
ThomasHalwax merged 1 commit intomainfrom
feature/martin-tile-server-support

Conversation

@axel-krapotke
Copy link
Copy Markdown
Contributor

Closes #104

Changes

Adds automatic detection of the martin tile server catalog format in fetchCapabilities().

Detection Logic

The JSON response is checked in order:

  1. Array → mbtileserver format (existing)
  2. Object with tiles key (non-array) → martin catalog format (new)
  3. Object with tiles array → single TileJSON document (existing)

Martin Catalog Mapping

Martin's /catalog response:

{"tiles": {"NAME": {"content_type": "image/png", "name": "...", "description": "..."}}}

Is normalized to the internal TileJSONDiscovery format:

[{"name": "...", "imageType": "png", "url": "http://host:port/NAME", "description": "..."}]

The /catalog suffix is stripped from the base URL when constructing individual tileset URLs.

Testing

Tested locally with both mbtileserver and martin serving the same tilesets — both produce identical layer lists in ODIN.

Detect martin catalog response ({tiles: {name: {content_type, ...}}})
in addition to mbtileserver format ([{imageType, url, name}]).
Both are normalized to the internal TileJSONDiscovery adapter format.

The martin catalog URL is auto-resolved: /catalog suffix is stripped
when constructing individual tileset TileJSON URLs.

Closes #104
@ThomasHalwax ThomasHalwax merged commit afaabf4 into main Mar 6, 2026
1 check passed
@ThomasHalwax ThomasHalwax deleted the feature/martin-tile-server-support branch March 23, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support martin tile server catalog format in addition to mbtileserver

2 participants