This question is locked. New answers and comments are not allowed.
Hi,
I picked the Telerik sample at http://demos.telerik.com/silverlight/#Map/WktReader and I am trying (unsuccessfully) to implement the SqlGeospatialDataReader PROGRAMATICALLY instead in the XAML files.
Originally it is implemented in the XAML file this way:
PS: I removed the PointTemplate section to make it simpler.
Then, I modified my XAML file to:
And modified my XAML.CS file to:
Since I did things step by step, I know that it stopped to work when I implemented the SqlGeospatialDataReader part. The fill part worked nice. I suspect that the problem is in the Source, but I am not sure.
Any clues about what I am missing here?
Thanks!
I picked the Telerik sample at http://demos.telerik.com/silverlight/#Map/WktReader and I am trying (unsuccessfully) to implement the SqlGeospatialDataReader PROGRAMATICALLY instead in the XAML files.
Originally it is implemented in the XAML file this way:
<telerik:RadMap x:Name="RadMap1" Center="33.7861647934865, -84.371616833534" ZoomLevel="10" MinZoomLevel="4"> <telerik:InformationLayer x:Name="InformationLayer"> <telerik:InformationLayer.Reader> <telerik:SqlGeospatialDataReader Source="{Binding Source={StaticResource DataContext}, Path=WktDataCollection}" GeospatialPropertyName="Geometry" ToolTipFormat="Name"> </telerik:SqlGeospatialDataReader> </telerik:InformationLayer.Reader> <telerik:InformationLayer.ShapeFill> <telerik:MapShapeFill Fill="#7FFFFFFF" Stroke="#5A636B" StrokeThickness="3" /> </telerik:InformationLayer.ShapeFill> <telerik:InformationLayer.HighlightFill> <telerik:MapShapeFill Fill="#B2FFFFFF" Stroke="#5A636B" StrokeThickness="3" /> </telerik:InformationLayer.HighlightFill> </telerik:InformationLayer> </telerik:RadMap>PS: I removed the PointTemplate section to make it simpler.
Then, I modified my XAML file to:
<telerik:RadMap x:Name="RadMap1" Center="33.7861647934865, -84.371616833534" ZoomLevel="10" MinZoomLevel="4"> <telerik:InformationLayer x:Name="InformationLayer" /> </telerik:RadMap>And modified my XAML.CS file to:
public MapShapeFill NFill = new MapShapeFill(); public MapShapeFill HFill = new MapShapeFill(); public SqlGeospatialDataReader SQLR = new SqlGeospatialDataReader(); public MainPage() { InitializeComponent(); // Configure Information Layer Shape Fill NFill.Fill = new SolidColorBrush(Colors.LightGray); NFill.Stroke = new SolidColorBrush(Colors.DarkGray); NFill.StrokeThickness = 3; // Configure Information Layer Highlight Shape Fill HFill.Fill = new SolidColorBrush(Colors.Cyan); HFill.Stroke = new SolidColorBrush(Colors.DarkGray); HFill.StrokeThickness = 3; InformationLayer.ShapeFill = NFill; InformationLayer.HighlightFill = HFill; SQLR.Source = "{Binding Source={StaticResource DataContext}, Path=WktDataCollection}"; SQLR.GeospatialPropertyName = "Geometry"; InformationLayer.Reader = SQLR; RadMap1.Provider = new BingMapProvider(MapMode.Aerial, true, "MyBingToken"); }Since I did things step by step, I know that it stopped to work when I implemented the SqlGeospatialDataReader part. The fill part worked nice. I suspect that the problem is in the Source, but I am not sure.
Any clues about what I am missing here?
Thanks!