OpenLayers OpenLayers

Changeset 2844

Show
Ignore:
Timestamp:
03/22/07 07:21:16 (2 years ago)
Author:
sderle
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Map.js

    r2836 r2844  
    176176        this.setOptions(options); 
    177177         
    178         var cssNode = document.createElement('link'); 
    179         cssNode.setAttribute('rel', 'stylesheet'); 
    180         cssNode.setAttribute('type', 'text/css'); 
    181         cssNode.setAttribute('href', this.theme); 
    182         document.getElementsByTagName('head')[0].appendChild(cssNode);  
     178        // only append link stylesheet if the theme property is set 
     179        if(this.theme) { 
     180            var cssNode = document.createElement('link'); 
     181            cssNode.setAttribute('rel', 'stylesheet'); 
     182            cssNode.setAttribute('type', 'text/css'); 
     183            cssNode.setAttribute('href', this.theme); 
     184            document.getElementsByTagName('head')[0].appendChild(cssNode); 
     185        } 
    183186 
    184187        this.layers = [];