fixing bug introduced with [179]. basically, the Layer constructor should not be making new divs when it is initialized by a subclass. that was the point of [179]. the problem is that because of the way Layer.Grid is making the call to Layer's initialize() -- createing a new arguments array regardless of the orginal (ie although name is void, it nonetheless creates a new array with one element, a void element) well so then when init gets called it thinks it does have arguments. The real god's truth here is that we need a better way than if (arguments.length > 0) to distinguish between actual object creation and the creation of the classes.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@185 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-19 17:34:16 +00:00
parent 20a13f43a6
commit c59e66f167
2 changed files with 12 additions and 6 deletions

View File

@@ -16,11 +16,13 @@ OpenLayers.Layer.prototype = {
* @param {str} name
*/
initialize: function(name) {
this.name = name;
if (this.div == null) {
this.div = OpenLayers.Util.createDiv();
this.div.style.width = "100%";
this.div.style.height = "100%";
if (arguments.length > 0) {
this.name = name;
if (this.div == null) {
this.div = OpenLayers.Util.createDiv();
this.div.style.width = "100%";
this.div.style.height = "100%";
}
}
},