OpenLayers OpenLayers

Changeset 6686

Show
Ignore:
Timestamp:
03/28/08 21:47:44 (10 months ago)
Author:
euzuro
Message:

move some functions around. APIMethods should be at the top. readability

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/euzuro/pop/lib/OpenLayers/Popup/Anchored.js

    r6676 r6686  
    5454    }, 
    5555 
    56     /**  
    57      * Method: calculateRelativePosition 
    58      *  
    59      * Parameters: 
    60      * px - {<OpenLayers.Pixel>} 
    61      *  
    62      * Returns: 
    63      * {String} The relative position ("br" "tr" "tl "bl") at which the popup 
    64      *     should be placed. 
    65      */ 
    66     calculateRelativePosition:function(px) { 
    67         var lonlat = this.map.getLonLatFromLayerPx(px);         
    68          
    69         var extent = this.map.getExtent(); 
    70         var quadrant = extent.determineQuadrant(lonlat); 
    71          
    72         return OpenLayers.Bounds.oppositeQuadrant(quadrant); 
    73     },  
    74  
    7556    /** 
    7657     * APIMethod: show 
     
    10788 
    10889    /** 
     90     * APIMethod: setSize 
     91     *  
     92     * Parameters: 
     93     * size - {<OpenLayers.Size>} 
     94     */ 
     95    setSize:function(size) {  
     96        OpenLayers.Popup.prototype.setSize.apply(this, arguments); 
     97 
     98        if ((this.lonlat) && (this.map)) { 
     99            var px = this.map.getLayerPxFromLonLat(this.lonlat); 
     100            this.moveTo(px); 
     101        } 
     102    },   
     103     
     104    /**  
     105     * Method: calculateRelativePosition 
     106     *  
     107     * Parameters: 
     108     * px - {<OpenLayers.Pixel>} 
     109     *  
     110     * Returns: 
     111     * {String} The relative position ("br" "tr" "tl "bl") at which the popup 
     112     *     should be placed. 
     113     */ 
     114    calculateRelativePosition:function(px) { 
     115        var lonlat = this.map.getLonLatFromLayerPx(px);         
     116         
     117        var extent = this.map.getExtent(); 
     118        var quadrant = extent.determineQuadrant(lonlat); 
     119         
     120        return OpenLayers.Bounds.oppositeQuadrant(quadrant); 
     121    },  
     122 
     123    /** 
    109124     * Method: updateRelativePosition 
    110125     * The popup has been moved to a new relative location, so we may want to  
     
    120135    }, 
    121136 
    122     /** 
    123      * Method: setSize 
    124      *  
    125      * Parameters: 
    126      * size - {<OpenLayers.Size>} 
    127      */ 
    128     setSize:function(size) {  
    129         OpenLayers.Popup.prototype.setSize.apply(this, arguments); 
    130  
    131         if ((this.lonlat) && (this.map)) { 
    132             var px = this.map.getLayerPxFromLonLat(this.lonlat); 
    133             this.moveTo(px); 
    134         } 
    135     },   
    136      
    137137    /**  
    138138     * Method: calculateNewPx