This is a migrated thread and some comments may be shown as answers.

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

1 Answer 34 Views
Map
This is a migrated thread and some comments may be shown as answers.
Steffen
Top achievements
Rank 1
Steffen asked on 21 Jun 2018, 06:33 PM

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());
        } 

1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi
Telerik team
answered on 22 Jun 2018, 07:47 AM
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.
Tags
Map
Asked by
Steffen
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or