OpenLayers OpenLayers

Changeset 7928

Show
Ignore:
Timestamp:
09/02/08 11:46:35 (3 months ago)
Author:
pagameba
Message:

Adjust how the parameters are calculated for the GETVISIBLEMAPEXTENT call for overlays so that existing parameters are safely overwritten with the required parameters for this call. r=me (Closes #1647)

Files:

Legend:

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

    r7339 r7928  
    2929     *    singleTile *and* isBaseLayer false is *not recommend*: it uses synchronous 
    3030     *    XMLHttpRequests to load tiles, and this will *lock up users browsers* 
    31      *    during requests
     31     *    during requests if the server fails to respond
    3232     **/ 
    3333    singleTile: false, 
     
    6464     * Create a new Mapguide layer, either tiled or untiled.   
    6565     * 
    66      * For tiled layers, the 'groupName' and 'mapDefnition' options  
    67      * must be specified as options. 
    68      * 
    69      * For untiled layers, specify either combination of 'mapName' and 
    70      * 'session', or 'mapDefinition' and 'locale'. 
     66     * For tiled layers, the 'groupName' and 'mapDefinition' values  
     67     * must be specified as parameters in the constructor. 
     68     * 
     69     * For untiled base layers, specify either combination of 'mapName' and 
     70     * 'session', or 'mapDefinition' and 'locale'.   
     71     * 
     72     * For untiled overlay layers (singleTile=true and isBaseLayer=false),  
     73     * mapName and session are required parameters for the Layer constructor.   
     74     * Also NOTE: untiled overlay layers issues a synchronous AJAX request  
     75     * before the image request can be issued so the users browser may lock 
     76     * up if the MG Web tier does not respond in a timely fashion. 
     77     * 
     78     * NOTE: MapGuide OS uses a DPI value and degrees to meters conversion  
     79     * factor that are different than the defaults used in OpenLayers,  
     80     * so these must be adjusted accordingly in your application.   
     81     * See the MapGuide example for how to set these values for MGOS. 
    7182     * 
    7283     * Parameters: 
     
    7586     *            (e.g. http://localhost:8008/mapguide/mapagent/mapagent.fcgi) 
    7687     * params - {Object} hashtable of additional parameters to use. Some 
    77      *     parameters may require additional code on the serer. The ones that 
     88     *     parameters may require additional code on the server. The ones that 
    7889     *     you may want to use are:  
    7990     *   - mapDefinition - {String} The MapGuide resource definition 
     
    117128                           this.SINGLE_TILE_PARAMS 
    118129                           ); 
     130                            
    119131        } else { 
    120132            //initialize for tiled layers 
     
    197209            //but we first need to call GETVISIBLEMAPEXTENT to set the extent 
    198210            var getVisParams = {}; 
     211            getVisParams = OpenLayers.Util.extend(getVisParams, params); 
    199212            getVisParams.operation = "GETVISIBLEMAPEXTENT"; 
    200213            getVisParams.version = "1.0.0"; 
     
    202215            getVisParams.mapName = this.params.mapName; 
    203216            getVisParams.format = 'text/xml'; 
    204             getVisParams = OpenLayers.Util.extend(getVisParams, params); 
     217            url = this.getFullRequestString( getVisParams ); 
    205218             
    206             OpenLayers.Request.GET({ 
    207                 url: this.url, params: getVisParams, async: false 
    208             }); 
     219            OpenLayers.Request.GET({url: url, async: false}); 
    209220          } 
    210221           
     
    226237                           scaleindex: this.resolutions.length - this.map.zoom - 1 
    227238                        }); 
    228          
     239          
    229240         
    230241        return url;