Permit custom styling by setting theme:null in map.options and including the theme CSS manually. Fixes #460.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@2844 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2007-03-22 11:21:16 +00:00
parent 0c8dcabce8
commit e45094ea0c
2 changed files with 61 additions and 5 deletions

View File

@@ -175,11 +175,14 @@ OpenLayers.Map.prototype = {
//set the default options
this.setOptions(options);
var cssNode = document.createElement('link');
cssNode.setAttribute('rel', 'stylesheet');
cssNode.setAttribute('type', 'text/css');
cssNode.setAttribute('href', this.theme);
document.getElementsByTagName('head')[0].appendChild(cssNode);
// only append link stylesheet if the theme property is set
if(this.theme) {
var cssNode = document.createElement('link');
cssNode.setAttribute('rel', 'stylesheet');
cssNode.setAttribute('type', 'text/css');
cssNode.setAttribute('href', this.theme);
document.getElementsByTagName('head')[0].appendChild(cssNode);
}
this.layers = [];