使用 kendo ui 创建地图
Create map with kendo ui
我通过从本地源传递 geojson,将这些多边形从 overpass-turbo. I can display this data with d3js 导出为 geojson 格式。
我想知道如何设置这个map in kendo-ui?例如,我的 geojson 对象存储在变量 map
中,然后将 map
分配给属性 dataSource
不起作用。有关工作示例,请参阅 jsfiddle 的链接。加载内容需要一些时间。
$("#svganchor").kendoMap({
center: [13.53, 52.41],
zoom: 5,
layers: [{
type: "shape",
dataSource: map,
style: {
fill: {
color: "blue",
opacity: 0.7
}
}
}]
});
如果要从本地加载数据,就得模拟传输功能。
dataSource: {
type: "geojson",
transport: {
read: function(e) {
e.success(map);
}
}
}
我通过从本地源传递 geojson,将这些多边形从 overpass-turbo. I can display this data with d3js 导出为 geojson 格式。
我想知道如何设置这个map in kendo-ui?例如,我的 geojson 对象存储在变量 map
中,然后将 map
分配给属性 dataSource
不起作用。有关工作示例,请参阅 jsfiddle 的链接。加载内容需要一些时间。
$("#svganchor").kendoMap({
center: [13.53, 52.41],
zoom: 5,
layers: [{
type: "shape",
dataSource: map,
style: {
fill: {
color: "blue",
opacity: 0.7
}
}
}]
});
如果要从本地加载数据,就得模拟传输功能。
dataSource: {
type: "geojson",
transport: {
read: function(e) {
e.success(map);
}
}
}