I'm using SqlGeospatialDataReader to bind data to my Map. I'm trying to get it to where I can click on a polygon and get information about it. I am unable to get information from the CenterArea that belongs to the polygon. CenterAreas is an ObservableCollection<CenterArea>. Here is my map information:
Here is the OnPreviewReadCompleted code:
How can I get access on click of a polygon to the CenterArea behind it? I want to access the name or some other attribute from it.
Thanks,
Tim
<
telerik:RadMap
x:Name
=
"radMap"
Center
=
"39.36830, -95.27340"
ZoomLevel
=
"5"
MouseClickMode
=
"None"
MapMouseClick
=
"radMap_MouseClick"
>
<
telerik:InformationLayer
x:Name
=
"informationLayer"
>
<
telerik:InformationLayer.Reader
>
<
telerik:SqlGeospatialDataReader
Source
=
"{Binding CenterAreas}"
GeospatialPropertyName
=
"Geometry"
ToolTipFormat
=
"Name"
PreviewReadCompleted
=
"OnPreviewReadCompleted"
>
Here is the OnPreviewReadCompleted code:
private
void
OnPreviewReadCompleted(
object
sender, PreviewReadShapesCompletedEventArgs eventArgs)
{
if
(eventArgs.Error ==
null
)
{
foreach
(FrameworkElement element
in
eventArgs.Items)
{
MapShape shape = element
as
MapShape;
if
(shape !=
null
)
{
shape.MouseLeftButtonDown +=
new
MouseButtonEventHandler(elementMouseLeftButtonDown);
}
}
}
}
How can I get access on click of a polygon to the CenterArea behind it? I want to access the name or some other attribute from it.
Thanks,
Tim