code: function setQuery(map, options, query) {
    query = query || {};
    options = options || {};
  
    map.options.forEach(function eachOpts(opt) {
      Object.keys(opt).forEach(function eachOpt(key) {
        var param = opt[key],
            name = param.name,
            value = options[name] || options[key];
  
        if (value !== undefined && param.api) {
          if (param.array) {
            value = [].concat(value).join(' ');
          }
          query[param.api] = param.bool ? param.invert ?
            (value ? 0 : 1) : (value ? 1 : 0) : value;
        }
      });
    });
  
    return query;
  }
docs: Set valid parameter in query