Как-то так:
procedure TMapController.SelectEx(const LayerName, WhereClause: WideString;
const Symbol: IUnknown; Pan: WordBool);
var
pFl : IFeatureLayer;
pQF :IQueryFilter;
nulled : boolean;
pFS : IFeatureSelection;
pMarkerSymbol :ISimplemarkerSymbol;
pLineSymbol :ISimpleLineSymbol;
pFillSymbol :ISimpleFillSymbol;
pColor : IRGBColor;
begin
pFl:=LayerByName(LayerName);
if pFl<>nil then Begin
try
try
pQF:=CoQueryFilter.Create as IQueryFilter;
pQF.WhereClause:=WhereClause;
pFS:=pFl as IFeatureSelection;
except on E: Exception do
{$I-}
Showmessage(ERROR_CANT_SELECT_FEATURE+#10#13+ERROR_UNDER_COM+E.Message); //sh*t happens
{$I+}
end;
if pFl.FeatureClass.FeatureCount(pQF)>0 then
if Symbol =nil then Begin
pColor:=CoRGBColor.Create as IRGBColor;
pFS.SetSelectionSymbol:=true;
case pFl.FeatureClass.ShapeType of
$00000001:Begin
pMarkerSymbol:=CoSimplemarkerSymbol.Create as ISimplemarkerSymbol;
pMarkerSymbol.Size:=SELECTED_SYMBOL_SIZE;
pColor.RGB:=SELECTED_SYMBOL_COLOR;
pMarkerSymbol.Color:=pColor as IColor;
pColor.RGB:=SELECTED_SYMBOL_OUTLINECOLOR;
pMarkerSymbol.OutlineColor:=pColor as IColor;
pMarkerSymbol.XOffset:=0;
pMarkerSymbol.YOffset:=0;
pMarkerSymbol.Angle:=0;
pMarkerSymbol.Style:=SELECTED_SYMBOL_STYLE;
pFS.SelectionSymbol:=pMarkerSymbol as ISymbol;
End;
$00000003:Begin
pLineSymbol:=CoSimpleLineSymbol.Create as ISimpleLineSymbol;
pLineSymbol.Style:=SELECTED_LINE_STYLE;
pColor.RGB:=SELECTED_LINE_COLOR;
pLineSymbol.Color:=pColor as IColor;
pLineSymbol.Width:=SELECTED_LINE_WIDTH;
pFS.SelectionSymbol:=pLineSymbol as ISymbol;
End;
$00000004:Begin
pFillSymbol:=CoSimpleFillSymbol.Create as ISimpleFillSymbol;
pFillSymbol.Style:=SELECTED_FILL_STYLE;
pFillSymbol.Outline.Width:=SELECTED_FILL_WIDTH;
pColor.RGB:=SELECTED_FILL_COLOR;
pFillSymbol.Color:=pColor as IColor;
pColor.RGB:=SELECTED_FILL_OUTCOLOR;
pFillSymbol.Outline.Color:=pColor as IColor;
pFS.SelectionSymbol:=pFillSymbol as ISymbol;
End;
end;
End
else Begin
pFS.SetSelectionSymbol:=true;
case pFl.FeatureClass.ShapeType of
$00000001: if supports(Symbol,ISymbol) then
if supports(Symbol, IMarkerSymbol) then Begin
pFS.SelectionSymbol:=Symbol as ISymbol;
End;
$00000003: if supports(Symbol,ISymbol) then
if supports(Symbol, ILineSymbol) then Begin
pFS.SelectionSymbol:=Symbol as ISymbol;
End;
$00000004: if supports(Symbol,ISymbol) then
if sup