Once you installed MapBox and the OpenLayers modules, you may be asking "What's next ?" because there is no MapBox layer provided out-of-box. This page will help you to add MapBox layers (a.k.a "Tileset") into OpenLayers in Drupal 6.
In Drupal 7 some MapBox tilesets are provided but more can be added following this tutorial.
Choose a Tile Set
- First, head to http://tiles.mapbox.com/mapbox in the official MapBox website
- Choose the tileset you want to use. In this example we will assume that you want to use the World light tileset, but the following applies for every tileset. Note the layer name : it is the last part of the url. For the World light tileset, it is world-light
- In the right part of the page, note the information you'll need in OpenLayers : the Zoom info, specified as a range. For the World light tileset the zoom levels are 0-11. Some tilesets may hold a file extension (if none is specified, note png).
Create a Layer
Then back in your Drupal installation
- Go to
admin/build/openlayers/layers/addfor Drupal 6.
- In the list select MapBox.
- Then fill the form with the requested information:
- MapBox layer name : use the Layer name you chose from above: world-light
- Baselayer : tick the box. World-light is a basemap. Some tilesets from MapBox.com such as 'Haiti Earthquake overlays' are not baselayers, so you would uncheck the box.
- Zoom-levels : select the 'Zoom-levels' from MapBox.com, from 0 to 11.
- File extension : 'png' for world-light.
- Name, Title, Description : enter the information as you would for any layers.
- Now you can use the layer you just created in any of your OpenLayers map.