code: function(id, querydef) {
          // find the matching layer, if it exists
          for (var lyr = 0; lyr < this.options.layers.length; lyr++) {
              if (id == this.options.layers[lyr].id) {
                  // replace this layer definition
                  this.options.layers[lyr].query = querydef;
                  return;
              }
          }
        
          // no layer found, create a new definition
          this.options.layers.push({id: id, visible: true, query: querydef});
      }
docs: Method: setLayerQuery
  Set the query definition on this layer. Query definitions are used to
  render parts of the spatial data in an image, and can be used to
  filter features or layers in the ArcIMS service.
  
  Parameters:
  id - {String} The ArcIMS layer ID.
  querydef - {Object} The query definition to apply to this layer.