Last updated June 15, 2012. Created on January 25, 2010.
Edited by ifrik, davideads, zzolo, tmcw. Log in to edit this page.

The following concerns "skins" or "themes" for OpenLayers: sets of images and CSS to used to create map interface elements such as the zoombar, panning controls, and full-screen icon.

This is not not the same as OpenLayers Drupal theming, which allow map elements (such as tooltips) to be themed.

The OpenLayers library gets images and CSS from specifically named files (i.e. zoombar.png) but allows you do change the path to these assets.

In the OpenLayers module, CSS and images are specified on a per-preset basis.

Overriding a preset's theme

Via the web user interface

On a preset's editing page (i.e. http://mysite.tld/admin/build/openlayers/presets/MY_MAP/edit), specify the "Image path" and/or "CSS path". These paths may be relative to your Drupal root or absolute URLs to external resources.

Via the OpenLayers module API

In hook_openlayers_presets() add the image_path and/or css_path elements to a preset definition:

<?php
  $my_presets
->data = array(
    ...
   
'image_path' => 'http://js.mapbox.com/theme/dark/',
    ...
?>

Available themes

Dark

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

tmcw’s picture

Please post on the OpenLayers Issue queue with any bug reports and support requests. We cannot provide support on Book Pages.