OpenLayers OpenLayers

Changeset 488

Show
Ignore:
Timestamp:
05/31/06 22:04:41 (2 years ago)
Author:
euzuro
Message:

build based on r487

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/build/OpenLayers.js

    r475 r488  
    1 //// 
    2 /// This blob sucks in all the files in uncompressed form for ease of use 
    3 /// 
    4  
    5 OpenLayers = new Object(); 
    6 OpenLayers._scriptName = "lib/OpenLayers.js"; 
    7 OpenLayers._getScriptLocation = function () { 
    8     var scriptLocation = ""; 
    9     var SCRIPT_NAME = OpenLayers._scriptName; 
    10   
    11     var scripts = document.getElementsByTagName('script'); 
    12     for (var i = 0; i < scripts.length; i++) { 
    13         var src = scripts[i].getAttribute('src'); 
    14         if (src) { 
    15             var index = src.lastIndexOf(SCRIPT_NAME);  
    16             // is it found, at the end of the URL? 
    17             if ((index > -1) && (index + SCRIPT_NAME.length == src.length)) {   
    18                 scriptLocation = src.slice(0, -SCRIPT_NAME.length); 
    19                 break; 
    20             } 
    21         } 
    22     } 
    23     return scriptLocation; 
    24 } 
    251/*  Prototype JavaScript framework, version 1.4.0 
    262 *  (c) 2005 Sam Stephenson <sam@conio.net> 
     
    26912667    */ 
    26922668    getCenterPixel:function() { 
    2693         return new OpenLayers.Pixel(this.left + (this.getWidth() / 2)
    2694                                     this.bottom + (this.getHeight() / 2)); 
     2669        return new OpenLayers.Pixel( (this.left + this.right) / 2
     2670                                    (this.bottom + this.top) / 2); 
    26952671    }, 
    26962672 
     
    27002676    */ 
    27012677    getCenterLonLat:function() { 
    2702         return new OpenLayers.LonLat(this.left + (this.getWidth() / 2)
    2703                                     this.bottom + (this.getHeight() / 2)); 
     2678        return new OpenLayers.LonLat( (this.left + this.right) / 2
     2679                                      (this.bottom + this.top) / 2); 
    27042680    }, 
    27052681 
     
    28222798OpenLayers.Bounds.fromString = function(str) { 
    28232799    var bounds = str.split(","); 
    2824     return new OpenLayers.Bounds(parseFloat(bounds[0]), 
    2825                                  parseFloat(bounds[1]), 
    2826                                  parseFloat(bounds[2]), 
    2827                                  parseFloat(bounds[3])); 
     2800    return OpenLayers.Bounds.fromArray(bounds); 
    28282801}; 
    28292802 
     2803/** Alternative constructor that builds a new OpenLayers.Bounds 
     2804*    from an array 
     2805*  
     2806* @constructor 
     2807*  
     2808* @param {Array} bbox Array of bounds values (ex. <i>[5,42,10,45]</i>) 
     2809* 
     2810* @returns New OpenLayers.Bounds object built from the passed-in Array. 
     2811* @type OpenLayers.Bounds 
     2812*/ 
     2813OpenLayers.Bounds.fromArray = function(bbox) { 
     2814    return new OpenLayers.Bounds(parseFloat(bbox[0]), 
     2815                                 parseFloat(bbox[1]), 
     2816                                 parseFloat(bbox[2]), 
     2817                                 parseFloat(bbox[3])); 
     2818}; 
    28302819 
    28312820/** 
     
    32603249* Ajax reader for OpenLayers 
    32613250* 
    3262 * Pay close attention to how this works: 
    3263 * 
    32643251*@uri url to do remote XML http get 
    32653252*@param 'get' format params (x=y&a=b...) 
    3266 *@who object which is providing a specific callbacks for this request 
    3267 *@complete  the name of the function which must be defined in the callers.handler[] array 
    3268 *@failure  the name of the function which must be defined in the callers.handler[] array 
     3253*@who object to handle callbacks for this request 
     3254*@complete  the function to be called on success  
     3255*@failure  the function to be called on failure 
    32693256* 
    32703257* example usage from a caller: 
    32713258* 
    3272 *   this.handlers["caps"] = function(request){..} 
    3273 *   OpenLayers.loadURL(url,params,this,"caps"); 
     3259*   caps: function(request) { 
     3260*    -blah-   
     3261*   }, 
     3262
     3263*   OpenLayers.loadURL(url,params,this,caps); 
    32743264* 
    32753265* Notice the above example does not provide an error handler; a default empty 
    3276 * handler is provided which merely logs the error if a failure handler is not supplied 
     3266* handler is provided which merely logs the error if a failure handler is not  
     3267* supplied 
    32773268* 
    32783269*/ 
     
    33103301//    ol.Log.debug("loadURL [" + uri + "]"); 
    33113302 
    3312     var successx; 
    3313     var failurex; 
    3314     var bind1 = null; 
    3315     var bind2 = null; 
    3316  
    3317     if (onComplete) { 
    3318         successx = caller.handlers[onComplete]; 
    3319         bind1 = caller; 
    3320     } else { 
    3321         successx = OpenLayers.nullHandler; 
    3322     } 
    3323  
    3324     if (onFailure) { 
    3325         failurex = caller.handlers[onFailure]; 
    3326         bind2=caller; 
    3327     } else { 
    3328         failurex = OpenLayers.nullHandler; 
    3329     } 
     3303    var success = (onComplete) ? onComplete.bind(caller) 
     3304                                : OpenLayers.nullHandler; 
     3305 
     3306    var failure = (onFailure) ? onFailure.bind(caller) 
     3307                           : OpenLayers.nullHandler; 
    33303308 
    33313309    // from prototype.js 
     
    33333311                     {   method: 'get',  
    33343312                         parameters: params, 
    3335                          onComplete: successx.bind(bind1),  
    3336                          onFailure: failurex.bind(bind2) 
     3313                         onComplete: success,  
     3314                         onFailure: failure 
    33373315                      } 
    33383316                     ); 
     
    43674345         
    43684346        if (this.div != null) { 
    4369            this.div.style.width = this.size.w; 
    4370            this.div.style.height = this.size.h; 
    4371        }        
     4347            this.div.style.width = this.size.w; 
     4348            this.div.style.height = this.size.h; 
     4349        } 
    43724350    },   
    43734351 
     
    43814359         
    43824360        if (this.div != null) { 
    4383            this.div.style.backgroundColor = this.backgroundColor; 
    4384        }        
     4361            this.div.style.backgroundColor = this.backgroundColor; 
     4362        } 
    43854363    },   
    43864364     
     
    43954373        if (this.div != null) { 
    43964374            // for Mozilla and Safari 
    4397            this.div.style.opacity = this.opacity; 
     4375            this.div.style.opacity = this.opacity; 
    43984376 
    43994377            // for IE 
    4400            this.div.style.filter = 'alpha(opacity=' + this.opacity*100 + ')'; 
    4401        }        
     4378            this.div.style.filter = 'alpha(opacity=' + this.opacity*100 + ')'; 
     4379        } 
    44024380    },   
    44034381     
     
    44124390        if (this.div != null) { 
    44134391            this.div.style.border = this.border; 
    4414        
     4392       
    44154393    },       
    44164394     
     
    47134691         
    47144692        this.features = new Array(); 
    4715  
    4716         this.handlers = new Array(); 
    4717         this.handlers["requestSuccess"] = this.requestSuccess; 
    47184693    }, 
    47194694 
     
    47224697    draw:function() { 
    47234698        OpenLayers.Tile.prototype.draw.apply(this, arguments); 
    4724         this.loadFeaturesForRegion("requestSuccess");         
     4699        this.loadFeaturesForRegion(this.requestSuccess);         
    47254700    }, 
    47264701 
     
    56075582        this.setRicoCorners(true); 
    56085583         
    5609         //set the popup color and opacity           
    5610        this.setBackgroundColor();  
    5611        this.setOpacity(); 
     5584        //set the popup color and opacity            
     5585        this.setBackgroundColor();  
     5586        this.setOpacity(); 
    56125587 
    56135588        return this.div; 
     
    56415616         
    56425617        if (this.div != null) { 
    5643            if (this.contentDiv != null) { 
    5644                this.div.style.background = "transparent"; 
     5618            if (this.contentDiv != null) { 
     5619                this.div.style.background = "transparent"; 
    56455620                Rico.Corner.changeColor(this.contentDiv, this.backgroundColor); 
    56465621            } 
    5647        }        
     5622        } 
    56485623    },   
    56495624     
     
    56595634            if (this.contentDiv != null) { 
    56605635            Rico.Corner.changeOpacity(this.contentDiv, this.opacity); 
    5661            }        
     5636            } 
    56625637        } 
    56635638    },   
     
    57055680        } else { 
    57065681            Rico.Corner.reRound(this.contentDiv, options); 
    5707             //set the popup color and opacity           
    5708            this.setBackgroundColor();  
    5709            this.setOpacity(); 
     5682            //set the popup color and opacity 
     5683            this.setBackgroundColor();  
     5684            this.setOpacity(); 
    57105685        } 
    57115686    },