Shape layers with local data Datasource

3 posts, 0 answers
  1. Txema
    Txema avatar
    2 posts
    Member since:
    Mar 2014

    Posted 27 Apr 2014 Link to this post

    Hi. I'm trying to have a shape layer connected to a local Datasource like this:

    var shapes = new kendo.data.DataSource({type: "geojson"});

    $(
    "#map").kendoMap({
        center: [44, 10],
        zoom: 4,
        layers: [{
            type:
    "shape",
            dataSource: shapes,
            style: { fill: { opacity: 1 }}
        }],
        shapeCreated:
    function (e) {
           
    var shape = e.shape;
            shape.fill(
    "#88f");
        }
    });

    shapes.add({
    "id": "FRA", "type": "Feature", "geometry": {
       
    "type": "Polygon",
        "coordinates"
    : [[ [-4,48], [2,51], [9,44], [-2,45] ]] }
    });

    shapes.add({
    "id": "ESP", "type": "Feature", "geometry": {
       
    "type": "Polygon",
       
    "coordinates": [[ [-9,43], [3,43], [2,36], [-9,37] ]] }
    });

    The two shapes are drawn, but when you change the zoom level, only the last one remains. The rest vanish silently.

    What I'm missing?
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 29 Apr 2014 Link to this post

    Hello,

    Thank you for reporting this problem. We've identified the root cause and we'll provide a fix in the internal builds.
    For the time being, you can use the following workaround:

    shapes.add(...);
    shapes.add(...);

    shapes.fetch();


    -- Live demo --

    As a token of gratitude for your involvement your Telerik points have been updated.

    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. Txema
    Txema avatar
    2 posts
    Member since:
    Mar 2014

    Posted 30 Apr 2014 in reply to T. Tsonev Link to this post

    Thanks, now I see a colorful world.
Back to Top