- Associate the bookmarks control with a
MapView
orSceneView
(GeoView
property), through binding on supported platforms (WPF, UWP, Forms) or plain properties otherwise. - Display a list of bookmarks, defined by the
Map
orScene
from the associatedGeoView
or theBookmarksOverride
if set. - Navigates the associated
GeoView
to the selected bookmark. - Customize the display of the list with the
ItemTemplate
property on UWP and WPF. - Supports observable collections for
BookmarksOverride
and handles changes to theMap
/Scene
properties.
For bookmarks to appear in the control, you must set either GeoModel.Bookmarks
or BookmarksView.BookmarksOverride
.
<Grid xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
ColumnDefinitions="*,300">
<esri:MapView x:Name="MyMapView" />
<esri:BookmarksView Grid.Column="1"
GeoView="{x:Reference MyMapView}" />
</Grid>
To customize the item template:
<esri:BookmarksView xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
Grid.Column="1"
GeoView="{x:Reference MyMapView}">
<esri:BookmarksView.ItemTemplate>
<DataTemplate>
<TextCell Text="{Binding Name}"
TextColor="Red" />
</DataTemplate>
</esri:BookmarksView.ItemTemplate>
</esri:BookmarksView>
<Grid xmlns:esri="using:Esri.ArcGISRuntime.UI.Controls"
xmlns:toolkit="using:Esri.ArcGISRuntime.Toolkit.UI.Controls">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="300" />
</Grid.ColumnDefinitions>
<esri:MapView x:Name="MyMapView" />
<toolkit:BookmarksView Grid.Column="1"
GeoView="{Binding ElementName=MyMapView}" />
</Grid>
You can customize the BookmarksView
bookmark display by setting the ItemTemplate
property with a customized DataTemplate
.
<toolkit:BookmarksView xmlns:toolkit="using:Esri.ArcGISRuntime.Toolkit.UI.Controls"
Grid.Column="1"
GeoView="{Binding ElementName=MyMapView}">
<toolkit:BookmarksView.ItemTemplate>
<DataTemplate>
<TextBlock Foreground="Red"
Text="{Binding Name}" />
</DataTemplate>
</toolkit:BookmarksView.ItemTemplate>
</toolkit:BookmarksView>
<Grid xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="300" />
</Grid.ColumnDefinitions>
<esri:MapView x:Name="MyMapView" />
<esri:BookmarksView Grid.Column="1"
GeoView="{Binding ElementName=MyMapView}" />
</Grid>