{
var greatLakes = map.GetLayersAsFlattenedList()
.OfType<FeatureLayer>().First(l => l.Name == "Great Lakes");
var michigan = map.GetBookmarks().First(b => b.Name == "Michigan");
//get all features - multiple feature geometries are always returned as a
//single multi-part
var all_features_outline = greatLakes.GetFeatureOutline(mapView, FeatureOutlineType.All);
//or get just the outline of selected features
var qry = new QueryFilter()
{
SubFields = "*",
WhereClause = "NAME in ('Huron','Michigan','Erie')"
};
greatLakes.Select(qry);
var sel_features_outline = greatLakes.GetFeatureOutline(
mapView, FeatureOutlineType.Selected);
greatLakes.ClearSelection();
//or just the visible features
mapView?.ZoomTo(michigan);
var visible_features_outline = greatLakes.GetFeatureOutline(
mapView, FeatureOutlineType.Visible);
}
{
await QueuedTask.Run(() =>
{
//Get the first bookmark with the given name.
var bookmark = mapView.Map.GetBookmarks().FirstOrDefault(b => b.Name == bookmarkName);
if (bookmark == null)
{
// Manage the error - bookmark not found
}
//Zoom the view to the bookmark.
mapView.ZoomTo(bookmark);
});
}
{
await QueuedTask.Run(() =>
{
//Get the first bookmark with the given name.
var bookmark = mapView.Map.GetBookmarks().FirstOrDefault(b => b.Name == bookmarkName);
if (bookmark == null)
{
// Manage the error - bookmark not found
}
//Zoom the view to the bookmark.
mapView.ZoomToAsync(bookmark, TimeSpan.FromSeconds(2));
});
}
{
await QueuedTask.Run(() =>
{
//Get the first bookmark with the given name.
var bookmark = mapView.Map.GetBookmarks().FirstOrDefault(b => b.Name == bookmarkName);
if (bookmark == null)
{
// Manage the error - bookmark not found
}
//Pan the view to the bookmark.
mapView.PanTo(bookmark);
});
}
{
//Get the first bookmark with the given name.
var bookmark = mapView.Map.GetBookmarks().FirstOrDefault(b => b.Name == bookmarkName);
if (bookmark == null)
{
// Manage the error - bookmark not found
}
//Pan the view to the bookmark.
mapView.PanToAsync(bookmark, TimeSpan.FromSeconds(2));
}
{
await QueuedTask.Run(() =>
{
var map = mapView.Map;
//Find the first bookmark with the name
var bookmark = map.GetBookmarks().FirstOrDefault(b => b.Name == bookmarkName);
if (bookmark == null)
{
//Bookmark not found
}
//Move the bookmark to the top of the list
map.MoveBookmark(bookmark, 0);
});
}
{
oldBookmark = mapView.Map.GetBookmarks().FirstOrDefault(b => b.Name == bookmarkName);
oldBookmark.Rename(newBookmarkName);
}
{
await QueuedTask.Run(() =>
{
//Find the first bookmark with the name
var bookmark = mapView.Map.GetBookmarks().FirstOrDefault(b => b.Name == bookmarkName);
if (bookmark == null)
{
//Bookmark not found
}
//Remove the bookmark
mapView.Map.RemoveBookmark(bookmark);
});
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)