Deprecate the theme map option, p=ahocevar, r=me (closes #2619)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10372 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
bartvde
2010-06-04 19:24:10 +00:00
parent 9bd7f02dbb
commit 744ee039bd
2 changed files with 10 additions and 101 deletions

View File

@@ -355,12 +355,13 @@ OpenLayers.Map = OpenLayers.Class({
/**
* APIProperty: theme
* {String} Relative path to a CSS file from which to load theme styles.
* Specify null in the map options (e.g. {theme: null}) if you
* want to get cascading style declarations - by putting links to
* stylesheets or style declarations directly in your page.
* {String} *Deprecated* Relative path to a CSS file from which to load
* theme styles. Add a CSS resource in the HTML of your map page
* instead, e.g.:
* (code)
* <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
* (end)
*/
theme: null,
/**
* APIProperty: displayProjection
@@ -480,9 +481,6 @@ OpenLayers.Map = OpenLayers.Class({
this.paddingForPopups = new OpenLayers.Bounds(15, 15, 15, 15);
this.theme = OpenLayers._getScriptLocation() +
'theme/default/style.css';
// now override default options
OpenLayers.Util.extend(this, options);
@@ -545,29 +543,6 @@ OpenLayers.Map = OpenLayers.Class({
this.updateSizeDestroy);
}
// only append link stylesheet if the theme property is set
if(this.theme) {
// check existing links for equivalent url
var addNode = true;
var nodes = document.getElementsByTagName('link');
for(var i=0, len=nodes.length; i<len; ++i) {
if(OpenLayers.Util.isEquivalentUrl(nodes.item(i).href,
this.theme)) {
addNode = false;
break;
}
}
// only add a new node if one with an equivalent url hasn't already
// been added
if(addNode) {
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);
}
}
if (this.controls == null) {
if (OpenLayers.Control != null) { // running full or lite?
this.controls = [ new OpenLayers.Control.Navigation(),