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

Shape layers with local data Datasource

2 Answers 132 Views
Map
This is a migrated thread and some comments may be shown as answers.
Txema
Top achievements
Rank 1
Txema asked on 27 Apr 2014, 02:24 PM
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 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 29 Apr 2014, 02:41 PM
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!
 
0
Txema
Top achievements
Rank 1
answered on 30 Apr 2014, 08:04 AM
Thanks, now I see a colorful world.
Tags
Map
Asked by
Txema
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Txema
Top achievements
Rank 1
Share this question
or