Store the original map options into 'options' property

This commit is contained in:
fredj
2012-01-13 14:36:21 +01:00
parent acf6a8a97d
commit f3c48d6963
2 changed files with 27 additions and 0 deletions
+10
View File
@@ -239,6 +239,12 @@ OpenLayers.Map = OpenLayers.Class({
*/
panRatio: 1.5,
/**
* APIProperty: options
* {Object} The options object passed to the class constructor. Read-only.
*/
options: null,
// Options
/**
@@ -480,6 +486,9 @@ OpenLayers.Map = OpenLayers.Class({
this.theme = OpenLayers._getScriptLocation() +
'theme/default/style.css';
// backup original options
this.options = OpenLayers.Util.extend({}, options);
// now override default options
OpenLayers.Util.extend(this, options);
@@ -731,6 +740,7 @@ OpenLayers.Map = OpenLayers.Class({
this.events.destroy();
this.events = null;
this.options = null;
},
/**