This is a migrated thread and some comments may be shown as answers.

Using SqlGeospatialDataReader with ADO.NET Entity Data Model

1 Answer 50 Views
Map
This is a migrated thread and some comments may be shown as answers.
#SpecialForces
Top achievements
Rank 1
#SpecialForces asked on 14 Mar 2015, 07:35 AM
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 

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 17 Mar 2015, 11:44 AM
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:RadMap.Provider>
                <telerik:OpenStreetMapProvider />
            </telerik:RadMap.Provider>
            <telerik:VisualizationLayer x:Name="vislayer">
                <telerik:VisualizationLayer.Reader>
                    <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.

Regards,
Petar Mladenov
Telerik
 

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.

 
Tags
Map
Asked by
#SpecialForces
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or