Hi,
I want to update the map markers on a click event but I can't find a way of binding them to the markers object:
@(Html.Kendo().Map()
.Name("map")
.Center(51.514198, -0.093100)
.Zoom(15)
.Layers(layers =>
{
layers.Add()
.Type(MapLayerType.Tile)
.UrlTemplateId("http://tile2.opencyclemap.org/transport/#= zoom #/#= x #/#= y #.png")
.Subdomains("a", "b", "c")
.;
layers.Add()
.Type(MapLayerType.Marker)
.DataSource(dataSource => dataSource
.Read(read => read.Action("RefreshChart", "Map").Data("additionalInfo"))
)
.LocationField("LongAndLot")
.TitleField("Title")
.Tooltip(tool => tool.ShowOn(TooltipShowOnEvent.Click).Events(e => e.Show("onClick")));
})
)
Ajax call:
var dataSource = new kendo.data.DataSource({
transport: {
read: function (options) {
$.ajax({
type: "POST",
url: controllerName + '/RefreshChartAjax',
contentType: "application/json; charset=utf-8",
dataType: 'json',
data: JSON.stringify({ country: country, startDate: startDate, endDate: endDate, groupedBy: groupedBy }),
success: function (data) {
options.success(data);
}
});
}
}
});
$("#map").kendoMap({ dataSource: dataSource });?????
How do I bind the dataSource to the Layers/Markers object?
Thanks!
I want to update the map markers on a click event but I can't find a way of binding them to the markers object:
@(Html.Kendo().Map()
.Name("map")
.Center(51.514198, -0.093100)
.Zoom(15)
.Layers(layers =>
{
layers.Add()
.Type(MapLayerType.Tile)
.UrlTemplateId("http://tile2.opencyclemap.org/transport/#= zoom #/#= x #/#= y #.png")
.Subdomains("a", "b", "c")
.;
layers.Add()
.Type(MapLayerType.Marker)
.DataSource(dataSource => dataSource
.Read(read => read.Action("RefreshChart", "Map").Data("additionalInfo"))
)
.LocationField("LongAndLot")
.TitleField("Title")
.Tooltip(tool => tool.ShowOn(TooltipShowOnEvent.Click).Events(e => e.Show("onClick")));
})
)
Ajax call:
var dataSource = new kendo.data.DataSource({
transport: {
read: function (options) {
$.ajax({
type: "POST",
url: controllerName + '/RefreshChartAjax',
contentType: "application/json; charset=utf-8",
dataType: 'json',
data: JSON.stringify({ country: country, startDate: startDate, endDate: endDate, groupedBy: groupedBy }),
success: function (data) {
options.success(data);
}
});
}
}
});
$("#map").kendoMap({ dataSource: dataSource });?????
How do I bind the dataSource to the Layers/Markers object?
Thanks!