[OpenLayers-Commits] r6467 - sandbox/tschaub/geoview/lib/OpenLayers/Format

commits at openlayers.org commits at openlayers.org
Sun Mar 9 13:43:43 EDT 2008


Author: tschaub
Date: 2008-03-09 13:43:43 -0400 (Sun, 09 Mar 2008)
New Revision: 6467

Modified:
   sandbox/tschaub/geoview/lib/OpenLayers/Format/WMC.js
Log:
Pass on options to merge

Modified: sandbox/tschaub/geoview/lib/OpenLayers/Format/WMC.js
===================================================================
--- sandbox/tschaub/geoview/lib/OpenLayers/Format/WMC.js	2008-03-09 16:52:01 UTC (rev 6466)
+++ sandbox/tschaub/geoview/lib/OpenLayers/Format/WMC.js	2008-03-09 17:43:43 UTC (rev 6467)
@@ -90,7 +90,7 @@
         if(options.map) {
             this.context = context;
             if(options.map instanceof OpenLayers.Map) {
-                map = this.mergeContextToMap(context, options.map);
+                map = this.mergeContextToMap(context, options.map, options);
             } else {
                 map = this.contextToMap(context, options.map);
             }
@@ -133,13 +133,14 @@
      * Parameters:
      * context - {Object} The context object.
      * map - {<OpenLayers.Map>} The map.
-     *
+     * options - {Object}
+     * 
      * Returns:
      * {<OpenLayers.Map>} The same map with layers added.
      */
     mergeContextToMap: function(context, map, options) {
         map.addLayers(context.layers);
-        if(options.zoomToExtent) {
+        if(options && options.zoomToExtent) {
             map.setCenter(
                 context.bounds.getCenterLonLat(),
                 map.getZoomForExtent(context.bounds, true)



More information about the Commits mailing list