30楼#
发布于:2004-11-10 10:26
谢谢!请问我初学MapX应该注意些什么?
|
|
31楼#
发布于:2004-10-19 14:53
<P>安装mapx5.0(delphi6)的问题:import MapXLib_TLB时报错:</P><P>[Error] MapXLib_TLB.pas(3504): Field or method identifier expected</P><P>[Error] MapXLib_TLB.pas(9598): Undeclared identifier: 'Set_Parameter'</P><P>[Error] MapXLib_TLB.pas(9873): Undeclared identifier: 'Get_NoFeatures'</P><P>[Error] MapXLib_TLB.pas(9878): Undeclared identifier: 'Get_AllFeatures'</P><P>[Error] MapXLib_TLB.pas(10401): Undeclared identifier: 'Get_Width'</P><P>[Error] MapXLib_TLB.pas(10406): Undeclared identifier: 'Get_Decimals'</P><P>[Error] MapXLib_TLB.pas(10593): Undeclared identifier: 'Get_RowValues'</P><P>[Error] MapXLib_TLB.pas(10598): Undeclared identifier: 'Get_SourceRows'</P><P>[Error] MapXLib_TLB.pas(17829): Undeclared identifier: 'Set_Nodes'</P><P>[Error] MapXLib_TLB.pas(18855): Undeclared identifier: 'Get_X'</P><P>[Error] MapXLib_TLB.pas(18860): Undeclared identifier: 'Get_Y'</P><P>[Error] MapXLib_TLB.pas(21341): Undeclared identifier: 'Get_Item'</P><P>[Fatal Error] info.dpk(35): Could not compile used unit '..\Imports\MapXLib_TLB.pas'</P><P>请教大虾如何解决</P>
|
|
32楼#
发布于:2004-09-21 10:44
老大,偶是菜鸟,你那儿有没有delphi+mapx中文培训资料,可以一步一步说明使用的,我有些地图作为交换,你看如何
|
|
33楼#
发布于:2004-09-15 10:38
<P>DELPHI+MAPX群号码是:590433</P><P>DELPHI+MAPX群号码是:59043300</P><P>DELPHI+MAPX群号码是:5904330</P>
|
|
34楼#
发布于:2004-08-30 21:06
请问一下,怎样在dephi 中做出象AutoCAD中的那样能够通过三点画圆弧
|
|
35楼#
发布于:2004-08-30 21:05
请问一下,怎样在dephi 中做出象AutoCAD中的那样能够通过三点画圆弧
|
|
36楼#
发布于:2004-08-25 17:43
<P>MapX在Delphi中,如何找出线等Feature的结点(转)</P><P>obj : Variant ; // MapXLib_TLB.Feature;</P><P>arrVals: Variant; //leee 030621
idx,NodeCnt:integer; NodeString:String; 以下代码响应MapX控件的ToolUsed事件 Case ToolNum of CUSTOM_POINT_TOOL : ………; CUSTOM_LINE_TOOL : ………; ………; miSelectTool : begin if (ctrl) then ftrLayer.Selection.SelectByPoint(X1, Y1, miSelectionAppend) else if (Shift) then ftrLayer.Selection.SelectByPoint(X1, Y1, miSelectionRemove) else then ftrLayer.Selection.SelectByPoint(X1, Y1, miSelectionNew);</P><P>if (ftrLayer.selection.count >= 1) //0306 lee 设计 then begin obj:=ftrLayer.Selection.Item(ftrLayer.selection.count); //此处示例取得最后一个Feature ,也可用循环语句取得所有Feature arrVals := obj.Nodes;</P><P>{</P><P>NodeCnt:=arrVals[1,1]); NodeString:=''; for idx:=1 to NodeCnt do NodeString:=#13+#10+NodeString+IntToStr(idx)+' 经度:'+FloatToStr(arrVals[idx*2,1])+' 纬度:'+FloatToStr(arrVals[idx*2+1,1]);</P><P>showMessage('共'+FloatToStr(arrVals[1,1])+'结点,它们的座标为:'+NodeString); //+'---' end; ShowMessage(IntToStr(ftrLayer.selection.count)+'个对象被选择!'); end; end;//Case</P> |
|
37楼#
发布于:2004-08-25 17:43
mapx中如何创建缓冲区 (转帖)
内容: Private Sub cmdBuffer_Click() '** buffer the selection from the Top 20 Cities table Dim ftrnew As New Feature Dim ftr As Feature 'Something from the Top 20 Cities table must be selected for this to work For Each ftr In Map1.Layers("US Top 20 Cities").Selection Set ftrnew = Map1.FeatureFactory.BufferFeatures(ftr, 250) 'Create a 250 mile buffer feature Map1.Layers.Item("Temp").AddFeature ftrnew 'add the new buffer to the map Next End Sub |
|
38楼#
发布于:2004-08-25 17:41
<P>在MapX中实现图元闪烁(转帖)</P><P>MapX图元分三种类型:
1、线(Line),即miFeatureTypeLine 2、区域(Region),即miFeatureTypeRegion 3、点符号(Symbol),即miFeatureTypeSymbol </P><P>加入一个时钟控件,并在时钟控件中实现以下代码: </P><P>procedure TMapFrm.tmFlashSelectTimer(Sender: TObject); var ft: CMapXFindFeature; lyr: CMapXLayer; bExist: Boolean; i: Integer; str: String; ds: CMapXDataset; begin bExist := False; for i := 1 to mapCity.Layers.Count do begin if mapCity.Layers.Item.Name = m_strSelLyr then begin bExist := True; break; end; end; </P><P>if not bExist then begin tmFlashSelect.Enabled := False; MsgFrm := TMsgFrm.Create(Self); MsgFrm.m_strMsg := Format('图层[%s]信息不存在!',[m_strSelLyr]); MsgFrm.ShowModal; MsgFrm.Free; Exit; end; </P><P>lyr := mapCity.Layers._Item(m_strSelLyr); ds := mapCity.Datasets.Add(miDataSetLayer, lyr ,EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam); lyr.Find.FindDataset := ds; lyr.Find.FindField := ds.Fields.Item[1]; str := Format('%d',[m_nSelID]); ft := lyr.Find.Search(str,EmptyParam); </P><P>if ft.FindRC mod 10 <> 1 then begin tmFlashSelect.Enabled := False; MsgFrm := TMsgFrm.Create(Self); MsgFrm.m_strMsg := Format('单位点[%s]信息不存在!',[m_strCorpName]); MsgFrm.ShowModal; MsgFrm.Free; Exit; end; </P><P>case ft.type_ of miFeatureTypeLine: begin if ft.Style.LineColor = miColorWhite then ft.Style.LineColor := miColorRed else ft.Style.LineColor := miColorWhite; end; miFeatureTypeRegion: begin if ft.Style.RegionColor = miColorGreen then ft.Style.RegionColor := miColorRed else ft.Style.RegionColor := miColorGreen; end; miFeatureTypeSymbol: begin if not m_bFlashSel then lyr.Selection.Replace(ft) else lyr.Selection.ClearSelection; m_bFlashSel := not m_bFlashSel; end; end; ft.Update(EmptyParam, EmptyParam); </P><P>if not m_bCenter then begin m_bCenter := True; mapCity.CenterX := ft.CenterX; mapCity.CenterY := ft.CenterY; mapCity.Refresh; end; end; </P><P>我这里是把选中的图元实现闪烁,并把图元居中 </P> |
|
39楼#
发布于:2004-08-25 17:40
<P>关于建立公交的网络拓扑关系.txt(转帖)</P><P>建立网络拓扑关系分三步走!
1、数据库部分,建立公交线与公交站点的对应数据库 2、在地图上画出公交线及公交站点,要求尽量的精确 3、通过遍历数据库的公交线及地图,建立一其拓扑关系 比如(A->B->C->D)就可以在数据库表示其拓扑关系: From To Dist Line A B 14.00 1 B C 20.98 1 C D 9.00 1 </P><P> procedure TfrmMain.Button1Click(Sender: TObject); begin frmProgress := TfrmProgress.Create(Self); frmProgress.Show; frmProgress.Update; </P><P>frmProgress.pbPubTra.Position := 0; InitPublicTraffic(); frmProgress.pbPubTra.Position := 100; </P><P>frmProgress.Free; </P><P>ShowMessage('公交线路的网络拓扑关系创建完成!'); end; </P><P>procedure TfrmMain.InitPublicTraffic; var str: String; fld: TField; i,nBus: Integer; nFromStop,nToStop:Integer; nStop1,nStop2: Integer; nOffset: Integer; lyr: CMapXLayer; dDist: Double; ftA,ftB:CMapXFindFeature; ds: CMapXDataset; begin //lyr.Selection. if not adoConn.Connected then Exit; </P><P>str := 'select * from 公交线路 order by MAPINFO_ID'; adoQueryBus.Connection := adoConn; adoQueryStop.Connection := adoConn; adoTableArc.Connection := adoConn; adoTableArc.TableName := 'NetArcList'; adoTableArc.Open; adoQueryBus.SQL.Clear; adoQueryBus.SQL.Add(str); adoQueryBus.Open; </P><P>adoQueryBus.First; nOffset := 100 div adoQueryBus.RecordCount; </P><P>lyr := mapPT.Layers._Item('公交站点'); ds := mapPT.Datasets.Add(miDataSetLayer, lyr ,EmptyParam, EmptyParam, EmptyParam, EmptyParam,EmptyParam, EmptyParam); lyr.Find.FindDataset := ds; lyr.Find.FindField := ds.Fields.Item[1]; </P><P>while not adoQueryBus.Eof do begin fld := adoQueryBus.Fields.FindField('MAPINFO_ID'); nBus := fld.AsInteger; if nBus = 0 then continue; </P><P>str := Format('StopID%d',[1]); fld := adoQueryBus.Fields.FindField(str); nFromStop := fld.AsInteger; if nFromStop = 0 then continue; </P><P>for i := 2 to 32 do begin str := Format('StopID%d',); fld := adoQueryBus.Fields.FindField(str); nToStop := fld.AsInteger; if fld.AsInteger = 0 then break; </P><P>str := Format('select MAPINFO_ID from 公交站点 where CODE=%d',[nFromStop]); adoQueryStop.Close; adoQueryStop.Active := False; adoQueryStop.SQL.Clear; adoQueryStop.SQL.Add(str); adoQueryStop.Open; </P><P>nStop1 := adoQueryStop.Fields[0].AsInteger; str := Format('%d',[nStop1]); ftA := lyr.Find.Search(str, EmptyParam); </P><P>str := Format('select MAPINFO_ID from 公交站点 where CODE=%d',[nToStop]); adoQueryStop.Close; adoQueryStop.Active := False; adoQueryStop.SQL.Clear; adoQueryStop.SQL.Add(str); adoQueryStop.Open; </P><P>nStop2 := adoQueryStop.Fields[0].AsInteger; str := Format('%d',[nStop2]); ftB := lyr.Find.Search(str, EmptyParam); </P><P>dDist := mapPT.Distance(ftA.CenterX, ftA.CenterY, ftB.CenterX, ftB.CenterY); </P><P>adoTableArc.Recordset.AddNew(EmptyParam,EmptyParam); adoTablearc.Recordset.Fields.Item[1].Value := nStop1; //nFromStop - 10000; adoTablearc.Recordset.Fields.Item[2].Value := nStop2; //nToStop - 10000; adoTablearc.Recordset.Fields.Item[3].Value := nBus; adoTablearc.Recordset.Fields.Item[4].Value := dDist; </P><P>nFromStop := nToStop; </P><P>{ str := Format('insert into NetArcList(FromStop,ToStop,LineID) values(%d,%d,%d)', [nFromStop, nToStop, nBus]); adoQueryStop.SQL.Clear; adoQueryStop.SQL.Add(str); adoQueryStop.Open; } end; frmProgress.pbPubTra.Position := frmProgress.pbPubTra.Position + nOffset; adoQueryBus.Next; end; adoQueryBus.Close; adoQueryStop.Close; adoTableArc.Close; frmProgress.pbPubTra.Position := 5; end; </P> |
|