Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for WMS or TMS Tiles #1610

Open
njanakiev opened this issue Jun 13, 2019 · 4 comments
Open

Support for WMS or TMS Tiles #1610

njanakiev opened this issue Jun 13, 2019 · 4 comments

Comments

@njanakiev
Copy link

@njanakiev njanakiev commented Jun 13, 2019

First of all, thanks for this wonderful project!

I find the support for mapbox tiles great and fairly intuitive, but I think it would be a nice feature to support some of the standard tile formats like WMS, TMS and XYZ tiles similar to the way they are implemented in Leaflet or Openlayers. This would make it easier to use self-hosted tile servers or for example OpenStreetMap tiles.

@jonmmease

This comment has been minimized.

Copy link
Member

@jonmmease jonmmease commented Jun 15, 2019

Thanks for the suggestion @njanakiev. The MapBox JavaScript library supports rendering external (not provided by MapBox) tiles as raster layers. We're looking into adding support for these through the Plotly API. Would this satisfy the use cases you have in mind?

@njanakiev njanakiev changed the title Support for WMS or XYZ Tiles Support for WMS or TMS Tiles Jun 18, 2019
@njanakiev

This comment has been minimized.

Copy link
Author

@njanakiev njanakiev commented Jun 18, 2019

Thank you for the fast reply. Do you mean like shown in this documentation? I suppose this should support arbitrary WMS servers. What I also had in mind is support for TMS tiles as they are also fairly common. You can see how Leaflet uses WMS and TMS tiles in these examples. They also support TMS tile layers with endpoints of the form:

http://base_url/tms/1.0.0/ {tileset} / {z} / {x} / {y} .png

An OpenStreetMap tile example would look like:

https://tile.openstreetmap.org/7/63/42.png

Is this something that MapBox can also support with the raster layers?

@joshwarren

This comment has been minimized.

Copy link

@joshwarren joshwarren commented Sep 11, 2019

I think you probably can by using mapbox with a custom layer, but I haven't quite got it working yet (see here: https://plot.ly/python/mapbox-layers/).

import plotly.graph_objects as go

fig = go.Figure()

fig.update_layout(
    mapbox_style="white-bg",
    mapbox_layers=[
        {
            "below": 'traces',
            "sourcetype": "raster",
            "source": ["http://localhost:8080/myWMSServer/wms?"]
        }
      ])

fig.show()

I'm not sure if it's not working because I'm getting the source incorrect (I've tried using an address that will serve me a png map in the browser but that didn't work either) or if this idea will simply not work at all...

I'd be grateful if anyone has any suggestions.

@nicolaskruchten

This comment has been minimized.

Copy link
Member

@nicolaskruchten nicolaskruchten commented Sep 11, 2019

I'm sorry our docs are not sufficiently clear on this point... The contents of the source array are passed to Mapbox.js and according to their docs, should be TileJSON-compliant. Basically this means that these URLs should have {x}, {y} and {z} placeholders OR a {bbox-epsg-3857} placeholder. We have an example in our docs with both in the same map here: https://plot.ly/python/mapbox-layers/#base-tiles-from-the-usgs-radar-overlay-from-environment-canada-no-token-needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.