3
votes

I'm looking for a way to display one of my Mapbox map in QGis (baselayer edited on mapbox.com & data uploaded from tilemill).

Did someone here already find a way ? Is there a feature or a plugin to do that ?

Thanks for your future answers !

Adrien

1
I'm sorry : i did try one or two solutions but it was nothing but failures. Actually, i found a solution that i'm gonna post here as soon as possible :)AdrienVH
The point is that in the future, when you are posting questions, you are much more likely to get good help if you post something that you have attempted together with what errors you got and what you expected to get rather than asking an open question. I am glad that you solved your problem though.DanielBarbarian
You're absolutely right !Thanks for the advice :)AdrienVH

1 Answers

6
votes

Yesterday, I found two solutions by myself :

1) the pretty official "TileLayer Plugin" QGis plugin

You'll have to write a TSV file (Tab Separated Values) with, at least, the name, the credits and the URL of your Mapbox map. The URL should look like :

http://a.tiles.mapbox.com/v3/mapboxId.mapId/{z}/{x}/{y}.png

You just have to replace mapboxId and mapId with your ids. See the github repository of the plugin for further informations and values to add to your TSV file (minZoom, maxZoom, etc).

Then, in the "settings" menu of the plugin, link the plugin to the directory of your TSV file ("external layers directory").

Finally, in the "add" menu of the plugin, select your map and click "add".

2) a XML file which is interpreted as a raster

Write a XML file with this code :

<GDAL_WMS>
    <Service name="TMS">
        <ServerUrl>http://a.tiles.mapbox.com/v3/mapboxId.mapId/${z}/${x}/${y}.png</ServerUrl>
    </Service>
    <DataWindow>
        <UpperLeftX>-20037508.34</UpperLeftX>
        <UpperLeftY>20037508.34</UpperLeftY>
        <LowerRightX>20037508.34</LowerRightX>
        <LowerRightY>-20037508.34</LowerRightY>
        <TileLevel>18</TileLevel>
        <TileCountX>1</TileCountX>
        <TileCountY>1</TileCountY>
        <YOrigin>top</YOrigin>
    </DataWindow>
    <Projection>EPSG:3857</Projection>
    <BlockSizeX>256</BlockSizeX>
    <BlockSizeY>256</BlockSizeY>
    <BandsCount>3</BandsCount>
    <Cache />
</GDAL_WMS>

Once again, replace the ids with yours. Then, open the file in QGis as a raster.