From 145981c3036bc3ddb46009b6e33f223f75bd9c74 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 28 Feb 2008 21:09:28 +0000 Subject: [PATCH] Though the structure is not something we promise will not change, the internal context object is now available to those who parse WMC. r=crschmidt (closes #1370) git-svn-id: http://svn.openlayers.org/trunk/openlayers@6401 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/WMC.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/OpenLayers/Format/WMC.js b/lib/OpenLayers/Format/WMC.js index 2bdafb652c..f48abed6c7 100644 --- a/lib/OpenLayers/Format/WMC.js +++ b/lib/OpenLayers/Format/WMC.js @@ -87,10 +87,16 @@ OpenLayers.Format.WMC = OpenLayers.Class({ } var context = this.parser.read(data, options); var map; - if(options.map instanceof OpenLayers.Map) { - map = this.mergeContextToMap(context, options.map); + if(options.map) { + this.context = context; + if(options.map instanceof OpenLayers.Map) { + map = this.mergeContextToMap(context, options.map); + } else { + map = this.contextToMap(context, options.map); + } } else { - map = this.contextToMap(context, options.map); + // not documented as part of the API, provided as a non-API option + map = context; } return map; },