I have a collection of ScanSessions, each of which contains a collection of Waypoints. I have a RadGridView for displaying a list of the ScanSessions and I have another RadGridView for displaying the list of Waypoints in the selected ScanSession. I am also trying to write the XAML to create a RadMap InformationLayer that displays all the Waypoints for all the ScanSessions on a map. The reason for this is to make it easy to indicate on the map which Waypoint is selected in the grid view and vice versa.
I tried to do this by nesting one InformationLayer inside another as seen in the following XAML:
The problem is that none of the Waypoint ellipses are displayed. I have also tried replacing both the outer and inner InformationLayer elements with simple ItemsControl elements, with no success.
Note that the InformationLayer named scanSessionSnailTrailLayer works just fine.
Does anybody have an idea how to get my nested InformationLayers to work?
Thanks,
-- john
I tried to do this by nesting one InformationLayer inside another as seen in the following XAML:
<
UserControl.Resources
>
<
local:LocationToTelerikConverter
x:Key
=
"LocationToTelerikConverter"
/>
<
local:LocationCollectionToTelerikLocationCollectionConverter
x:Key
=
"LocationCollectionToTelerikLocationCollectionConverter"
/>
<
SolidColorBrush
x:Key
=
"ControlSubtleForegroundBrush"
Color
=
"#004100"
/>
<
DataTemplate
x:Key
=
"MapWaypointsTemplate"
>
<
Grid
Tag
=
"{Binding}"
telerik:MapLayer.Location
=
"{Binding Path=Location, Converter={StaticResource LocationToTelerikConverter}}"
>
<
telerik:MapLayer.HotSpot
>
<
telerik:HotSpot
ElementName
=
"WaypointEllipse"
X
=
"0.5"
Y
=
"0.5"
XUnits
=
"Fraction"
YUnits
=
"Fraction"
/>
</
telerik:MapLayer.HotSpot
>
<
Ellipse
x:Name
=
"WaypointEllipse"
Width
=
"20"
Height
=
"20"
Fill
=
"Blue"
/>
</
Grid
>
</
DataTemplate
>
</
UserControl.Resources
>
<
Grid
Background
=
"Black"
>
<
telerik:RadMap
x:Name
=
"map"
Background
=
"Transparent"
UseSpringAnimations
=
"False"
DistanceUnit
=
"Kilometer"
MouseClickMode
=
"None"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
UseDefaultLayout
=
"False"
MaxZoomLevel
=
"24"
MinZoomLevel
=
"1"
ZoomLevel
=
"1"
MapMouseClick
=
"OnMapMouseClick"
CenterChanged
=
"OnMapCenterChanged"
ZoomChanged
=
"OnMapZoomChanged"
InitializeCompleted
=
"OnMapInitializeCompleted"
PreviewMouseMove
=
"OnMapPreviewMouseMove"
>
<
telerik:RadMap.Providers
>
<
telerik:EmptyProvider
/>
<!-- Provider set programmatically. -->
</
telerik:RadMap.Providers
>
<
telerik:InformationLayer
x:Name
=
"scanSessionSnailTrailLayer"
ItemsSource
=
"{Binding ElementName=_this, Path=ScanSessions}"
>
<
telerik:InformationLayer.ItemTemplate
>
<
DataTemplate
>
<
telerik:MapPolyline
Stroke
=
"Blue"
StrokeThickness
=
"2"
Points
=
"{Binding Path=WaypointLocations, Converter={StaticResource LocationCollectionToTelerikLocationCollectionConverter}}"
/>
</
DataTemplate
>
</
telerik:InformationLayer.ItemTemplate
>
</
telerik:InformationLayer
>
<
telerik:InformationLayer
x:Name
=
"scanSessionWaypointsOuter"
ItemsSource
=
"{Binding ElementName=_this, Path=ScanSessions}"
>
<
telerik:InformationLayer.ItemTemplate
>
<
DataTemplate
>
<
telerik:InformationLayer
x:Name
=
"scanSessionWayPointsInner"
ItemsSource
=
"{Binding Path=Waypoints}"
ItemTemplate
=
"{StaticResource MapWaypointsTemplate}"
/>
</
DataTemplate
>
</
telerik:InformationLayer.ItemTemplate
>
</
telerik:InformationLayer
>
</
telerik:RadMap
>
</
Grid
>
The problem is that none of the Waypoint ellipses are displayed. I have also tried replacing both the outer and inner InformationLayer elements with simple ItemsControl elements, with no success.
Note that the InformationLayer named scanSessionSnailTrailLayer works just fine.
Does anybody have an idea how to get my nested InformationLayers to work?
Thanks,
-- john