anchor.diff:                        end
                       end;
                       //done making controls, now set objects
  -                    query.SQL.Text := 'INSERT INTO GENE_CONTROL_OBJECTS (CONTROL_ID, OBJECT_ID, OBJECT_TABLE) VALUES (:CONTROL_ID, :OBJECT_ID, :OBJECT_TABLE)';
  +                    query.SQL.Text := 'INSERT INTO GENE_CONTROL_OBJECTS (CONTROL_ID, OBJECT_ID, OBJECT_TABLE, SIDE, OBJECT_TYPE) VALUES (:CONTROL_ID, :OBJECT_ID, :OBJECT_TABLE, :SIDE, :OBJECT_TYPE)';
                       query.ParamByName('OBJECT_TABLE').Value := 'GENE_ROAD'; //for now can only use GENE_ROAD change when OTConnector is updated
  +                    if selectCategories.Count > 0 then
  +                      query.ParamByName('OBJECT_TYPE').Value := selectCategories.Items[0].Value
  +                    else
  +                      query.ParamByName('OBJECT_TYPE').Clear;
                       for id in objects.Keys do
                       begin
                         query.ParamByName('OBJECT_ID').Value := id;
                         if objects[id] = -1 then
  -                        query.ParamByName('CONTROL_ID').Value := leftID
  +                      begin
  +                        query.ParamByName('CONTROL_ID').Value := leftID;
  +                        query.ParamByName('SIDE').Value := -1;
  +                      end
                         else if objects[id] = 1 then
  -                        query.ParamByName('CONTROL_ID').Value := rightID
  +                      begin
  +                        query.ParamByName('CONTROL_ID').Value := rightID;
  +                        query.ParamByName('SIDE').Value := 1;
  +                      end
                         else
  +                      begin
                           query.ParamByName('CONTROL_ID').Value := mainID;
  +                        query.ParamByName('SIDE').Value := 0;
  +                      end;
                         query.ExecSQL;
                       end;
                       //done writing objects, now set properties
  
positive.code:   tagEnable = 'Enable';
    tagDisable = 'Disable';
    tagProperties = 'Properties';
    tagRemove = 'Remove';
  
  type
  
negative.code:     function getTooltipJSON: string;
    end;
  
    TUSControlProperties = class
    constructor Create(const aControlID: Integer; aQuery: TOraQuery);
    destructor Destroy; override;
    private
      fID: Integer;
      fName: string;
      fDescription: string;
      fProperties: TDictionary<string, string>;
      fChildren: TList<TUSControlProperties>;
    public
      function GetJSON: string;
    end;
  
    TUSControlsLayer = class(TSimpleLayer)
    constructor Create(aScenario: TUSScenario; const aDomain, aID, aName, aDescription: string;
      aDefaultLoad: Boolean; const aConnectString: string; aSourceProjection: TGIS_CSProjectedCoordinateSystem);
  