ArcObject operations: "add bookmarks", "locate bookmarks", and "delete bookmarks"

Source: Internet
Author: User

Private Sub add bookmarks ToolStripMenuItem_Click (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles add bookmarks ToolStripMenuItem. Click

Dim pMapBookMarks As IMapBookmarks
PMapBookMarks = Me. AxMapControl1.ActiveView. FocusMap
Dim pAOIBookMark As IAOIBookmark
PAOIBookMark = New AOIBookmark
PAOIBookMark. Location = Me. AxMapControl1.ActiveView. Extent
PMapBookMarks. AddBookmark (pAOIBookMark)

End Sub

 

Private Sub positioning bookmarks ToolStripMenuItem_Click (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles positioning bookmarks ToolStripMenuItem. Click

Dim pMapBookMarks As IMapBookmarks
PMapBookMarks = Me. AxMapControl1.ActiveView. FocusMap
Dim pEnumSpatialBM As IEnumSpatialBookmark
PEnumSpatialBM = pMapBookMarks. Bookmarks
Dim pSpatialBM As ISpatialBookmark

'The first bookmarks are located here.

PSpatialBM = pEnumSpatialBM. Next

PSpatialBM. ZoomTo (Me. AxMapControl1.ActiveView. FocusMap)
Me. AxMapControl1.ActiveView. Refresh ()

End Sub

 

Private Sub Delete specified bookmarks ToolStripMenuItem_Click (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles Delete specified bookmarks ToolStripMenuItem. Click

Dim pMapBookMarks As IMapBookmarks
PMapBookMarks = Me. AxMapControl1.ActiveView. FocusMap
Dim pEnumSpatialBM As IEnumSpatialBookmark
PEnumSpatialBM = pMapBookMarks. Bookmarks
Dim pSpatialBM As ISpatialBookmark

'The first bookmarks are deleted here.

PSpatialBM = pEnumSpatialBM. Next

PMapBookMarks. RemoveBookmark (pSpatialBM)

End Sub

 

Private Sub delete all bookmarks ToolStripMenuItem_Click (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles delete all bookmarks ToolStripMenuItem. Click

Dim pMapBookMarks As IMapBookmarks
PMapBookMarks = Me. AxMapControl1.ActiveView. FocusMap
PMapBookMarks. RemoveAllBookmarks ()

End Sub

 

Note that when we delete a tag, all the tags in the tag queue will be moved forward one by one, and the total number of tags will be reduced by one;

When tags are located, the sequence number before the tags are deleted remains the same, and the sequence number after the tags are deleted will be reduced by one

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.