|
阅读:1611回复:5
有用delphi开发的吗?
<P>procedure TForm1.MapControl1MouseDown(ASender: TObject; button, shift, x,
y: Integer; mapX, mapY: Double); var envlp: IEnvelope; bIsEmpty: wordbool; begin //在Mapcontrol上按下鼠标左键后做拉框操作,实现地图放大功能 if (Button = 1) and (Shift = 0) then begin MapControl1.MousePointer := esriPointerZoomIn; MapControl1.Extent:=MapControl1.TrackRectangle ;</P> <P> // envlp := MapControl1.TrackRectangle; // envlp.Get_IsEmpty(bIsEmpty); // if not bIsEmpty then // MapControl1.Extent := envlp; exit; end;</P> <P>运行后,当鼠标拉框后,出现“找不到成员“的错误,谁能帮我一把,谢谢!</P> |
|
|
1楼#
发布于:2005-04-12 16:01
<P>var
pWF:IWorkspaceFactory; pFW:IFeatureWorkspace; pFC:IFeatureClass; pGL:IGeoFeatureLayer; pSimpleRender:ISimpleRenderer; pFillSymbol:ISimpleFillSymbol; pOutlineSymbol:ISimpleLineSymbol; begin pFillSymbol:=CoSimpleFillSymbol.create as ISimpleFillSymbol; pFillSymbol.Color:=g_display.GetRGBColor(235,202,250);</P><P> pOutlineSymbol:=CoSimpleLineSymbol.create as ISimpleLineSymbol; pOutlineSymbol.Color:=g_display.GetRGBColor(0,0,0); pOutlineSymbol.Width:=1;</P><P> pFillSymbol.Outline:=pOutlineSymbol;</P><P> pSimpleRender:=CoSimpleRenderer.Create as ISimpleRenderer; pSimpleRender.Symbol:=Isymbol(pFillSymbol); result:=true; try pWF:=COShapefileWorkspaceFactory.create as IWorkspaceFactory; pFW:=pWF.OpenFromFile(mPath,Application.Handle) as IFeatureWorkspace; pFC:=pFW.OpenFeatureClass(mFileName); pGL:=CoFeatureLayer.create as IGeoFeatureLayer; pGL.Name:=pFC.AliasName; pGL.FeatureClass:=pFC; pGL.Renderer:=pSimpleRender as IfeatureRenderer; m_Map.AddLayer(pGL,0) except end; end;</P><P>上面的代码有错误吗?高手指教一下</P> |
|
|
2楼#
发布于:2005-04-04 16:16
<P>楼上的好人</P>
|
|
|
|
3楼#
发布于:2005-04-04 16:00
<DIV class=quote><B>以下是引用<I>whereto</I>在2005-3-25 10:42:42的发裕?lt;/B>
<P>procedure TForm1.MapControl1MouseDown(ASender: TObject; button, shift, x, y: Integer; mapX, mapY: Double); var envlp: IEnvelope; bIsEmpty: wordbool; begin //在Mapcontrol上按下鼠标左键后做拉框操作,实现地图放大功能 if (Button = 1) and (Shift = 0) then begin MapControl1.MousePointer := esriPointerZoomIn; MapControl1.Extent:=MapControl1.TrackRectangle ;</P> <P> // envlp := MapControl1.TrackRectangle; // envlp.Get_IsEmpty(bIsEmpty); // if not bIsEmpty then // MapControl1.Extent := envlp; exit; end;</P> <P>运行后,当鼠标拉框后,出现“找不到成员“的错误,谁能帮我一把,谢谢!</P> </DIV> <P> MapControl1.activeView.extent:=MapControl1.DefaultInterface.TrackRectangle;</P></B> |
|
|
|
4楼#
发布于:2005-03-29 20:50
楼主,有没有其它delphi源码,能不能贴点出来,让大家学学
|
|
|
5楼#
发布于:2005-03-25 11:30
用activeview接口尝试下
|
|
|