예제 #1
0
        public JsonResult Ubicaciones()
        {
            GeolocalizacionCore    core    = new GeolocalizacionCore();
            List <UbicacionesMaps> maps    = new List <UbicacionesMaps>();
            List <Lugar>           lugares = core.ObtenerLugares();

            foreach (var lug in lugares)
            {
                Categoria_Lugar categoria = LugaresDAO.ObtenerCategoria(lug.IdCategoria);
                maps.Add(new UbicacionesMaps {
                    categoria = categoria, lugar = lug
                });
            }

            return(Json(maps, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public JsonResult UbicacionesPorUbicacion(double latitud, double longitud, double distancia)
        {
            GeolocalizacionCore    core    = new GeolocalizacionCore();
            List <UbicacionesMaps> maps    = new List <UbicacionesMaps>();
            List <Lugar>           lugares = core.ObtenerLugaresPorUbicacion(latitud, longitud, distancia);

            if (lugares.Count > 0)
            {
                foreach (var lug in lugares)
                {
                    Categoria_Lugar categoria = LugaresDAO.ObtenerCategoria(lug.IdCategoria);
                    maps.Add(new UbicacionesMaps {
                        categoria = categoria, lugar = lug
                    });
                }
            }

            return(Json(maps, JsonRequestBehavior.AllowGet));
        }