3 Answers, 1 is accepted
0
Hello Adi,
Please review the Getting Started with Client-side Data Binding article where some examples are provided and check if that helps to resolve the issue.
If not, please provide a sample of the object you are trying to bind the Map to so that we have a better understanding of your scenario and be able to provide more specific suggestions.
Regards,
Peter Milchev
Progress Telerik
Please review the Getting Started with Client-side Data Binding article where some examples are provided and check if that helps to resolve the issue.
If not, please provide a sample of the object you are trying to bind the Map to so that we have a better understanding of your scenario and be able to provide more specific suggestions.
Regards,
Peter Milchev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
adi
Top achievements
Rank 1
answered on 11 Apr 2018, 08:24 AM
I used the silverlight RadMap control in the past and want to switch to ASP.NET RadMap control. In Silverlight, I had an InformationLayer with a SqlGeospatialDataReader (see sample code). That works fine for Silverlight. In ASP.NET RadMap, I did not find
<
telerik:InformationLayer
x:Name
=
"structureLayer"
>
<
telerik:InformationLayer.Reader
>
<
telerik:SqlGeospatialDataReader
x:Name
=
"sqlReader"
GeospatialPropertyName
=
"Polygon"
ReadCompleted
=
"sqlReader_ReadCompleted"
ToolTipFormat
=
"{} {Abbreviation}"
>
<
telerik:SqlGeospatialDataReader.ToolTipTemplate
>
<
DataTemplate
>
<
StackPanel
Margin
=
"10,5"
>
<
TextBlock
FontWeight
=
"Bold"
Text
=
"{Binding Converter={StaticResource ExtendedDataConverter}, ConverterParameter='Abbreviation'}"
></
TextBlock
>
<
TextBlock
Text
=
"{Binding Converter={StaticResource ExtendedDataConverter}, ConverterParameter='Name', StringFormat='NAME: {0:#,#.0}'}"
></
TextBlock
>
<
TextBlock
Text
=
"{Binding Converter={StaticResource ExtendedDataConverter}, ConverterParameter='Id', StringFormat='ID: {0:#,#.0}'}"
></
TextBlock
>
</
StackPanel
>
</
DataTemplate
>
</
telerik:SqlGeospatialDataReader.ToolTipTemplate
>
</
telerik:SqlGeospatialDataReader
>
</
telerik:InformationLayer.Reader
>
<
telerik:InformationLayer.ShapeFill
>
<
telerik:MapShapeFill
Stroke
=
"Crimson"
StrokeThickness
=
"1"
>
<
telerik:MapShapeFill.Fill
>
<
SolidColorBrush
Color
=
"Gainsboro"
Opacity
=
"0.4"
/>
</
telerik:MapShapeFill.Fill
>
</
telerik:MapShapeFill
>
</
telerik:InformationLayer.ShapeFill
>
</
telerik:InformationLayer
>
The Silverlight app gets the data from a webservice. The polygon source data looks like that and will be bind to sqlReader in the backend code of the Silverlight application. As I can read in the suggested article, the concept of ASP.NET RadMap data binding is a bit different.
[DataContract]
public
class
Structure
{
private
string
_id;
private
string
_name;
private
string
_abbrevitation;
private
string
_type;
private
string
_geoJson;
[DataMember]
public
string
Id
{
get
{
return
_id; }
set
{ _id = value; }
}
[DataMember]
public
string
Name
{
get
{
return
_name; }
set
{ _name = value; }
}
[DataMember]
public
string
Abbrevitation
{
get
{
return
_abbrevitation; }
set
{ _abbrevitation = value; }
}
[DataMember]
public
string
Type
{
get
{
return
_type; }
set
{ _type = value; }
}
[DataMember]
public
string
GeoJSON
// is a polygon
{
get
{
return
_geoJson; }
set
{ _geoJson = value; }
}
}
0
Hello Adi,
Yes, the Map for ASP.NET AJAX and the Map for Silverlight have very different implementation so it is expected to have some differences in the configuration and binding.
The Map for ASP.NET AJAX is a wrapper of the client-side Kendo UI Map widget so it is better to use the JSON received from the WebService directly.
Here are some resources that should help you to bind the Map for ASP.NET AJAX:
Regards,
Peter Milchev
Progress Telerik
Yes, the Map for ASP.NET AJAX and the Map for Silverlight have very different implementation so it is expected to have some differences in the configuration and binding.
The Map for ASP.NET AJAX is a wrapper of the client-side Kendo UI Map widget so it is better to use the JSON received from the WebService directly.
Here are some resources that should help you to bind the Map for ASP.NET AJAX:
- https://docs.telerik.com/devtools/aspnet-ajax/controls/map/functionality/shapes;
- https://demos.telerik.com/aspnet-ajax/map/examples/functionality/shapes-layer/defaultcs.aspx;
- https://docs.telerik.com/devtools/aspnet-ajax/controls/clientdatasource/overview;
- https://docs.telerik.com/devtools/aspnet-ajax/controls/clientdatasource/connecting-to-web-service;
- https://docs.telerik.com/devtools/aspnet-ajax/controls/clientdatasource/client-side-programming/overview#radclientdatasource-methods, set_data() method which sets the JSON data of the RadClientDataSource.
Regards,
Peter Milchev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.