Changeset 328


Ignore:
Timestamp:
04/02/09 21:09:21 (9 years ago)
Author:
tschaub
Message:

Setting allOverlays true when MapPanel creates a map. (see #35)

Location:
sandbox/opengeo/geoexplorer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sandbox/opengeo/geoexplorer/lib/GeoExt/widgets/MapPanel.js

    r320 r328  
    9999    initComponent: function(){
    100100        if(!(this.map instanceof OpenLayers.Map)) {
    101             this.map = new OpenLayers.Map(this.map);
     101            this.map = new OpenLayers.Map(
     102                Ext.applyIf(this.map || {}, {allOverlays: true})
     103            );
    102104        }
    103105        var layers = this.layers;
  • sandbox/opengeo/geoexplorer/modifications.txt

    r327 r328  
    77 * Added examples of grid using WMSCapabilitiesStore (see #9)
    88 * Clone feature and layer in record.clone (see #34)
     9 * Set allOverlays in MapPanel (see #35)
    910 * Merge changes from trunk up to r319
    1011
  • sandbox/opengeo/geoexplorer/tests/lib/GeoExt/widgets/MapPanel.html

    r270 r328  
    22<html debug="true">
    33  <head>
    4     <script type="text/javascript" src="../../../../../../openlayers/lib/OpenLayers.js"></script>
    5     <script type="text/javascript" src="../../../../../../ext/2.2.1/adapter/ext/ext-base.js"></script>
    6     <script type="text/javascript" src="../../../../../../ext/2.2.1/ext-all-debug.js"></script>
     4    <script type="text/javascript" src="../../../../../openlayers/lib/OpenLayers.js"></script>
     5    <script type="text/javascript" src="../../../../../ext/adapter/ext/ext-base.js"></script>
     6    <script type="text/javascript" src="../../../../../ext/ext-all-debug.js"></script>
    77    <script type="text/javascript" src="../../../../lib/GeoExt.js"></script>
    88
     
    4141            t.eq(mapPanel.map.getCenter().toString(), "lon=5,lat=45", "Map center set correctly");
    4242            t.eq(mapPanel.map.getZoom(), 4, "Zoom set correctly");
     43        }
     44       
     45        function test_allOverlays(t) {
     46            t.plan(3);
     47            var map, panel;
     48           
     49            map = new OpenLayers.Map();
     50            panel = new GeoExt.MapPanel({
     51                map: map
     52            });
     53            t.eq(panel.map.allOverlays, false, "allOverlays is not set if map is provided to panel");
     54            panel.destroy();
     55           
     56            panel = new GeoExt.MapPanel({
     57            });
     58            t.eq(panel.map.allOverlays, true, "allOverlays set to true if no map is provided to panel");
     59            panel.destroy();
     60           
     61            panel = new GeoExt.MapPanel({
     62                map: {
     63                    units: "meters"
     64                }
     65            });
     66            t.eq(panel.map.allOverlays, true, "allOverlays set to true if map config is provided to panel");
     67            panel.destroy();
     68           
    4369        }
    4470
Note: See TracChangeset for help on using the changeset viewer.