pageLayoutControl与Mapcontrol同步(VB)

Option Explicit

Implements esriCarto.IMaps

Public m_Collection As Collection

Private Sub Class_Initialize()

  Set m_Collection = New Collection

End Sub

'----------------IMaps接口的方法及属性的实现--------------------

'得到collection中的元素的个数

Private Property Get IMaps_Count() As Long

  IMaps_Count = m_Collection.count

End Property

'通过指定索引得到map

Private Property Get IMaps_Item(ByVal mapIndex As Long) As IMap

  If mapIndex > m_Collection.count Or mapIndex < 0 Then

    MsgBox "BSMaps::Item:\r\n索引超出界限!"

    Exit Property

  End If

  Set IMaps_Item = m_Collection.Item(mapIndex + 1)

End Property

'向集合中添加map对象

Private Sub IMaps_Add(ByVal map As IMap)

  If isNull(map) Or map Is Nothing Then

    MsgBox "Maps::Add:\r\n对象还没有初始化!"

    Exit Sub

  End If

  m_Collection.Add map

End Sub

'新建一个Map对象

Private Function IMaps_Create() As IMap

  Dim newMap As IMap

  Set newMap = New map

  m_Collection.Add newMap

  Set IMaps_Create = newMap

End Function

'清除collection中所有元素

Private Sub IMaps_reset()

  Dim idx As Integer

  For idx = 1 To m_Collection.count

    m_Collection.Remove idx

  Next idx

End Sub

'通过指定索引移除map

Private Sub IMaps_remove(ByVal map As IMap)

  If mapIndex > m_Collection.count Or mapIndex <= 0 Then

    MsgBox "BSMaps::RemoveAt:\r\n索引超出界限!"

    Exit Sub

  End If

  m_Collection.Remove mapIndex

End Sub

Private Sub IMaps_removeAt(ByVal idx As Long)

'

End Sub

转载于:https://www.cnblogs.com/bluemaplestudio/archive/2010/02/28/1675168.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值