Setting center after remote data is being called

2 posts, 0 answers
  1. NS
    NS avatar
    187 posts
    Member since:
    Jan 2007

    Posted 29 Jul 2014 Link to this post

    I'm following the example "binding markers to remote data"
    My question is: is it possible to center the map programmatically after the 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 to center/zoom the map around that layer?

    So my code looks more or less as follow:
        .Layers(layers =>
                .UrlTemplateId("http://#= subdomain zoom #/#= x #/#= y #.png")
                .Subdomains("a", "b", "c")
                .Attribution("&copy; <a href=''>OpenStreetMap contributors</a>");

                .DataSource(dataSource => dataSource
                      .Read(read => read.Action("_StoreLocations", "Order", new { OrderId = Request.QueryString["OrderId"] }))


  2. Hristo Germanov
    Hristo Germanov avatar
    703 posts

    Posted 30 Jul 2014 Link to this post

    Hello NS,

    I think that you need to hook up to the DataSource change event and do this logic there.

    I hope this helps.

    Hristo Germanov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top