Search code examples
javascriptcssthemesopenlayers

OpenLayers not using theme CSS?


I need to customize the position (using CSS) of some of the elements, but when I change the style.css document in the theme/default directory inside OpenLayers, the CSS changes are not applied to the Map.

Additionally, the icons contained inside the theme/default/img directory for the map are not used. Instead the icons residing in the base /img directory are used.

Does anyone know how to tell OpenLayers to use the CSS and images from a specific theme?
How do I tell OpenLayers to use a theme?


Solution

  • Make sure you reference style.css that resides in 'themes/default' directory correctly. Otherwise OpenLayers will rely on path to images defined inline, not in CSS classes, which is why your images are loaded from root directory and not 'themes/default/img', I guess.