OpenLayers OpenLayers

Changeset 1872

Show
Ignore:
Timestamp:
11/16/06 04:03:17 (2 years ago)
Author:
euzuro
Message:

applying patch for #399 - MultiServer - some small formatting/commenting changes.

Files:

Legend:

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

    r1721 r1872  
    110110        var url = (altUrl == null) ? this.url : altUrl; 
    111111         
     112        // if url is not a string, it should be an array of strings,  
     113        //  in which case we will randomly select one of them in order 
     114        //  to evenly distribute requests to different urls. 
     115        if (typeof url == "object") { 
     116            url = url[Math.floor(Math.random()*url.length)]; 
     117        }    
    112118        // requestString always starts with url 
    113119        var requestString = url;         
     
    118124        var allParams = OpenLayers.Util.extend(allParams, newParams); 
    119125        var paramsString = OpenLayers.Util.getParameterString(allParams); 
    120  
    121126        if (paramsString != "") { 
    122             var lastServerChar = this.url.charAt(this.url.length - 1); 
     127            var lastServerChar = url.charAt(url.length - 1); 
    123128            if ((lastServerChar == "&") || (lastServerChar == "?")) { 
    124129                requestString += paramsString; 
    125130            } else { 
    126                 if (this.url.indexOf('?') == -1) { 
     131                if (url.indexOf('?') == -1) { 
    127132                    //serverPath has no ? -- add one 
    128133                    requestString += '?' + paramsString;