plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

Enable "TMS" tile layer scheme as overlay in scattermapbox.

Open meteoDaniel opened this issue 5 years ago • 3 comments

There are two different ways of defining xyz tile layers for map visualisation. They are differing in the orientation of the naming of the y coordinate: The TMS specification orders from Bottom Left and the Google/OpenStreetmap (WMS, 'slippy') specification orders from Top Left. So the y naming is inverted.

Here you can find the required mapbox gl entry point: Vector->Scheme

This issue https://github.com/plotly/plotly.py/issues/1610 and this thread https://github.com/plotly/plotly.py/issues/2272 relates to this problem.

meteoDaniel avatar Mar 17 '20 14:03 meteoDaniel

Any updates on this issue?

meteoDaniel avatar Apr 09 '21 08:04 meteoDaniel

We'd be happy to integrate a PR for this but as far as I know no one is actively working on it :)

nicolaskruchten avatar Apr 09 '21 13:04 nicolaskruchten

Replacing the hardcoded "xyz" with "tms" in plotly-2.8.3.js allows using tms tiles just fine. There is this piece of code which handles the translation of the y coordinate: scheme === 'tms' ? Math.pow(2, this.z) - this.y - 1 : this.y.

The fix would be trivial, just allow users to specify "scheme" and pass it further where currently "xyz" is hardcoded.

aleb avatar Jul 13 '22 15:07 aleb