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

ClientDatasource Not Working

3 Answers 129 Views
Map
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 20 Oct 2014, 09:02 AM
Hi

i have a Radmap and i am attempting to follow the example on
http://demos.telerik.com/aspnet-ajax/map/examples/functionality/cross-layer-integration/defaultcs.aspx

to get some lines on the map , but despite the Json file existing it just doesnt seem to work whenever the map loads up it doesnt display any points.

The Page Code is
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="LNGRails.aspx.cs" Inherits="Eclipse_Internal_Portal_2.LNG.LNGRails" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="tup_background">
        <div class="tup_headings" style="width: 100%;">
            <asp:Label ID="Label1" runat="server" Text="LNG Rails"></asp:Label>
            <telerik:RadClientDataSource runat="server" ID="RadClientDataSource1">
                <DataSource>
                    <WebServiceDataSourceSettings ServiceType="GeoJSON">
                        <Select Url="Rails/Rails.Json" DataType="JSON" ContentType="application/json"  />
                    </WebServiceDataSourceSettings>
                </DataSource>
            </telerik:RadClientDataSource>
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1" EnableAJAX="true">
                <div>
                    <telerik:RadMap ID="RadMap1" runat="server" Skin="Vista" AppendDataBoundLayers="true" AppendDataBoundMarkers="true">
                        <LayersCollection>
                            <telerik:MapLayer Type="Shape" ClientDataSourceID="RadClientDataSource1" Opacity="0.7">
                                <StyleSettings>
                                    <StrokeSettings Color="Black" Width="200" />
                                </StyleSettings>
                            </telerik:MapLayer>
                            <telerik:MapLayer Type="Tile" Subdomains="a,b,c"
                                UrlTemplate="http://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png"
                                Attribution="© <a href='http://osm.org/copyright' title='OpenStreetMap contributors' target='_blank'>OpenStreetMap contributors</a>.">
                            </telerik:MapLayer>
                        </LayersCollection>
                    </telerik:RadMap>
                </div>
                <div>
                    <telerik:RadButton ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click"></telerik:RadButton>
                    <telerik:RadButton ID="btnIgnore" runat="server" Text="Ignore" OnClick="btnIgnore_Click"></telerik:RadButton>
                    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True" Skin="Glow" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged" OnNeedDataSource="RadGrid1_NeedDataSource">
                        <ClientSettings Selecting-AllowRowSelect="true" EnablePostBackOnRowClick="true">
                        </ClientSettings>
                    </telerik:RadGrid>
                </div>
            </telerik:RadAjaxPanel>
        </div>
    </div>
</asp:Content>

and the Json file is
{"type":"LineString","coordinates":[[55.9178333333333,26.2851666666667],[56.0778333333333,26.3465],[56.6416666666667,25.3191666666667],[56.6125,25.2808333333333],[56.53,25.2685],[56.5256666666667,25.2695],[56.5258333333333,25.2705],[56.526,25.2708333333333],[56.5261666666667,25.2705],[56.526,25.2705],[56.526,25.2703333333333],[56.526,25.2703333333333],[56.526,25.2698333333333],[56.526,25.2693333333333],[56.5263333333,25.2688333333],[56.5261666666667,25.2688333333333],[56.5268333333333,25.2681666666667],[56.5271666667,25.268],[56.5266666666667,25.2685],[56.5268333333333,25.2683333333333],[56.5265,25.2686666666667],[56.5263333333333,25.269],[56.5263333333333,25.269],[56.5266666667,25.2685],[56.5268333333333,25.2683333333333],[56.5276666666667,25.2678333333333],[56.5278333333,25.2678333333],[56.5278333333333,25.268],[56.528,25.2678333333333],[56.531,25.268],[56.53,25.2673333333333],[56.5506666667,25.278],[56.64,25.231],[56.916,25.0915],[63.798,20.0096666666667],[66.3725,17.7773333333333],[69.2525,15.2438333333333],[69.6238333333333,14.9146666666667],[72.1481666666667,12.6655],[74.9048333333333,9.81816666666667],[76.7155,7.5155],[77.5243333333333,7.11866666666667],[79.5831666666667,5.77616666666667],[80.418,5.5015],[83.7298333333333,5.50933333333333],[84.214,5.50166666666667],[87.5165,5.5015],[87.5451666666667,5.50216666666667],[90.4086666666667,5.49616666666667],[94.4676666666667,6.08816666666667],[100.270833333333,3.432],[100.9965,2.80233333333333],[101.222,2.671],[101.415833333333,2.579],[101.6685,2.3805],[101.877166666667,2.212],[102.0215,2.06516666666667],[104.286833333333,1.2715],[134.594666666667,31.9163333333333],[139.047833333333,34.4635],[139.267,34.5651666666667],[139.425166666667,34.5986666666667],[139.681666666667,34.6461666666667],[139.695513333,34.9835916667],[139.77999,35.1670433333333],[139.74876,35.3525866666667],[139.817805,35.34591],[139.820528333333,35.3427166666667],[139.81761,35.3463316666667]]}

i have confirmed the paths are correct etc , can anyone suggest why it doesnt work Note the script manager is in the master page .

3 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 23 Oct 2014, 07:52 AM
Hello Peter,

I have tested your GeoJSON file and I was able to replicate the problem locally. 

Nevertheless, there was actually a JavaScript error thrown when the GeoJSON data was handled internally from the RadMap and the reason behind was the structure of the data. Following is the modified content of the file, which will work as expected:
{ "type": "GeometryCollection",
    "geometries": [
            {"type":"LineString","coordinates":[[55.9178333333333,26.2851666666667],[56.0778333333333,26.3465],[56.6416666666667,25.3191666666667],[56.6125,25.2808333333333],[56.53,25.2685],[56.5256666666667,25.2695],[56.5258333333333,25.2705],[56.526,25.2708333333333],[56.5261666666667,25.2705],[56.526,25.2705],[56.526,25.2703333333333],[56.526,25.2703333333333],[56.526,25.2698333333333],[56.526,25.2693333333333],[56.5263333333,25.2688333333],[56.5261666666667,25.2688333333333],[56.5268333333333,25.2681666666667],[56.5271666667,25.268],[56.5266666666667,25.2685],[56.5268333333333,25.2683333333333],[56.5265,25.2686666666667],[56.5263333333333,25.269],[56.5263333333333,25.269],[56.5266666667,25.2685],[56.5268333333333,25.2683333333333],[56.5276666666667,25.2678333333333],[56.5278333333,25.2678333333],[56.5278333333333,25.268],[56.528,25.2678333333333],[56.531,25.268],[56.53,25.2673333333333],[56.5506666667,25.278],[56.64,25.231],[56.916,25.0915],[63.798,20.0096666666667],[66.3725,17.7773333333333],[69.2525,15.2438333333333],[69.6238333333333,14.9146666666667],[72.1481666666667,12.6655],[74.9048333333333,9.81816666666667],[76.7155,7.5155],[77.5243333333333,7.11866666666667],[79.5831666666667,5.77616666666667],[80.418,5.5015],[83.7298333333333,5.50933333333333],[84.214,5.50166666666667],[87.5165,5.5015],[87.5451666666667,5.50216666666667],[90.4086666666667,5.49616666666667],[94.4676666666667,6.08816666666667],[100.270833333333,3.432],[100.9965,2.80233333333333],[101.222,2.671],[101.415833333333,2.579],[101.6685,2.3805],[101.877166666667,2.212],[102.0215,2.06516666666667],[104.286833333333,1.2715],[134.594666666667,31.9163333333333],[139.047833333333,34.4635],[139.267,34.5651666666667],[139.425166666667,34.5986666666667],[139.681666666667,34.6461666666667],[139.695513333,34.9835916667],[139.77999,35.1670433333333],[139.74876,35.3525866666667],[139.817805,35.34591],[139.820528333333,35.3427166666667],[139.81761,35.3463316666667]]
            }
    ]
}


Kind Regards,
Konstantin Dikov
Telerik
0
Peter
Top achievements
Rank 1
answered on 23 Oct 2014, 02:45 PM
thank you for the reply , its odd that i got no error messages etc from the datasource or the data binding for the dataset being wrong though it made it very hard to debug.

0
Konstantin Dikov
Telerik team
answered on 28 Oct 2014, 09:15 AM
Hello Peter,

The error message could be found in the browser's console, but although you can see that there is an error, it is not descriptive and it would be hard to determine what the actual problem is.

I will contact our developers team and will see if they could come up with a better way for handling wrongly formatted GeoJSON and throw an informative error message, which could help for locating the problem.


Regards,
Konstantin Dikov
Telerik
Tags
Map
Asked by
Peter
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Peter
Top achievements
Rank 1
Share this question
or