Binding Map to local GeoJSON data

3 posts, 0 answers
  1. arno
    arno avatar
    14 posts
    Member since:
    Jun 2014

    Posted 17 Aug 2015 Link to this post

    Hi,

    Is it possible to bind the kendo map to local geojson data with the same format as the remote source? 

    For example this data is exactly the format I feed it: http://demos.telerik.com/kendo-ui/content/dataviz/map/countries-users.geo.json
    but then stored in a local variable like "mapData" in the following example.

      $("#participantMap").kendoMap({
                center: [51.5000,0.11],
                zoom: 6,
                layers: [{
                        type: "shape",
                        dataSource: {
                            type: "geojson",
                            data: mapData
                        },
                        style: {
                            fill: {
                                opacity: 0.7
                            }
                        }
                    }]
            }); 

     

    Ideally it would work with the AngularJS directive but I don't find a working example of it using local geojson data.

    Has anyone tried this before?

    thanks,

    Arno

     

     

     

  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2771 posts

    Posted 17 Aug 2015 Link to this post

    Hi,

    Binding to local data currently requires simulating a transport.
    Sample code:
              dataSource: {
                type: "geojson",
                transport: {
                  read: function(e) {
                    e.success(mapData);
                  }
                }
              }

    I'll check if we can fix this in the data source definition.
    Apologies for the caused inconvenience.

    Regards,
    T. Tsonev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. arno
    arno avatar
    14 posts
    Member since:
    Jun 2014

    Posted 19 Aug 2015 in reply to T. Tsonev Link to this post

    Thank you,

    I'll try this approach then.

    Arno

Back to Top