I am trying to create my own Bookmark widget using BookmarksViewModel
However I can not create a bookmark
And that's simply because the function createBookmark is not available.
I basically create a bookmarkviewmodel instance using this line:
this.bookmarksViewModel = new BookmarksViewModel({view: this._mapWidgetModel.view});
I was then trying to use this code snippet from the documentation:
// Creates new bookmark from current view extent
this.bookmarksViewModel.createBookmark().then(function(bookmark){
// Give the bookmark a name
bookmark.name = "New Bookmark";
// Add to bookmarks list
this.bookmarksViewModel.bookmarks.add(bookmark);
});
However, the createBookmark function is not available either in BookmarksViewModel nor in map view object.
The createBookmark() method seems to work with the BookmarksViewModel class. Here's a simple case with the method wired up to a button:
sample