examples/elevationProfile.js
function(type, key, opt_childKey) {
    return (
      /**
       * @param {Object} item
       * @return {any}
       */
      function(item) {
        if (opt_childKey !== undefined) {
          item = item[opt_childKey];
        }
        return item[key];
      });
  }
function(type, key, opt_childKey) {
    return (
      /**
       * @param {Object} item
       * @return {any}
       */
      function(item) {
        if (opt_childKey !== undefined) {
          item = item[opt_childKey];
        }
        return item[key];
      });
  }
function ( type , key , opt_childKey ) { return ( /**
       * @param {Object} item
       * @return {any}
       */ function ( item ) { if ( opt_childKey !== undefined ) { item = item [ opt_childKey ] ; } return item [ key ] ; } ) ; }
Factory for creating simple getter functions for extractors.
If the value is in a child property, the opt_childKey must be defined.
The type parameter is used by closure to type the returned function.
@param {any} type An object of the expected result type.
@param {string} key Key used for retrieving the value.
@param {string=} opt_childKey Key of a child object.
@return {function(Object): any} Getter function.
Factory for creating simple getter functions for extractors . If the value is in a child property the opt_childKey must be defined . The type parameter is used by closure to type the returned function .