Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Quadkey tokens in tile URL templates, limited WMS support #5628

Merged
merged 3 commits into from
Jul 12, 2016

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Jul 9, 2016

Ported mapbox/mapbox-gl-js#2805 and mapbox/mapbox-gl-js@0877cac to support quadkey tokens in tile URL templates.

Ported mapbox/mapbox-gl-js#2612 (comment) along with the necessary parts of mapbox/whoots-js@f2ca0ca for limited WMS scheme support. Added a local style to macosapp that you can use to debug WMS support in the macOS SDK: zoom in to New Jersey, then go to View ‣ Custom Style and enter wms.json.

Fixes #822 and fixes #5485.

/cc @lucaswoj @tmcw @bhousel

@1ec5 1ec5 added feature Core The cross-platform C++ core, aka mbgl labels Jul 9, 2016
@1ec5 1ec5 self-assigned this Jul 9, 2016
@1ec5 1ec5 added the GL JS parity For feature parity with Mapbox GL JS label Jul 9, 2016
@1ec5 1ec5 changed the title Quadkey tokens in tile URL templates Quadkey tokens in tile URL templates, limited WMS support Jul 10, 2016
@1ec5 1ec5 added the macOS Mapbox Maps SDK for macOS label Jul 10, 2016
@1ec5
Copy link
Contributor Author

1ec5 commented Jul 10, 2016

The WMS test is failing due to what appears to be a double rounding discrepancy. (Formatting floats has long been a painful topic in gl-native: #5054.) Does it matter that (x0, y0, z1) produces:

-20037508.342789245,0,0,20037508.342789245

instead of the GL JS expected value of:

-20037508.342789244,0,0,20037508.342789244

/cc @kkaefer

@@ -55,6 +89,8 @@ Resource Resource::tile(const std::string& urlTemplate,
int8_t z,
Necessity necessity) {
bool supportsRatio = urlTemplate.find("{ratio}") != std::string::npos;
auto quadKey = getQuadKey(x, y, z);
Copy link
Contributor

Choose a reason for hiding this comment

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

Move getQuadKey and getTileBBox into the lambda conditionals, so they are only called if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 Fixed.

@1ec5 1ec5 force-pushed the 1ec5-quadkey-5485 branch 2 times, most recently from dbb7403 to d1cf19d Compare July 12, 2016 01:33
@1ec5
Copy link
Contributor Author

1ec5 commented Jul 12, 2016

Going to assume the discrepancy doesn’t matter because these are projected meters. If anyone has a problem with gl-native being a nanometer off gl-js in both directions, we can address that as tail work.

1ec5 added 3 commits July 12, 2016 09:48
Added a style to the macosapp resource bundle that can be used to test WMS support. To use it, zoom in to somewhere in New Jersey, then go to View ‣ Custom Style and enter “wms.json”.
@1ec5 1ec5 force-pushed the 1ec5-quadkey-5485 branch from d1cf19d to 81367f3 Compare July 12, 2016 17:09
@1ec5 1ec5 merged commit 08d0a9a into master Jul 12, 2016
@1ec5 1ec5 deleted the 1ec5-quadkey-5485 branch July 12, 2016 17:57
@friedbunny friedbunny mentioned this pull request Jul 13, 2016
@kkaefer
Copy link
Member

kkaefer commented Jul 15, 2016

@1ec5 given that these units are Spherical Mercator meters, the slight discrepancy doesn't matter, since it's just 1 nanometer at the equator.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl feature GL JS parity For feature parity with Mapbox GL JS macOS Mapbox Maps SDK for macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pass custom parameters to styleURL WMS/TMS Overlay
3 participants