From 55b52c6c9f3c71fb9dc4fb54101edcce1b5aa3fc Mon Sep 17 00:00:00 2001 From: Matt Priour Date: Wed, 18 Jan 2012 14:41:41 -0600 Subject: [PATCH] Create the metadata object in the initialize function, otherwise any assignment to an instance of an OpenLayers.Layer class or subclass add/modifies those properties on the OpenLayers.Layer prototype --- lib/OpenLayers/Layer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js index 76483876e9..54c97f0d13 100644 --- a/lib/OpenLayers/Layer.js +++ b/lib/OpenLayers/Layer.js @@ -329,7 +329,7 @@ OpenLayers.Layer = OpenLayers.Class({ * {Object} This object can be used to store additional information on a * layer object. */ - metadata: {}, + metadata: null, /** * Constructor: OpenLayers.Layer @@ -340,6 +340,8 @@ OpenLayers.Layer = OpenLayers.Class({ */ initialize: function(name, options) { + this.metadata = {}; + this.addOptions(options); this.name = name;