give layer a unique id. udpate tests

git-svn-id: http://svn.openlayers.org/trunk/openlayers@977 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-07-19 14:30:46 +00:00
parent 3f07472d5d
commit f71f3d0cfb
2 changed files with 10 additions and 1 deletions

View File

@@ -7,6 +7,9 @@
OpenLayers.Layer = Class.create();
OpenLayers.Layer.prototype = {
/** @type String */
id: null,
/** @type String */
name: null,
@@ -57,6 +60,10 @@ OpenLayers.Layer.prototype = {
Object.extend(this, this.options);
this.name = name;
//generate unique id based on name
this.id = OpenLayers.Util.createUniqueID(name);
if (this.div == null) {
this.div = OpenLayers.Util.createDiv();
this.div.style.width = "100%";