Using SqlGeospatialDataReader with ADO.NET Entity Data Model

2 posts, 0 answers
  1. Takudzwa
    Takudzwa avatar
    1 posts
    Member since:
    Oct 2014

    Posted 14 Mar 2015 Link to this post

    Hie guys, I am new to telerik, i have a database with several tables, each with a Well Known Binary Column that defines geometry of buildings and roads. I have created or rather added an ADO.NET Entity Data Model in a separate class library project. I want to know how to set this EDM as the data source for my RadMap Information / Visualization Layer. Sample Codes will be most appreciated. I cant get anything from the Examples in the Documentation 
  2. Petar Mladenov
    Petar Mladenov avatar
    2986 posts

    Posted 17 Mar 2015 Link to this post

    Hi Takudzwa,

    For such scenarios RadMap provides SqlGeospatialDataReader which can be used in InformationLayer and AsyncSqlGeospatialDataReader which can be used in VisualizationLayer. Generally Visualizationlayer is faster in terms of initial load (because it can read / create its objects) asynchronously.

    In your scenario, if your service provides collection of DB objects (for example Shapes) and every Shape has property (DB Table Column) named geometry which provides the geometry descriptions (buildings and roads), the code should look like so:
    <telerik:RadMap x:Name="radMap">
                    <telerik:OpenStreetMapProvider />
                <telerik:VisualizationLayer x:Name="vislayer">
                        <telerik:AsyncSqlGeospatialDataReader  Source="{Binding Shapes}" GeospatialPropertyName="Geometry"/>
    Of course you can se x:Name to the reader and set its Source directly in code behind.

    We hope this information will help you proceed further.

    Petar Mladenov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top