Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 1.16 KB

File metadata and controls

29 lines (19 loc) · 1.16 KB

Bookmarks

The Bookmarks component will display a list of bookmarks in a table view and allows the user to select a bookmark and perform some action.

Bookmarks Behavior

The BookmarksTableViewController can be created using either an AGSGeoView or an array of AGSBookmarks.

Clients must set the delegate property and implement the bookmarksViewController:didSelect delegate method in order to be notified when a bookmark is selected.

The BookmarksTableViewController observes changes to the map or scene property on the AGSGeoView and also the map or scene's bookmarks property and will update the list of bookmarks accordingly.

Usage

bookmarksVC = BookmarksViewController(geoView: mapView)
bookmarksVC?.delegate = self

...

func bookmarksViewController(_ controller: BookmarksViewController, didSelect bookmark: AGSBookmark) {
    if let viewpoint = bookmark.viewpoint {
        mapView.setViewpoint(viewpoint, duration: 2.0)
        dismiss(animated: true)
    }
}

To see it in action, try out the Examples and refer to BookmarksExample.swift in the project.