MVC Map - what is the right structure of remote data?

2 posts, 1 answers
  1. Steffen
    Steffen avatar
    2 posts
    Member since:
    Jul 2009

    Posted 21 Jun 2018 Link to this post

    On this site:

    https://demos.telerik.com/aspnet-mvc/map/remote-marker

    ...you get us a nice example of using remote data in a map.

    In this provided method you return a json file. How is this structured? I connot find any example.

    public ActionResult _StoreLocations()
            {
                return Json(MapDataRepository.StoreLocations());
            } 
  2. Answer
    Georgi
    Admin
    Georgi avatar
    579 posts

    Posted 22 Jun 2018 Link to this post

    Hi Steffen,

    The response from the server is an array of objects. Each object contains two fields:
    •  Name - a string which represents the name of the marker
    • LatLang - an array of two numbers which represents the coordinates, one for latitude and another for longitude.

    e,g,

    [{
        LatLng: [30.2675, -97.7409],
        Name: "Zevo Toys"
    }, {
        LatLng: [30.2707, -97.749],
        Name: "Foo Bars"
    }]


    Regards,
    Georgi
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top