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

JSON via ASMX webservice to RadCLientDataSource - Data not mapped on RadMap

2 Answers 152 Views
Map
This is a migrated thread and some comments may be shown as answers.
Glen
Top achievements
Rank 1
Glen asked on 21 Nov 2014, 03:16 PM
I am using an asmx webservice to serve up JSON mapping data to the RadCLientDataSource, then binding in MapLayer, yet I am having no success in getting the control to plot the markers.  I have tested the basics like is it serving up a staic JSON (using the demo JSON files) and this works. (So not an issue with the web.config file).  I have also confirmed using Fiddler that the JSON file is being served up correctly (it is correctly parsed in the JSON tab of fiddler, and I have no d schema requirements). So as far as I can see have a clean structured, zero error, JSON file being sent to the browser.

I have then set the LocationField='Location' in the maplayer where Location is the JSON filed and this is an array of Latitude/Longitude values.  Therefore I am stumped, as there are no examples of serving the mapping file via a webservice I wondering if it simply does not work.  Any thoughts please, or any suggestions how I can debug why the data is not being mapped ?

As stated it works fine with a static file - but when using asmx file I cannot get it to work.

Here is the RadClientDataSource code
<telerik:RadClientDataSource runat="server" ID="RadClientDataSourceCustomers">
    <DataSource>
        <WebServiceDataSourceSettings>
            <Select DataType="JSON" Url="http://localhost:62671/Customers.asmx/GetCustomers?iCountry=6"  ContentType="application/json; charset=utf-8" RequestType="Get" />
        </WebServiceDataSourceSettings>
    </DataSource>
</telerik:RadClientDataSource>

Here is the MapLayer code
    <telerik:MapLayer Type="Marker" Shape="pin" ClientDataSourceID="RadClientDataSourceCustomers" LocationField="Location">
    <TooltipSettings AutoHide="false" Width="300"
                     Template="<div class='COntainer'><div class='cusName'>#= marker.dataItem.CustomerName #</div></div>">
        <AnimationSettings>
            <OpenSettings Duration="300" Effects="fade:in" />
            <CloseSettings Duration="200" Effects="fade:out" />
        </AnimationSettings>
    </TooltipSettings>
</telerik:MapLayer>

Any thoughts or examples would be useful.

2 Answers, 1 is accepted

Sort by
0
Glen
Top achievements
Rank 1
answered on 24 Nov 2014, 09:01 PM
Fixed.  Basically by not using asmx but switched to Web API to return JSON, despite following numerous blogs on how to get the JSON file sent, I could never get it 'perfect' so rad map was always ignoring the dataset.
0
Mohammed
Top achievements
Rank 2
answered on 19 Jan 2018, 01:55 AM
I still need to do it using asmx, any help ? 
Tags
Map
Asked by
Glen
Top achievements
Rank 1
Answers by
Glen
Top achievements
Rank 1
Mohammed
Top achievements
Rank 2
Share this question
or