I've been looking in all the corners of the web but I can't seem to find a clue on where I can find OpenLayers templates (such as a grayscale map), and how to use them in my site. The import and add function on admin/structure/openlayers/layers seem to do the same, but each with another approach.

Currently the website is using the default OSM Mapnik layer, but I'd like to use another type of layer.

Comments

knalstaaf’s picture

Status: Active » Closed (fixed)

I've figured it out somehow.

Templates can be found here: http://wiki.openstreetmap.org/wiki/OpenLayers

We're using the CartoDB Light template from the page in the above link.

  1. Click the link for the base url (the icon with the arrow that stands for external page)
  2. You'll probably get a page not found, but the only thing you need is the basemap url, which looks like this: http://a.basemaps.cartocdn.com/light_all/${z}/${x}/${y}.png
  3. Go to "Layers" of your OpenLayers UI and click "Add" (admin/structure/openlayers/layers/add)
  4. Give it a name and description, and select the layer type, I selected "XYZ"
  5. Paste the basemap url in the Base URL (template) field. <- Make sure it prints the curly brackets properly (not as %7B and %7D), and that it has the http(s):// in front of it.
  6. Adjust further options if deemed necessary (I checked Wrap Date Line and Base Layer)

This layer will now be available as an overlay in the Layers & Styles of your maps (admin/structure/openlayers/maps/list/your_map_name/edit).

More template suggestions are welcome.

#2384877: MapTiler tiles in Drupal - step-by-step tutorial