Hi,
I'm following the example "binding markers to remote data"
My question is: is it possible to center the map programmatically after the Datasource.read is being called? My datasource contains a list of possible stores. However, I would like to center the map (add a marker) with the initial longitude/latitude of my search request?
Next question : would it be possible (after datasource.read) to center/zoom the map around that layer?
So my code looks more or less as follow:
@(Html.Kendo().Map()
.Name("map")
.Zoom(3)
.Layers(layers =>
{
layers.Add()
.Type(MapLayerType.Tile)
.UrlTemplateId("http://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png")
.Subdomains("a", "b", "c")
.Attribution("© <a href='http://osm.org/copyright'>OpenStreetMap contributors</a>");
layers.Add()
.Type(MapLayerType.Marker)
.DataSource(dataSource => dataSource
.Read(read => read.Action("_StoreLocations", "Order", new { OrderId = Request.QueryString["OrderId"] }))
)
.LocationField("LatLng")
.TitleField("Name");
})
I'm following the example "binding markers to remote data"
My question is: is it possible to center the map programmatically after the Datasource.read is being called? My datasource contains a list of possible stores. However, I would like to center the map (add a marker) with the initial longitude/latitude of my search request?
Next question : would it be possible (after datasource.read) to center/zoom the map around that layer?
So my code looks more or less as follow:
@(Html.Kendo().Map()
.Name("map")
.Zoom(3)
.Layers(layers =>
{
layers.Add()
.Type(MapLayerType.Tile)
.UrlTemplateId("http://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png")
.Subdomains("a", "b", "c")
.Attribution("© <a href='http://osm.org/copyright'>OpenStreetMap contributors</a>");
layers.Add()
.Type(MapLayerType.Marker)
.DataSource(dataSource => dataSource
.Read(read => read.Action("_StoreLocations", "Order", new { OrderId = Request.QueryString["OrderId"] }))
)
.LocationField("LatLng")
.TitleField("Name");
})