OpenLayers OpenLayers

Changeset 490

Show
Ignore:
Timestamp:
06/01/06 06:33:53 (3 years ago)
Author:
euzuro
Message:

move applyDefaults up to be next to (related) getParameterString()

Files:

Legend:

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

    r486 r490  
    785785}; 
    786786 
     787 
     788/** Takes a hash and copies any keys that don't exist from 
     789*   another hash, by analogy with Object.extend() from 
     790*   Prototype.js. 
     791* 
     792* @param {Object} to 
     793* @param {Object} from 
     794* 
     795* @type Object 
     796*/ 
     797OpenLayers.Util.applyDefaults = function (to, from) { 
     798    for (var key in from) { 
     799        if (to[key] == null) { 
     800            to[key] = from[key]; 
     801        } 
     802    } 
     803    return to; 
     804}; 
     805 
    787806/** 
    788807* @param {Object} params 
     
    813832OpenLayers.Util.getImagesLocation = function() { 
    814833    return OpenLayers._getScriptLocation() + "img/"; 
    815 }; 
    816  
    817 /** Takes a hash and copies any keys that don't exist from 
    818 *   another hash, by analogy with Object.extend() from 
    819 *   Prototype.js. 
    820 * 
    821 * @param {Object} to 
    822 * @param {Object} from 
    823 * 
    824 * @type Object 
    825 */ 
    826 OpenLayers.Util.applyDefaults = function (to, from) { 
    827     for (var key in from) { 
    828         if (to[key] == null) { 
    829             to[key] = from[key]; 
    830         } 
    831     } 
    832     return to; 
    833834}; 
    834835