mapinfo-l
hello!Would you like to tell me how to add a line to a Layer in MapX+Delphi+Oracle?
i put the data into the Oracle 8.1.7i,after the map displayed,i want to add a line
to the current layer which mapping from database.i do it as follows:
procedure TfrmMapx.FormCreate(Sender: TObject);
var
unusedParam:variant;
begin
TVarData(unusedParam).vType := varError;
TVarData(unusedParam).vError := DWord(DISP_E_PARAMNOTFOUND);
MapGIS.CreateCustomTool(TOOLLINE,MiToolTypeLine,MiCrossCursor,
MiArrowCursor,MiArrowCursor,unusedParam);
end;
procedure TfrmMapx.Button1Click(Sender: TObject);
var
temp : CMapXLayerInfo;
unusedParam:variant;
begin
TVarData(unusedParam).vType := varError;
TVarData(unusedParam).vError := DWord(DISP_E_PARAMNOTFOUND);
temp:=CoLayerInfo.Create;
temp.type_ := miLayerInfoTypeServer;
temp.AddParameter('name', 'yyy');
temp.AddParameter('Connectstring','uid=cjx;pwd=cjx;srvr=adserver' );
temp.AddParameter('query','select * from usa');
temp.AddParameter('cache','on');
temp.AddParameter('mbrsearch','off');
temp.AddParameter('toolkit','ORAINET');
LayerUSA:=MapGIS.Layers.Add(temp,0);
LayerUSA.Editable:=False;
Label2.Caption:=timetostr(time);
end;
procedure TfrmMapx.MapGISToolUsed(Sender: TObject; ToolNum: Smallint; X1,
Y1, X2, Y2, Distance: Double; Shift, Ctrl: WordBool;
var EnableDefault: WordBool);
var
ftrNew:CMapxFeature;
pts:CMapXPoints;
begin
if ToolNum=TOOLLINE then
begin
pts:=CoPoints.Create;
pts.addxy(X1,Y1,EmptyParam);
pts.Addxy(X2,Y2,EmptyParam);
ftrNew:=MapGIS.FeatureFactory.CreateLine(pts,mapgis.DefaultStyle);
MapGIS.Layers.Item('yyy').AddFeature(ftrNew,EmptyParam);
end;
end;
but errors occurs:"The index colum on the server is editable and no index column
value was specified,unable to insert row". i don't know the why,please give me a
hand.thanks a lot.
Regards,
Yours
Jianxiong,Chen
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.