Hi I have a problem with google maps as well and I have tried everything to solve it. Please help me.
the maps are loaded perfectly if the page is the index of a controller. But if the page has parameters on the route or if it isn't the index of the controller, then the map doesn't loads.
For example,I have the following action for a view.
public ActionResult Mapa(int id)
{
List<Jefe> jefes = repositorio.GetJefesPorEvento(id);
List<Vendedor> vendedores = new List<Vendedor>();
if (jefes.Count > 0)
{
vendedores.AddRange(repositorio.GetVendedoresPorEvento(jefes[0]));
}
return View("Mapa", vendedores);
}
This doesn't work..
but if I change it to this:
public ActionResult Index()
{
List<Jefe> jefes = repositorio.GetJefesPorEvento(7); //it can be any number of a certain event (party, dinner, etc).
List<Vendedor> vendedores = new List<Vendedor>();
if (jefes.Count > 0)
{
vendedores.AddRange(repositorio.GetVendedoresPorEvento(jefes[0]));
}
return View("Index", vendedores);
}
(the views are exaclty the same of course, so the problem shouldn't be there.)
then it works.
Please help me if you can!
Thanks!