I'm looking to implement a Google Map into my MVC ASP.NET app. Need code ASAP.
Looks like Google now supports MVC with their version 3 api, but I'm not familiar with the code. In the past I have used Subjurim Google Map control in a Web Forms app, however, this project requires MVC.
I'm looking to render a Google map with custom markers. I also need to display an info popup when a marker is selected. I'm displaying 20 companies at a time using a paginated list.
I have looked into these links, but don't know which way to go, so looking for advice. This project uses jQuery so that's a possibility too.
[login to view URL]
[login to view URL]
[login to view URL]
So basically, we have a list of companies in ViewData. So looking for code that does something like this (MVCMaps) in the controller. Looking to render the map from a partial view.
public ActionResult DisplayCompanies()
{
List<Pushpin> pushpins = new List<Pushpin>();
foreach (var item in ViewData["company"] as IEnumerable<Company>)
{
Pushpin pushpin = new Pushpin(
[login to view URL]([login to view URL]()),
[login to view URL]([login to view URL]()),
[login to view URL]
);
[login to view URL](pushpin);
}
// Return a "MapDataResult" object that contains all the data that is to be Plotted on the Map.
return new MapDataResult()
{
Pushpins = pushpins
};
}
Thanks,