40楼#
发布于:2004-08-09 11:32
<P>iniFile:=TIniFile.Create(ExtractFilePath(Application.ExeName)+'FileTemp\51.ini');
PtNumber:=iniFile.ReadInteger('消防中队','PtNumber',0); pt := CoPoint.Create; for i:=1 to PtNumber do begin StrPtCoordinate:=iniFile.ReadString('消防中队','Pt'+IntToStr(i),''); dealStrLocation(StrPtCoordinate,strPtX,strPtY); pt.Set_(StrToFloat(strPtX),StrToFloat(strPtY)); Style:=Map.DefaultStyle; Style.SymbolType := miSymbolTypeBitmap; Style.SymbolBitmapColor := miColorRed; Style.SymbolBitmapSize := 12; Style.SymbolBitmapTransparent:=true; Style.SymbolBitmapName:='fire1-32.bmp'; ftr:=Map.FeatureFactory.CreateSymbol(pt,Style); Map.Layers.Item('FireTeam').AddFeature(ftr,EmptyParam); end; iniFile.Free; </P><P>在安装目录,例如:C:\Program Files\MapInfo MapX\Program\CUSTSYMB中加入创建自己的图标。</P><P>在程序中 创建</P><P>CMapXStyle style; style = m_ctrlMapX.GetDefaultStyle(); style.SetSymbolType(1); style.SetSymbolBitmapName("CAR1-32.bmp"); style.SetSymbolBitmapSize(20); style.SetSymbolBitmapOverrideColor(0); style.SetSymbolBitmapTransparent(1);</P><P> fNewFeature = m_ctrlMapX.GetFeatureFactory().CreateSymbol(); //设定符号样式 fNewFeature.SetStyle(style); fNewFeature.GetPoint().Set(dLongtitude,dLatitude); //设定标注内容 CString strInfo = " "; fNewFeature.SetKeyValue(strInfo); //设定标注内容 //将符号加入图层 newFeature.m_feature = layer.AddFeature(fNewFeature); </P> |
|
41楼#
发布于:2004-08-04 12:00
<P>动态加载图层,仅供参考!</P><P>procedure TfrmMain.mAddLayerClick(Sender: TObject);
var FilterIndex,iCount:Integer; sFileName:String; begin iCount:= MapX.Layers.Count+1; OpenDialog.InitialDir := sPath; OpenDialog.Filter :='图层集合 *.gst|*.gst|MapInfo 图层 *.tab|*.tab'; OpenDialog.Title := '添加图层'; if OpenDialog.Execute then begin FilterIndex := OpenDialog.FilterIndex; sFileName := OpenDialog.FileName; case FilterIndex of 1: MapX.Layers.AddGeoSetLayers(sFileName); 2: MapX.Layers.Add(sFileName,iCount); end; MapX.Refresh ; mFullClick(Sender); end; SetCurrentDir(sPath); end;</P> |
|
|
42楼#
发布于:2004-07-28 09:38
<P>非常感谢!</P><P>大家有的多发些在,呵呵.</P>
|
|
43楼#
发布于:2004-07-18 12:02
<P>layername := comblytxt.Text;
application.MessageBox(PCHAR(layername),'',0); <a>lyr</A> := currentmap.Layers.Item['street']; <a>lyr.Find.RefineLayer</A> := currentmap.Layers.Item['street']; foundobj := lyr.Find.Search(findtxt.Text,'');</P><P>在<a>lyr</A> := currentmap.Layers.Item['street']; 这里出现的错误信息是 not enough actual </P><P>parameters?</P><P>怎么解决呢</P> |
|
44楼#
发布于:2004-07-18 10:40
<P>Map1.Geoset := ExtractFilePath(Application.ExeName) + 'Maps\beijingmap.gst';
Map1.SearchPath := ExtractFilePath(Application.ExeName) + 'Maps\'; 引入地图的例子。</P><P>我还请问。查询怎么做呢?</P> |
|
45楼#
发布于:2004-07-17 18:47
非常感谢
|
|
46楼#
发布于:2004-07-02 14:51
<P>我有个插入图元的例子,你看有用没有咯</P><P> Lyr1:=map1.Layers.Item('图层名);
Lyr1.Editable:=True; pnt:=copoint.Create; feafrc := map1.FeatureFactory; newstyle := Costyle.Create; pnt.Set_(x1,y1); newstyle.SymbolType:=2; newstyle.SymbolCharacter:=35; newstyle.SymbolVectorColor:=micolorBlue; newstyle.SymbolVectorSize:=20; Ftr := feafrc.CreateSymbol(pnt,newstyle); Lyr1.AddFeature(Ftr,emptyparam);</P> |
|
47楼#
发布于:2004-06-18 09:34
有没有实现修改图元属性的例子呀?
|
|
|
48楼#
发布于:2004-06-17 14:07
<P>前面有人问的winsock的实现</P><P>procedure TFrmMain.sockGPSServerConnectionRequest(ASender: TObject;
requestID: Integer); begin if sockGPSServer.State<>sckClosed then sockGPSServer.close; sockGPSServer.Accept(requestID); end;</P><P>procedure TFrmMain.sockGPSServerDataArrival(ASender: TObject; bytesTotal: Integer); var strData:olevariant; strGPS:string; strLongitude,strLatitude:string; begin sockGPSServer.GetData(strData,8); strGPS:=strData; dealStrLocation(strGPS,strLongitude,strLatitude);//接收GPS信息进行处理 GPSLocation(strLongitude,strLatitude);// end;</P> |
|
49楼#
发布于:2004-05-13 14:54
顶!
|
|