OpenLayers OpenLayers

Changeset 493

Show
Ignore:
Timestamp:
06/01/06 07:54:31 (3 years ago)
Author:
euzuro
Message:

need to make WMS & WFS case-independent. I dont know why I chose to move them all to uppercase instead of lowercase, but I did. This required changing the test cases and the 'srs' property which is set in Grid. Personally, I dont think that is the best place to set it, but so be it jedi. As long as I have the mic, i'd add that having 'projection' stored in both map and layer objects seems a bit redundant as well.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Layer/Grid.js

    r465 r493  
    221221    getFullRequestString:function(params) { 
    222222        var requestString = "";         
    223         this.params.srs = this.projection; 
     223        this.params.SRS = this.projection; 
    224224        // concat tile params with layer params and convert to string 
    225225        var allParams = Object.extend(params, this.params); 
  • trunk/openlayers/lib/OpenLayers/Layer/WFS.js

    r471 r493  
    3232        var newArguments = new Array(); 
    3333        if (arguments.length > 0) { 
     34            //uppercase params 
     35            params = OpenLayers.Util.upperCaseObject(params); 
    3436            newArguments.push(name, url, params); 
    3537        } 
     
    3840     
    3941        if (arguments.length > 0) { 
    40             OpenLayers.Util.applyDefaults(this.params, this.DEFAULT_PARAMS); 
     42            OpenLayers.Util.applyDefaults( 
     43                           this.params,  
     44                           OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS) 
     45                           ); 
    4146        } 
    4247    },     
     
    7984    addTile:function(bounds, position) { 
    8085        url = this.getFullRequestString( 
    81                      { bbox:bounds.toBBOX() }); 
     86                     { BBOX:bounds.toBBOX() }); 
    8287        var tile = new OpenLayers.Tile.WFS(this, position, bounds,  
    8388                                           url, this.tileSize); 
  • trunk/openlayers/lib/OpenLayers/Layer/WMS.js

    r492 r493  
    2626        var newArguments = new Array(); 
    2727        if (arguments.length > 0) { 
     28            //uppercase params 
     29            params = OpenLayers.Util.upperCaseObject(params); 
    2830            newArguments.push(name, url, params); 
    2931        } 
     
    3133         
    3234        if (arguments.length > 0) { 
    33             OpenLayers.Util.applyDefaults(this.params, this.DEFAULT_PARAMS); 
     35            OpenLayers.Util.applyDefaults( 
     36                           this.params,  
     37                           OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS) 
     38                           ); 
    3439        } 
    3540    },     
     
    6368    addTile:function(bounds,position) { 
    6469        url = this.getFullRequestString( 
    65                      {bbox:bounds.toBBOX(), 
    66                       width:this.tileSize.w, 
    67                       height:this.tileSize.h}); 
     70                     {BBOX:bounds.toBBOX(), 
     71                      WIDTH:this.tileSize.w, 
     72                      HEIGHT:this.tileSize.h}); 
    6873        var tile = new OpenLayers.Tile.Image(this, position, bounds,  
    6974                                             url, this.tileSize); 
  • trunk/openlayers/tests/test_Layer_WMS.html

    r315 r493  
    1313        t.eq( layer.name, "Test Layer", "layer.name is correct" ); 
    1414        t.eq( layer.url, "http://octo.metacarta.com/cgi-bin/mapserv", "layer.url is correct" ); 
    15         t.eq( layer.params.map, "/mapdata/vmap_wms.map", "layer.params.map is correct" ); 
    16         t.eq( layer.params.format, "image/png", "layer.params.format is correctly overridden" ); 
    17         t.eq( layer.params.exceptions, "application/vnd.ogc.se_inimage",  
     15        t.eq( layer.params.MAP, "/mapdata/vmap_wms.map", "layer.params.map is correct" ); 
     16        t.eq( layer.params.FORMAT, "image/png", "layer.params.format is correctly overridden" ); 
     17        t.eq( layer.params.EXCEPTIONS, "application/vnd.ogc.se_inimage",  
    1818                                       "other default layer.params are set correctly" ); 
    1919    } 
     
    2525        var pixel = new OpenLayers.Pixel(5,6); 
    2626        var tile = layer.addTile(new OpenLayers.Bounds(1,2,3,4), pixel); 
    27         t.eq( tile.img.src, "http://octo.metacarta.com/cgi-bin/mapserv?bbox=1,2,3,4&width=256&height=256&map=/mapdata/vmap_wms.map&layers=basic&format=image/jpeg&service=WMS&version=1.1.1&request=GetMap&styles=&exceptions=application/vnd.ogc.se_inimage&srs=EPSG:4326", "image src is created correctly via addtile" ); 
     27        t.eq( tile.img.src, "http://octo.metacarta.com/cgi-bin/mapserv?BBOX=1,2,3,4&WIDTH=256&HEIGHT=256&MAP=/mapdata/vmap_wms.map&LAYERS=basic&FORMAT=image/jpeg&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326", "image src is created correctly via addtile" ); 
    2828        t.eq( tile.img.style.top, "6px", "image top is set correctly via addtile" ); 
    2929        t.eq( tile.img.style.left, "5px", "image top is set correctly via addtile" ); 
     
    3232        else 
    3333            t.ok( layer.div.firstChild instanceof HTMLImageElement, "div first child is an image object" ); 
    34         t.eq( layer.div.firstChild.src, "http://octo.metacarta.com/cgi-bin/mapserv?bbox=1,2,3,4&width=256&height=256&map=/mapdata/vmap_wms.map&layers=basic&format=image/jpeg&service=WMS&version=1.1.1&request=GetMap&styles=&exceptions=application/vnd.ogc.se_inimage&srs=EPSG:4326", "div first child is correct image object" ); 
     34        t.eq( layer.div.firstChild.src, "http://octo.metacarta.com/cgi-bin/mapserv?BBOX=1,2,3,4&WIDTH=256&HEIGHT=256&MAP=/mapdata/vmap_wms.map&LAYERS=basic&FORMAT=image/jpeg&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326", "div first child is correct image object" ); 
    3535        var pos = tile.getPosition(); 
    3636        t.eq( pos.toString(), "x=5,y=6", "Position of tile is set correctly." );