OpenLayers OpenLayers

Changeset 5906

Show
Ignore:
Timestamp:
01/26/08 21:26:36 (1 year ago)
Author:
crschmidt
Message:

Add a seperate method which actually does the formatting in the
MousePosition control in order to allow easier changes in formatting at
the application level (with less duplication of code). Patch from
Kleptog, r=me. (Closes #778)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Control/MousePosition.js

    r5614 r5906  
    131131        } 
    132132         
     133        var newHtml = this.formatOutput(lonLat); 
     134 
     135        if (newHtml != this.element.innerHTML) { 
     136            this.element.innerHTML = newHtml; 
     137        } 
     138    }, 
     139 
     140    /** 
     141     * Method: formatOutput 
     142     * Override to provide custom display output 
     143     * 
     144     * Parameters: 
     145     * lonLat - {<OpenLayers.LonLat>} Location to display 
     146     */ 
     147    formatOutput: function(lonLat) { 
    133148        var digits = parseInt(this.numdigits); 
    134149        var newHtml = 
     
    138153            lonLat.lat.toFixed(digits) + 
    139154            this.suffix; 
    140  
    141         if (newHtml != this.element.innerHTML) { 
    142             this.element.innerHTML = newHtml; 
    143         } 
    144     }, 
     155        return newHtml; 
     156     }, 
    145157 
    146158    /**