Home > Enterprise >  Create map with kendo ui
Create map with kendo ui

Time:01-21

I exported such polygons to a geojson format from overpass-turbo. I can display this data with d3js by passing the geojson from a local source.

I want to know how to setup this map in kendo-ui? For instance my geojson object is stored in the variable map, then assigning map to attribute dataSource does not work. For a working example please see the links to jsfiddle. It needs some time till the content is loaded.

$("#svganchor").kendoMap({
    center: [13.53, 52.41],
    zoom: 5,
    layers: [{
        type: "shape",
        dataSource: map,
        style: {
            fill: {
                color: "blue",
                opacity: 0.7
            }
        }
    }]
});

CodePudding user response:

If you want to load the data from local, then you have to simulate the transport function.

          dataSource: {
                type: "geojson",
                transport: {
                    read: function(e) {
                            e.success(map);
                    }
                }
            }
  •  Tags:  
  • Related