croc
路人甲
路人甲
  • 注册日期2004-07-16
  • 发帖数25
  • QQ
  • 铜币262枚
  • 威望0点
  • 贡献值0点
  • 银元0个
30楼#
发布于:2004-07-20 21:48
<img src="images/post/smile/dvbbs/em03.gif" /><img src="images/post/smile/dvbbs/em01.gif" />
举报 回复(0) 喜欢(0)     评分
barty898
路人甲
路人甲
  • 注册日期2004-07-22
  • 发帖数89
  • QQ
  • 铜币-57枚
  • 威望0点
  • 贡献值0点
  • 银元0个
31楼#
发布于:2004-07-28 21:38
收获很大
举报 回复(0) 喜欢(0)     评分
honghu
路人甲
路人甲
  • 注册日期2003-08-06
  • 发帖数113
  • QQ
  • 铜币292枚
  • 威望0点
  • 贡献值0点
  • 银元0个
32楼#
发布于:2004-07-29 12:59
<P>希望这个话题能够继续下去。</P><P>我有个建议,斑竹可以把具体的构建思路表达出来(大家商量一下更好),可以为这个系统起个名字,然后每天(或两天)确定一个任务(单独发贴),对这个问题感兴趣的可以编码跟贴,然后由斑竹或大家讨论最好的编码。</P>
举报 回复(0) 喜欢(0)     评分
kisssy
卧底
卧底
  • 注册日期2004-04-18
  • 发帖数235
  • QQ
  • 铜币614枚
  • 威望2点
  • 贡献值0点
  • 银元0个
33楼#
发布于:2004-08-01 21:52
楼上的建议不错啊
个人专栏: https://zhuanlan.zhihu.com/c_165676639
举报 回复(0) 喜欢(0)     评分
honghu
路人甲
路人甲
  • 注册日期2003-08-06
  • 发帖数113
  • QQ
  • 铜币292枚
  • 威望0点
  • 贡献值0点
  • 银元0个
34楼#
发布于:2004-08-02 00:15
<P>就是不知道什么时候能开始啊。我先报名先</P>
举报 回复(0) 喜欢(0)     评分
cool小飞侠
路人甲
路人甲
  • 注册日期2004-08-02
  • 发帖数122
  • QQ
  • 铜币4枚
  • 威望0点
  • 贡献值0点
  • 银元0个
35楼#
发布于:2004-08-03 09:14
对阿.这些功能vba里面不是可以通过拖拽相应按钮添加么?为什么还要写代码呢??
举报 回复(0) 喜欢(0)     评分
kisssy
卧底
卧底
  • 注册日期2004-04-18
  • 发帖数235
  • QQ
  • 铜币614枚
  • 威望2点
  • 贡献值0点
  • 银元0个
36楼#
发布于:2004-08-06 12:39
<P>好长时间没来了,前段时间参加关于那个Arcgis竞赛的编程,具体的程序,以后我会贴出来,这里可以跟大家讨论一下关于在Mapcontrol中添加图例的问题,虽然问题有点老,而且相应的控件已经快出来了,不过我们的目的还是:通过自己动手写,增加自己的"经验值"呵呵</P><P>那么首先可以讨论一下如何实现Renderer为:ClassBreaksRenderer(说明:Renderer为SimpleRenderer的实现过程,已有相关贴子),过几天,我会把我的实现过程发上来.</P>
个人专栏: https://zhuanlan.zhihu.com/c_165676639
举报 回复(0) 喜欢(0)     评分
zhousky
论坛版主
论坛版主
  • 注册日期2003-08-01
  • 发帖数281
  • QQ
  • 铜币1027枚
  • 威望3点
  • 贡献值0点
  • 银元0个
37楼#
发布于:2004-08-09 11:16
<P>偶是新手,刚入门,先贴一个代码,就是ARCGIS中的IDENTIFY功能,偶的功能比ARCGIS稍微改进了一下,就是在鼠标按下时,如果没有地物就不弹出属性窗口,代码中如有不对,请大家指正,呵呵,偶是刚学的,希望大家不要见笑</P><P>Public Sub mapIdentify(m_map As MapControl, x As Long, y As Long) '////属性窗口
  Dim pIdentifyDialog As IIdentifyDialog
  Dim pIdentifyDialogProps As IIdentifyDialogProps
  Dim pEnumLayer As IEnumLayer
  Dim pLayer As ILayer
  
  Dim pPoint As IPoint                                                                        '//
  Dim pLyr As ILayer                                                                          '//
  Dim pIdentify As IIdentify                                                                  '//
  Dim pIDArray As IArray                                                                      '//
  Dim i As Long                                                                               '//
  Dim j As Long                                                                               '//判断鼠标按下的点
  For j = 0 To m_map.LayerCount - 1                                                           '//是否有地物,如有
    Set pIdentify = m_map.Layer(j)                                                            '//弹出属性框,没有
    Set pPoint = m_map.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y)        '//则无任何显示,比
    Set pIDArray = pIdentify.Identify(pPoint)                                                 '//ARCGIS的属性功能
    If Not pIDArray Is Nothing Then                                                           '//稍微改进了一下
      i = i + 1                                                                               '//
    End If                                                                                    '//
  Next                                                                                        '//
  If i = 0 Then Exit Sub                                                                      '//
  
  Set pIdentifyDialog = New IdentifyDialog
  Set pIdentifyDialogProps = pIdentifyDialog
  Set pIdentifyDialog.map = m_map.ActiveView.FocusMap
  Set pIdentifyDialog.Display = m_map.ActiveView.ScreenDisplay
  pIdentifyDialog.ClearLayers
  Set pEnumLayer = pIdentifyDialogProps.Layers
  pEnumLayer.Reset
  Set pLayer = pEnumLayer.Next
  Do While (Not pLayer Is Nothing)
    'Set pPoint = m_map.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y)
    'pIdentifyDialog.AddLayerIdentifyOID pLayer, pPoint.ID  '////flash the OID object,需进一步研究
    pIdentifyDialog.AddLayerIdentifyPoint pLayer, x, y
    Set pLayer = pEnumLayer.Next
  Loop</P><P>  pIdentifyDialog.Show
End Sub</P>
不要看我噢
举报 回复(0) 喜欢(0)     评分
kisssy
卧底
卧底
  • 注册日期2004-04-18
  • 发帖数235
  • QQ
  • 铜币614枚
  • 威望2点
  • 贡献值0点
  • 银元0个
38楼#
发布于:2004-08-10 22:20
<P>好啊,期待继续呵呵</P>
个人专栏: https://zhuanlan.zhihu.com/c_165676639
举报 回复(0) 喜欢(0)     评分
honghu
路人甲
路人甲
  • 注册日期2003-08-06
  • 发帖数113
  • QQ
  • 铜币292枚
  • 威望0点
  • 贡献值0点
  • 银元0个
39楼#
发布于:2004-08-12 16:07
<P>addshapefiles修正版,可直接拷贝使用</P><P 0cm 0cm 0pt"><FONT face="Times New Roman">Public Sub AddShapeFile()</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Dim pWorkspaceFactory As IWorkspaceFactory</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Dim pFeatureWorkspace As IFeatureWorkspace</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Dim pFeatureLayer As IFeatureLayer</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Dim pMxDocument As IMxDocument</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Dim pMap As IMap</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  </FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Dim pFeatureDataset As IGxDataset</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Dim pGxDialog As IGxDialog</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Dim pGxCatalog As IGxCatalog</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Set pGxDialog = New GxDialog</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  With pGxDialog</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">    .AllowMultiSelect = False</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">    Set .ObjectFilter = New GxFilterFeatureClasses</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">    .DoModalOpen ThisDocument.Parent.hWnd, Nothing</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">    Set pGxCatalog = .InternalCatalog</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">    Set pFeatureDataset = pGxCatalog.SelectedObject</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  End With</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Dim sWSName As String</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Dim sFeatureName As String</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">    sFeatureName = pFeatureDataset.Dataset.BrowseName</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">    sWSName = pFeatureDataset.Dataset.Workspace.PathName</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">    'MsgBox pFeatureDataset.Dataset.Name</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  'Create a new ShapefileWorkspaceFactory object and open a shapefile folder</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Set pWorkspaceFactory = New ShapefileWorkspaceFactory</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  </FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Set pFeatureWorkspace = pWorkspaceFactory.OpenFromFile(sWSName, 0)</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  'Create a new FeatureLayer and assign a shapefile to it</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman"> </FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Set pFeatureLayer = New FeatureLayer</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  </FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Set pFeatureLayer.FeatureClass = pFeatureWorkspace.OpenFeatureClass(sFeatureName)</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  pFeatureLayer.Name = pFeatureLayer.FeatureClass.AliasName</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  'Add the FeatureLayer to the focus map</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Set pMxDocument = Application.Document</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  Set pMap = pMxDocument.FocusMap</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  pMap.AddLayer pFeatureLayer</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">  pMxDocument.ActiveView.Refresh</FONT></P><P 0cm 0cm 0pt"><FONT face="Times New Roman">End Sub</FONT></P>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部