OpenLayers OpenLayers

Changeset 6310

Show
Ignore:
Timestamp:
02/15/08 15:09:51 (1 year ago)
Author:
achipa
Message:

first attempt at a time select control

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/achipa/openlayers/lib/OpenLayers.js

    r6180 r6310  
    33 * full text of the license. */ 
    44 
    5 /*  
     5/* 
    66 * @requires OpenLayers/BaseTypes.js 
    7  */  
     7 */ 
    88 
    99(function() { 
     
    1515     */ 
    1616    var singleFile = (typeof OpenLayers == "object" && OpenLayers.singleFile); 
    17      
     17 
    1818    /** 
    1919     * Namespace: OpenLayers 
     
    2121     */ 
    2222    window.OpenLayers = { 
    23          
     23 
    2424        /** 
    2525         * Property: _scriptName 
     
    3838            var scriptLocation = ""; 
    3939            var scriptName = OpenLayers._scriptName; 
    40           
     40 
    4141            var scripts = document.getElementsByTagName('script'); 
    4242            for (var i = 0; i < scripts.length; i++) { 
    4343                var src = scripts[i].getAttribute('src'); 
    4444                if (src) { 
    45                     var index = src.lastIndexOf(scriptName);  
     45                    var index = src.lastIndexOf(scriptName); 
    4646                    // set path length for src up to a query string 
    4747                    var pathLength = src.lastIndexOf('?'); 
     
    6262     * OpenLayers.singleFile is a flag indicating this file is being included 
    6363     * in a Single File Library build of the OpenLayers Library. 
    64      *  
     64     * 
    6565     * When we are *not* part of a SFL build we dynamically include the 
    6666     * OpenLayers library code. 
    67      *  
    68      * When we *are* part of a SFL build we do not dynamically include the  
     67     * 
     68     * When we *are* part of a SFL build we do not dynamically include the 
    6969     * OpenLayers library code as it will be appended at the end of this file. 
    7070      */ 
     
    147147            "OpenLayers/Control/PanZoom.js", 
    148148            "OpenLayers/Control/PanZoomBar.js", 
     149            "OpenLayers/Control/PanTime.js", 
     150            "OpenLayers/Control/PanTimeBar.js", 
    149151            "OpenLayers/Control/ArgParser.js", 
    150152            "OpenLayers/Control/Permalink.js", 
     
    163165            "OpenLayers/Geometry/Curve.js", 
    164166            "OpenLayers/Geometry/LineString.js", 
    165             "OpenLayers/Geometry/LinearRing.js",         
     167            "OpenLayers/Geometry/LinearRing.js", 
    166168            "OpenLayers/Geometry/Polygon.js", 
    167169            "OpenLayers/Geometry/MultiLineString.js", 
     
    208210            var allScriptTags = new Array(jsfiles.length); 
    209211        } 
    210         var host = OpenLayers._getScriptLocation() + "lib/";     
     212        var host = OpenLayers._getScriptLocation() + "lib/"; 
    211213        for (var i = 0; i < jsfiles.length; i++) { 
    212214            if (docWrite) { 
    213215                allScriptTags[i] = "<script src='" + host + jsfiles[i] + 
    214                                    "'></script>";  
     216                                   "'></script>"; 
    215217            } else { 
    216218                var s = document.createElement("script"); 
    217219                s.src = host + jsfiles[i]; 
    218                 var h = document.getElementsByTagName("head").length ?  
    219                            document.getElementsByTagName("head")[0] :  
     220                var h = document.getElementsByTagName("head").length ? 
     221                           document.getElementsByTagName("head")[0] : 
    220222                           document.body; 
    221223                h.appendChild(s); 
  • sandbox/achipa/openlayers/lib/OpenLayers/BaseTypes/DateTime.js

    r6269 r6310  
    33 * Instances of this class represent moments or intervals of time. This allows us to 
    44 * give the spatial data a temporal dimension and act accordingly. The default timezone 
    5  * is UTC and the precision is in seconds. The minimum representable time is  
     5 * is UTC and the precision is in seconds. The minimum representable time is 
    66 * 1970-01-01T00:00:00Z, and the maximum representable time is 2038-01-19T03:14:07Z 
    7  *  
     7 * 
    88 */ 
    99OpenLayers.DateTime = OpenLayers.Class({ 
     
    7272        this.setBegin(targetdate); 
    7373        this.setEnd(targetdate); 
    74         this.interval = false;  
     74        this.interval = false; 
    7575    }, 
    7676 
     
    138138    }, 
    139139 
     140    equal: function(dateTime) { 
     141        if (this.from == dateTime.from && this.to == dateTime.to) return true; 
     142        return false; 
     143    }, 
     144 
    140145    CLASS_NAME: "OpenLayers.DateTime" 
    141146 
  • sandbox/achipa/openlayers/lib/OpenLayers/Layer.js

    r6264 r6310  
    2020    id: null, 
    2121 
    22     /**  
     22    /** 
    2323     * APIProperty: name 
    2424     * {String} 
     
    2626    name: null, 
    2727 
    28     /**  
     28    /** 
    2929     * APIProperty: div 
    3030     * {DOMElement} 
     
    3838    opacity: null, 
    3939 
    40     /**  
     40    /** 
    4141     * Constant: EVENT_TYPES 
    4242     * {Array(String)} Supported application event types 
    4343     */ 
    4444    EVENT_TYPES: ["loadstart", "loadend", "loadcancel", "visibilitychanged", "datetimechanged"], 
    45          
     45 
    4646    /** 
    4747     * APIProperty: events 
     
    5252    /** 
    5353     * APIProperty: map 
    54      * {<OpenLayers.Map>} This variable is set when the layer is added to  
     54     * {<OpenLayers.Map>} This variable is set when the layer is added to 
    5555     *     the map, via the accessor function setMap(). 
    5656     */ 
    5757    map: null, 
    58      
     58 
    5959    /** 
    6060     * APIProperty: isBaseLayer 
    61      * {Boolean} Whether or not the layer is a base layer. This should be set  
     61     * {Boolean} Whether or not the layer is a base layer. This should be set 
    6262     *     individually by all subclasses. Default is false 
    6363     */ 
    6464    isBaseLayer: false, 
    65   
     65 
    6666    /** 
    6767     * Property: alpha 
    68      * {Boolean} The layer's images have an alpha channel.  Default is false.  
     68     * {Boolean} The layer's images have an alpha channel.  Default is false. 
    6969     */ 
    7070    alpha: false, 
    7171 
    72     /**  
     72    /** 
    7373     * APIProperty: displayInLayerSwitcher 
    7474     * {Boolean} Display the layer's name in the layer switcher.  Default is 
     
    8585    /** 
    8686     * APIProperty: attribution 
    87      * {String} Attribution string, displayed when an  
     87     * {String} Attribution string, displayed when an 
    8888     *     <OpenLayers.Control.Attribution> has been added to the map. 
    8989     */ 
    90     attribution: null,  
    91  
    92     /**  
     90    attribution: null, 
     91 
     92    /** 
    9393     * Property: inRange 
    94      * {Boolean} The current map resolution is within the layer's min/max  
    95      *     range. This is set in <OpenLayers.Map.setCenter> whenever the zoom  
     94     * {Boolean} The current map resolution is within the layer's min/max 
     95     *     range. This is set in <OpenLayers.Map.setCenter> whenever the zoom 
    9696     *     changes. 
    9797     */ 
    9898    inRange: false, 
    99      
     99 
    100100    /** 
    101101     * Propery: imageSize 
    102      * {<OpenLayers.Size>} For layers with a gutter, the image is larger than  
     102     * {<OpenLayers.Size>} For layers with a gutter, the image is larger than 
    103103     *     the tile by twice the gutter in each dimension. 
    104104     */ 
    105105    imageSize: null, 
    106      
     106 
    107107    /** 
    108108     * Property: imageOffset 
    109      * {<OpenLayers.Pixel>} For layers with a gutter, the image offset  
     109     * {<OpenLayers.Pixel>} For layers with a gutter, the image offset 
    110110     *     represents displacement due to the gutter. 
    111111     */ 
     
    114114  // OPTIONS 
    115115 
    116     /**  
     116    /** 
    117117     * Property: options 
    118118     * {Object} An optional object whose properties will be set on the layer. 
     
    131131     *     half the size of the widest symbol that needs to be displayed. 
    132132     *     Defaults to zero.  Non-tiled layers always have zero gutter. 
    133      */  
    134     gutter: 0,  
     133     */ 
     134    gutter: 0, 
    135135 
    136136    /** 
     
    140140     *     maxResolution, and units if appropriate. Can be either a string or 
    141141     *     an <OpenLayers.Projection> object when created -- will be converted 
    142      *     to an object when setMap is called if a string is passed.   
    143      */ 
    144     projection: null,     
    145      
     142     *     to an object when setMap is called if a string is passed. 
     143     */ 
     144    projection: null, 
     145 
    146146    /** 
    147147     * APIProperty: units 
     
    170170     */ 
    171171    resolutions: null, 
    172      
     172 
    173173    /** 
    174174     * APIProperty: datetimeIntervals 
     
    179179     */ 
    180180    datetimeIntervals: null, 
    181      
     181 
    182182    /** 
    183183     * APIProperty: currentDateTime 
     
    194194     */ 
    195195    maxExtent: null, 
    196      
     196 
    197197    /** 
    198198     * APIProperty: minExtent 
     
    200200     */ 
    201201    minExtent: null, 
    202      
     202 
    203203    /** 
    204204     * APIProperty: maxResolution 
    205205     * {Float} Default max is 360 deg / 256 px, which corresponds to 
    206      *     zoom level 0 on gmaps.  Specify a different value in the layer  
    207      *     options if you are not using a geographic projection and  
     206     *     zoom level 0 on gmaps.  Specify a different value in the layer 
     207     *     options if you are not using a geographic projection and 
    208208     *     displaying the whole world. 
    209209     */ 
     
    221221     */ 
    222222    numZoomLevels: null, 
    223     
     223 
    224224    /** 
    225225     * APIProperty: minScale 
     
    227227     */ 
    228228    minScale: null, 
    229      
     229 
    230230    /** 
    231231     * APIProperty: maxScale 
     
    236236    /** 
    237237     * APIProperty: displayOutsideMaxExtent 
    238      * {Boolean} Request map tiles that are completely outside of the max  
     238     * {Boolean} Request map tiles that are completely outside of the max 
    239239     *     extent for this layer. Defaults to false. 
    240240     */ 
     
    243243    /** 
    244244     * APIProperty: wrapDateLine 
    245      * {Boolean} #487 for more info.    
     245     * {Boolean} #487 for more info. 
    246246     */ 
    247247    wrapDateLine: false, 
    248      
    249      
     248 
     249 
    250250    /** 
    251251     * Constructor: OpenLayers.Layer 
     
    260260 
    261261        this.name = name; 
    262          
     262 
    263263        if (this.id == null) { 
    264264 
     
    269269            this.div.style.height = "100%"; 
    270270 
    271             this.events = new OpenLayers.Events(this, this.div,  
     271            this.events = new OpenLayers.Events(this, this.div, 
    272272                                                this.EVENT_TYPES); 
    273273        } 
     
    277277        } 
    278278    }, 
    279      
     279 
    280280    /** 
    281281     * Method: destroy 
     
    305305        this.events = null; 
    306306    }, 
    307      
     307 
    308308   /** 
    309309    * Method: clone 
     
    316316    */ 
    317317    clone: function (obj) { 
    318          
     318 
    319319        if (obj == null) { 
    320320            obj = new OpenLayers.Layer(this.name, this.options); 
    321         }  
    322          
     321        } 
     322 
    323323        // catch any randomly tagged-on properties 
    324324        OpenLayers.Util.applyDefaults(obj, this); 
    325          
     325 
    326326        // a cloned layer should never have its map property set 
    327         //  because it has not been added to a map yet.  
     327        //  because it has not been added to a map yet. 
    328328        obj.map = null; 
    329          
     329 
    330330        return obj; 
    331331    }, 
    332      
    333     /**  
     332 
     333    /** 
    334334     * APIMethod: setName 
    335335     * Sets the new layer name for this layer.  Can trigger a changelayer event 
     
    346346            } 
    347347        } 
    348     },     
    349      
     348    }, 
     349 
    350350   /** 
    351351    * APIMethod: addOptions 
    352     *  
     352    * 
    353353    * Parameters: 
    354354    * newOptions - {Object} 
    355355    */ 
    356356    addOptions: function (newOptions) { 
    357          
     357 
    358358        if (this.options == null) { 
    359359            this.options = {}; 
    360360        } 
    361          
     361 
    362362        // update our copy for clone 
    363363        OpenLayers.Util.extend(this.options, newOptions); 
     
    366366        OpenLayers.Util.extend(this, newOptions); 
    367367    }, 
    368      
     368 
    369369    /** 
    370370     * APIMethod: onMapResize 
     
    372372     */ 
    373373    onMapResize: function() { 
    374         //this function can be implemented by subclasses   
     374        //this function can be implemented by subclasses 
    375375    }, 
    376376 
     
    402402    /** 
    403403     * Method: moveTo 
    404      *  
     404     * 
    405405     * Parameters: 
    406406     * bound - {<OpenLayers.Bounds>} 
     
    420420     * Method: setMap 
    421421     * Set the map property for the layer. This is done through an accessor 
    422      *     so that subclasses can override this and take special action once  
    423      *     they have their map variable set.  
    424      *  
    425      *     Here we take care to bring over any of the necessary default  
    426      *     properties from the map.  
    427      *  
     422     *     so that subclasses can override this and take special action once 
     423     *     they have their map variable set. 
     424     * 
     425     *     Here we take care to bring over any of the necessary default 
     426     *     properties from the map. 
     427     * 
    428428     * Parameters: 
    429429     * map - {<OpenLayers.Map>} 
     
    431431    setMap: function(map) { 
    432432        if (this.map == null) { 
    433          
     433 
    434434            this.map = map; 
    435              
     435 
    436436            // grab some essential layer data from the map if it hasn't already 
    437437            //  been set 
    438438            this.maxExtent = this.maxExtent || this.map.maxExtent; 
    439439            this.projection = this.projection || this.map.projection; 
    440              
     440 
    441441            if (this.projection && typeof this.projection == "string") { 
    442442                this.projection = new OpenLayers.Projection(this.projection); 
    443443            } 
    444              
     444 
    445445            // Check the projection to see if we can get units -- if not, refer 
    446446            // to properties. 
    447447            this.units = this.projection.getUnits() || 
    448448                         this.units || this.map.units; 
    449              
     449 
    450450            this.initResolutions(); 
    451              
     451 
    452452            if (!this.isBaseLayer) { 
    453453                this.inRange = this.calculateInRange(); 
     
    455455                this.div.style.display = show ? "" : "none"; 
    456456            } 
    457              
     457 
    458458            // deal with gutters 
    459459            this.setTileSize(); 
    460460        } 
    461461    }, 
    462      
     462 
    463463    /** 
    464464     * APIMethod: removeMap 
    465      * Just as setMap() allows each layer the possibility to take a  
     465     * Just as setMap() allows each layer the possibility to take a 
    466466     *     personalized action on being added to the map, removeMap() allows 
    467      *     each layer to take a personalized action on being removed from it.  
     467     *     each layer to take a personalized action on being removed from it. 
    468468     *     For now, this will be mostly unused, except for the EventPane layer, 
    469469     *     which needs this hook so that it can remove the special invisible 
    470      *     pane.  
    471      *  
     470     *     pane. 
     471     * 
    472472     * Parameters: 
    473473     * map - {<OpenLayers.Map>} 
     
    476476        //to be overridden by subclasses 
    477477    }, 
    478      
     478 
    479479    /** 
    480480     * APIMethod: getImageSize 
    481      *  
     481     * 
    482482     * Returns: 
    483      * {<OpenLayers.Size>} The size that the image should be, taking into  
     483     * {<OpenLayers.Size>} The size that the image should be, taking into 
    484484     *     account gutters. 
    485      */  
    486     getImageSize: function() {  
    487         return (this.imageSize || this.tileSize);  
    488     },     
    489    
     485     */ 
     486    getImageSize: function() { 
     487        return (this.imageSize || this.tileSize); 
     488    }, 
     489 
    490490    /** 
    491491     * APIMethod: setTileSize 
    492492     * Set the tile size based on the map size.  This also sets layer.imageSize 
    493493     *     and layer.imageOffset for use by Tile.Image. 
    494      *  
     494     * 
    495495     * Parameters: 
    496496     * size - {<OpenLayers.Size>} 
     
    508508          //                              "gutters need non-null tile sizes"); 
    509509          //} 
    510             this.imageOffset = new OpenLayers.Pixel(-this.gutter,  
    511                                                     -this.gutter);  
    512             this.imageSize = new OpenLayers.Size(tileSize.w + (2*this.gutter),  
    513                                                  tileSize.h + (2*this.gutter));  
     510            this.imageOffset = new OpenLayers.Pixel(-this.gutter, 
     511                                                    -this.gutter); 
     512            this.imageSize = new OpenLayers.Size(tileSize.w + (2*this.gutter), 
     513                                                 tileSize.h + (2*this.gutter)); 
    514514        } 
    515515    }, 
     
    517517    /** 
    518518     * APIMethod: getVisibility 
    519      *  
     519     * 
    520520     * Returns: 
    521521     * {Boolean} The layer should be displayed (if in range). 
     
    525525    }, 
    526526 
    527     /**  
     527    /** 
    528528     * APIMethod: setVisibility 
    529      * Set the visibility flag for the layer and hide/show & redraw  
     529     * Set the visibility flag for the layer and hide/show & redraw 
    530530     *     accordingly. Fire event unless otherwise specified 
    531      *  
     531     * 
    532532     * Note that visibility is no longer simply whether or not the layer's 
    533      *     style.display is set to "block". Now we store a 'visibility' state  
    534      *     property on the layer class, this allows us to remember whether or  
    535      *     not we *desire* for a layer to be visible. In the case where the  
    536      *     map's resolution is out of the layer's range, this desire may be  
     533     *     style.display is set to "block". Now we store a 'visibility' state 
     534     *     property on the layer class, this allows us to remember whether or 
     535     *     not we *desire* for a layer to be visible. In the case where the 
     536     *     map's resolution is out of the layer's range, this desire may be 
    537537     *     subverted. 
    538      *  
     538     * 
    539539     * Parameters: 
    540540     * visible - {Boolean} Whether or not to display the layer (if in range) 
     
    552552    }, 
    553553 
    554     /**  
     554    /** 
    555555     * APIMethod: display 
    556556     * Hide or show the Layer 
    557      *  
     557     * 
    558558     * Parameters: 
    559559     * display - {Boolean} 
     
    567567    /** 
    568568     * Method: calculateInRange 
    569      *  
     569     * 
    570570     * Returns: 
    571571     * {Boolean} The layer is displayable at the current map's current 
     
    582582    }, 
    583583 
    584     /**  
     584    /** 
    585585     * APIMethod: setIsBaseLayer 
    586      *  
     586     * 
    587587     * Parameters: 
    588588     * isBaseLayer - {Boolean} 
     
    602602  /*                                                      */ 
    603603  /********************************************************/ 
    604    
    605     /**  
     604 
     605    /** 
    606606     * Method: initResolutions 
    607      * This method's responsibility is to set up the 'resolutions' array  
     607     * This method's responsibility is to set up the 'resolutions' array 
    608608     *     for the layer -- this array is what the layer will use to interface 
    609      *     between the zoom levels of the map and the resolution display  
     609     *     between the zoom levels of the map and the resolution display 
    610610     *     of the layer. 
    611      *  
     611     * 
    612612     * The user has several options that determine how the array is set up. 
    613      *   
    614      * For a detailed explanation, see the following wiki from the  
     613     * 
     614     * For a detailed explanation, see the following wiki from the 
    615615     *     openlayers.org homepage: 
    616616     *     http://trac.openlayers.org/wiki/SettingZoomLevels 
     
    618618    initResolutions: function() { 
    619619 
    620         // These are the relevant options which are used for calculating  
     620        // These are the relevant options which are used for calculating 
    621621        //  resolutions information. 
    622622        // 
     
    624624          'projection', 'units', 
    625625          'scales', 'resolutions', 
    626           'maxScale', 'minScale',  
    627           'maxResolution', 'minResolution',  
     626          'maxScale', 'minScale', 
     627          'maxResolution', 'minResolution', 
    628628          'minExtent', 'maxExtent', 
    629629          'numZoomLevels', 'maxZoomLevel' 
    630630        ); 
    631631 
    632         // First we create a new object where we will store all of the  
     632        // First we create a new object where we will store all of the 
    633633        //  resolution-related properties that we find in either the layer's 
    634634        //  'options' array or from the map. 
    635635        // 
    636         var confProps = {};         
     636        var confProps = {}; 
    637637        for(var i=0; i < props.length; i++) { 
    638638            var property = props[i]; 
     
    654654        } 
    655655 
    656         // If numZoomLevels hasn't been set and the maxZoomLevel *has*,  
     656        // If numZoomLevels hasn't been set and the maxZoomLevel *has*, 
    657657        //  then use maxZoomLevel to calculate numZoomLevels 
    658658        // 
     
    661661        } 
    662662 
    663         // First off, we take whatever hodge-podge of values we have and  
     663        // First off, we take whatever hodge-podge of values we have and 
    664664        //  calculate/distill them down into a resolutions[] array 
    665665        // 
     
    670670                for(var i = 0; i < confProps.scales.length; i++) { 
    671671                    var scale = confProps.scales[i]; 
    672                     confProps.resolutions[i] =  
    673                        OpenLayers.Util.getResolutionFromScale(scale,  
     672                    confProps.resolutions[i] = 
     673                       OpenLayers.Util.getResolutionFromScale(scale, 
    674674                                                              confProps.units); 
    675675                } 
     
    682682            // determine maxResolution 
    683683            if (confProps.minScale) { 
    684                 confProps.maxResolution =  
    685                     OpenLayers.Util.getResolutionFromScale(confProps.minScale,  
     684                confProps.maxResolution = 
     685                    OpenLayers.Util.getResolutionFromScale(confProps.minScale, 
    686686                                                           confProps.units); 
    687687            } else if (confProps.maxResolution == "auto") { 
     
    690690                var hRes = confProps.maxExtent.getHeight()/ viewSize.h; 
    691691                confProps.maxResolution = Math.max(wRes, hRes); 
    692             }  
     692            } 
    693693 
    694694            // determine minResolution 
    695             if (confProps.maxScale != null) {            
    696                 confProps.minResolution =  
    697                     OpenLayers.Util.getResolutionFromScale(confProps.maxScale,  
     695            if (confProps.maxScale != null) { 
     696                confProps.minResolution = 
     697                    OpenLayers.Util.getResolutionFromScale(confProps.maxScale, 
    698698                                                           confProps.units); 
    699             } else if ( (confProps.minResolution == "auto") &&  
     699            } else if ( (confProps.minResolution == "auto") && 
    700700                        (confProps.minExtent != null) ) { 
    701701                var viewSize = this.map.getSize(); 
     
    703703                var hRes = confProps.minExtent.getHeight()/ viewSize.h; 
    704704                confProps.minResolution = Math.max(wRes, hRes); 
    705             }  
     705            } 
    706706 
    707707            // determine numZoomLevels if not already set on the layer 
     
    709709                this.options.numZoomLevels == undefined) { 
    710710                var ratio = confProps.maxResolution / confProps.minResolution; 
    711                 confProps.numZoomLevels =  
     711                confProps.numZoomLevels = 
    712712                    Math.floor(Math.log(ratio) / Math.log(2)) + 1; 
    713713            } 
    714              
    715             // now we have numZoomLevels and maxResolution,  
     714 
     715            // now we have numZoomLevels and maxResolution, 
    716716            //  we can populate the resolutions array 
    717717            confProps.resolutions = new Array(confProps.numZoomLevels); 
     
    736736            } 
    737737        } 
    738          
     738 
    739739        //sort resolutions array ascendingly 
    740740        // 
    741741        confProps.resolutions.sort( function(a, b) { return(b-a); } ); 
    742742 
    743         // now set our newly calculated values back to the layer  
    744         //  Note: We specifically do *not* set them to layer.options, which we  
    745         //        will preserve as it was when we added this layer to the map.  
    746         //        this way cloned layers reset themselves to new map div  
     743        // now set our newly calculated values back to the layer 
     744        //  Note: We specifically do *not* set them to layer.options, which we 
     745        //        will preserve as it was when we added this layer to the map. 
     746        //        this way cloned layers reset themselves to new map div 
    747747        //        dimensions) 
    748748        // 
     
    752752        var lastIndex = confProps.resolutions.length - 1; 
    753753        this.minResolution = confProps.resolutions[lastIndex]; 
    754          
     754 
    755755        this.scales = []; 
    756756        for(var i = 0; i < confProps.resolutions.length; i++) { 
    757             this.scales[i] =  
    758                OpenLayers.Util.getScaleFromResolution(confProps.resolutions[i],  
     757            this.scales[i] = 
     758               OpenLayers.Util.getScaleFromResolution(confProps.resolutions[i], 
    759759                                                      confProps.units); 
    760760        } 
    761761        this.minScale = this.scales[0]; 
    762762        this.maxScale = this.scales[this.scales.length - 1]; 
    763          
     763 
    764764        this.numZoomLevels = confProps.numZoomLevels; 
    765765    }, 
     
    767767    /** 
    768768     * APIMethod: getResolution 
    769      *  
     769     * 
    770770     * Returns: 
    771771     * {Float} The currently selected resolution of the map, taken from the 
     
    777777    }, 
    778778 
    779     /**  
     779    /** 
    780780     * APIMethod: getExtent 
    781      *  
     781     * 
    782782     * Returns: 
    783      * {<OpenLayers.Bounds>} A Bounds object which represents the lon/lat  
     783     * {<OpenLayers.Bounds>} A Bounds object which represents the lon/lat 
    784784     *     bounds of the current viewPort. 
    785785     */ 
     
    793793    /** 
    794794     * APIMethod: getZoomForExtent 
    795      *  
     795     * 
    796796     * Parameters: 
    797797     * bounds - {<OpenLayers.Bounds>} 
    798      * closest - {Boolean} Find the zoom level that most closely fits the  
    799      *     specified bounds. Note that this may result in a zoom that does  
     798     * closest - {Boolean} Find the zoom level that most closely fits the 
     799     *     specified bounds. Note that this may result in a zoom that does 
    800800     *     not exactly contain the entire extent. 
    801801     *     Default is false. 
    802802     * 
    803803     * Returns: 
    804      * {Integer} The index of the zoomLevel (entry in the resolutions array)  
    805      *     for the passed-in extent. We do this by calculating the ideal  
    806      *     resolution for the given extent (based on the map size) and then  
     804     * {Integer} The index of the zoomLevel (entry in the resolutions array) 
     805     *     for the passed-in extent. We do this by calculating the ideal 
     806     *     resolution for the given extent (based on the map size) and then 
    807807     *     calling getZoomForResolution(), passing along the 'closest' 
    808808     *     parameter. 
     
    815815        return this.getZoomForResolution(idealResolution, closest); 
    816816    }, 
    817      
    818     /**  
     817 
     818    /** 
    819819     * Method: getDataExtent 
    820820     * Calculates the max extent which includes all of the data for the layer. 
    821821     *     This function is to be implemented by subclasses. 
    822      *  
     822     * 
    823823     * Returns: 
    824824     * {<OpenLayers.Bounds>} 
     
    830830    /** 
    831831     * APIMethod: getResolutionForZoom 
    832      *  
     832     * 
    833833     * Parameter: 
    834834     * zoom - {Float} 
    835      *  
     835     * 
    836836     * Returns: 
    837837     * {Float} A suitable resolution for the specified zoom. 
     
    853853    /** 
    854854     * APIMethod: getZoomForResolution 
    855      *  
     855     * 
    856856     * Parameters: 
    857857     * resolution - {Float} 
    858      * closest - {Boolean} Find the zoom level that corresponds to the absolute  
     858     * closest - {Boolean} Find the zoom level that corresponds to the absolute 
    859859     *     closest resolution, which may result in a zoom whose corresponding 
    860860     *     resolution is actually smaller than we would have desired (if this 
    861861     *     is being called from a getZoomForExtent() call, then this means that 
    862      *     the returned zoom index might not actually contain the entire  
     862     *     the returned zoom index might not actually contain the entire 
    863863     *     extent specified... but it'll be close). 
    864864     *     Default is false. 
    865      *  
     865     * 
    866866     * Returns: 
    867      * {Integer} The index of the zoomLevel (entry in the resolutions array)  
    868      *     that corresponds to the best fit resolution given the passed in  
     867     * {Integer} The index of the zoomLevel (entry in the resolutions array) 
     868     *     that corresponds to the best fit resolution given the passed in 
    869869     *     value and the 'closest' specification. 
    870870     */ 
     
    898898            var diff; 
    899899            var minDiff = Number.POSITIVE_INFINITY; 
    900             for(var i=0; i < this.resolutions.length; i++) {             
     900            for(var i=0; i < this.resolutions.length; i++) { 
    901901                if (closest) { 
    902902                    diff = Math.abs(this.resolutions[i] - resolution); 
     
    915915        return zoom; 
    916916    }, 
    917      
     917 
    918918    /** 
    919919     * APIMethod: getLonLatFromViewPortPx 
    920      *  
     920     * 
    921921     * Parameters: 
    922922     * viewPortPx - {<OpenLayers.Pixel>} 
    923923     * 
    924924     * Returns: 
    925      * {<OpenLayers.LonLat>} An OpenLayers.LonLat which is the passed-in  
     925     * {<OpenLayers.LonLat>} An OpenLayers.LonLat which is the passed-in 
    926926     *     view port <OpenLayers.Pixel>, translated into lon/lat by the layer. 
    927927     */ 
     
    933933            if (center) { 
    934934                var res  = this.map.getResolution(); 
    935          
     935 
    936936                var delta_x = viewPortPx.x - (size.w / 2); 
    937937                var delta_y = viewPortPx.y - (size.h / 2); 
    938              
     938 
    939939                lonlat = new OpenLayers.LonLat(center.lon + delta_x * res , 
    940                                              center.lat - delta_y * res);  
     940                                             center.lat - delta_y * res); 
    941941 
    942942                if (this.wrapDateLine) { 
     
    950950    /** 
    951951     * APIMethod: getViewPortPxFromLonLat 
    952      *  
     952     * 
    953953     * Parameters: 
    954954     * lonlat - {<OpenLayers.LonLat>} 
    955955     * 
    956      * Returns:  
    957      * {<OpenLayers.Pixel>} An <OpenLayers.Pixel> which is the passed-in  
     956     * Returns: 
     957     * {<OpenLayers.Pixel>} An <OpenLayers.Pixel> which is the passed-in 
    958958     *     <OpenLayers.LonLat>,translated into view port pixels. 
    959959     */ 
    960960    getViewPortPxFromLonLat: function (lonlat) { 
    961         var px = null;  
     961        var px = null; 
    962962        if (lonlat != null) { 
    963963            var resolution = this.map.getResolution(); 
     
    966966                Math.round(1/resolution * (lonlat.lon - extent.left)), 
    967967                Math.round(1/resolution * (extent.top - lonlat.lat)) 
    968             );     
     968            ); 
    969969        } 
    970970        return px; 
    971971    }, <