zoukankan      html  css  js  c++  java
  • 如何用代码设置图层在特定比例尺下显示

    Option Explicit
    Implements ICommand
    Implements ICommandSubType
    Private m_pHookHelper As IHookHelper
    Private m_pMapControl As IMapControl3
    Private m_lSubType As Long
    Private Sub Class_Initialize()  
      Set m_pHookHelper = New HookHelper  
    End Sub
    Private Sub Class_Terminate()  
      Set m_pHookHelper = Nothing  
    End Sub
    Private Property Get ICommand_Enabled() As Boolean  
      Dim bEnabled As Boolean
      bEnabled = True
      Dim pLayer As ILayer
      Set pLayer = m_pMapControl.CustomProperty
      If (m_lSubType = 3) Then
        If (pLayer.MaximumScale = 0) And (pLayer.MinimumScale = 0) Then bEnabled = False
      End If
        ICommand_Enabled = bEnabled
      End Property
    Private Property Get ICommand_Checked() As Boolean  
      ICommand_Checked = False  
    End Property
    Private Property Get ICommand_Name() As String
        ICommand_Name = "ScaleThresholds"  
    End Property
    Private Property Get ICommand_Caption() As String  
      If (m_lSubType = 1) Then
        ICommand_Caption = "Set Maximum Scale"
      ElseIf (m_lSubType = 2) Then
        ICommand_Caption = "Set Minimum Scale"
      Else
        ICommand_Caption = "Remove Scale Thresholds"
      End If
    End Property
    Private Property Get ICommand_Tooltip() As String  
      'Not implemented  
    End Property
    Private Property Get ICommand_Message() As String  
      'Not implemented  
    End Property
    Private Property Get ICommand_HelpFile() As String
        'Not implemented  
    End Property
    Private Property Get ICommand_HelpContextID() As Long  
      'Not implemented  
    End Property
    Private Property Get ICommand_Bitmap() As esriSystem.OLE_HANDLE
        'Not implemented
    End Property
    Private Property Get ICommand_Category() As String
        'Not implemented
      End Property
    Private Sub ICommand_OnCreate(ByVal hook As Object)
      Set m_pHookHelper.hook = hook
      Set m_pMapControl = m_pHookHelper.hook
      End Sub
    Private Sub ICommand_OnClick()
        Dim pLayer As ILayer
      Set pLayer = m_pMapControl.CustomProperty
      If (m_lSubType = 1) Then pLayer.MaximumScale = m_pMapControl.MapScale
      If (m_lSubType = 2) Then pLayer.MinimumScale = m_pMapControl.MapScale
      If (m_lSubType = 3) Then
        pLayer.MaximumScale = 0
        pLayer.MinimumScale = 0
      End If
      m_pMapControl.Refresh esriViewDrawPhase.esriViewGeography
    End Sub
  • 相关阅读:
    Ubuntu 制作run安装包 依赖mono开发的软件 半自动安装包
    Windows C# to Linux Mono
    Ubuntu 18.04 操作简记
    Ubuntu 安装 Qt 简记
    Visual Studio操作记录
    WinForm项目中使用Xaml资源字典
    加载大量控件
    executable file and DLL
    微信小程序IOS系统兼容 Date.parse() 时间字符串转时间戳
    谷歌浏览器禁用 页面js
  • 原文地址:https://www.cnblogs.com/zhangjun1130/p/1409499.html
Copyright © 2011-2022 走看看