Skip to content

Add WMS support for EPSG:3857#282

Open
jcarbou wants to merge 3 commits into
sakitam-fdd:masterfrom
jcarbou:Add_WMS_EPSG_3857_suport
Open

Add WMS support for EPSG:3857#282
jcarbou wants to merge 3 commits into
sakitam-fdd:masterfrom
jcarbou:Add_WMS_EPSG_3857_suport

Conversation

@jcarbou
Copy link
Copy Markdown

@jcarbou jcarbou commented Apr 30, 2026

First thank you for your library !

I need to access to images from Maplibre using WMS protocole. I modified gl-core module using the same syntax as in Maplibre WMS layer. I use the {bbox-epsg-3857} pattern replace by the WMS bbox at runtime. Request example :

http://myWmsServer/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&TRANSPARENT=true&LAYERS=myWindLayer&STYLES=default&WIDTH=256&HEIGHT=256&FORMAT=image/png&BBOX={bbox-epsg-3857}&CRS=EPSG:3857

I also add a example in README of maplibre-wind

Summary by CodeRabbit

  • New Features

    • WMS-compatible tile sources: URL templates can use a Web Mercator BBOX variable.
    • Tile source URL variables now accept hyphenated names and merge built-in defaults with user-provided URL data.
  • Documentation

    • Added README example demonstrating a WMS-backed tile layer and parameter configuration.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 30, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 473b90b4-f9be-4138-8725-d43d5a1a40a2

📥 Commits

Reviewing files that changed from the base of the PR and between 492647c and 84de2ea.

📒 Files selected for processing (1)
  • packages/gl-core/src/source/urlData.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/gl-core/src/source/urlData.ts

📝 Walkthrough

Walkthrough

Adds URL-templating enhancements for tile sources: accepts hyphenated template variables, merges default and user-provided urlData into per-tile substitution, introduces a bbox generator for EPSG:3857, and documents a WMS TileSource example; also adds urlData to TileSourceOptions.

Changes

URL templating & WMS BBOX

Layer / File(s) Summary
Data Shape
packages/gl-core/src/type.ts
TileSourceOptions gains optional urlData?: Record<string, any> to accept custom template variables.
Core Implementation
packages/gl-core/src/source/urlData.ts
Adds bboxEpsg3857({ x, y, z }) to compute Web Mercator BBOX strings and exports DEFAULT_URL_DATA mapping including the generator.
Template Parsing / Substitution
packages/gl-core/src/source/tile.ts
URL placeholder regex extended to allow hyphenated variable names; per-tile URL substitution now merges DEFAULT_URL_DATA, user urlData from options, and existing x, y, z, s values.
Documentation / Example
packages/maplibre-gl/README.md
Adds “Tile WMS” example demonstrating usage of BBOX={bbox-epsg-3857}, CRS=EPSG:3857, decodeType, particle rendering settings, and zoom-interpolated style values.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding WMS (Web Map Service) support with EPSG:3857 coordinate reference system, which aligns with all modified files and the PR objectives.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/maplibre-gl/README.md`:
- Around line 198-202: The WMS example object literal is missing a trailing
comma after the dataRange property which makes the snippet invalid JS; update
the example by adding a comma after the dataRange value (so the property
"dataRange" ends with a comma) before the next property ("wrapX") to produce a
valid object literal and ensure the dataRange and wrapX symbols remain
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 51bd92ce-42be-404e-9c1f-6f3f1f3e636c

📥 Commits

Reviewing files that changed from the base of the PR and between 224ca9d and 12b7360.

📒 Files selected for processing (4)
  • packages/gl-core/src/source/tile.ts
  • packages/gl-core/src/source/urlData.ts
  • packages/gl-core/src/type.ts
  • packages/maplibre-gl/README.md

Comment thread packages/maplibre-gl/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants