Binding radmap shapes layer from javascript

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

    Posted 24 May 2015 Link to this post


     I'm trying to bind a RadMap to some JSON returned from an ASPX page.


        function TestGetMap()
            var shapeData = "";
                 type: "GET",
                url: "/Data/GetJsonTrip.aspx",
                data: "{}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    shapeData = JSON.stringify(msg);
                    var ds = new;
                    var kendoMap = $telerik.$("#<%=tripMap.ClientID %>").data("kendoMap");
                    kendoMap.layers[1].dataSource = ds;

    I've tried setting the datasource to msg instead of the string version, tried different layers, etc.

    My map looks like this

    <telerik:RadMap runat="server" ID="tripMap">
            <telerik:MapLayer Type="Shape"  Opacity="0.7">                   
                    <StrokeSettings Color="#ffffff" Width="10" />
        <CenterSettings  Latitude="-32.962926"  Longitude="151.699727"/>

     I'm setting the first map layer in code to bing

    MapLayer mapLayer = tripMap.LayersCollection[0];
    mapLayer.Type = Telerik.Web.UI.Map.LayerType.Bing;
    mapLayer.ImagerySet = "AerialWithLabels";

    I confirmed that I'm getting back valid geojson from the aspx page.

    I'm not getting any javascript errors in the console.

    What I don't understand is: How in a click event in javascript can I set the dataource for a shapes layer of a radmap?












  2. Ianko
    Ianko avatar
    1828 posts

    Posted 25 May 2015 Link to this post

    Hi Matthew,

    The described situation have already been discussed in a ticket thread opened to us (ID 938403). Let us continue the conversation there.

    For anyone interested on that matter. The suggestions are to use RadDataSource control for the data-binding scenario. Also, the layer to be bound, should be initially configured with a Type property set to Shape.

    Additional materials:


Back to Top