Ejemplo n.º 1
0
        public IList<BusMarker> List(LatLng southWest, LatLng northEast)
        {
            var markers = new List<BusMarker>();

            using (var client = Server.OpenClient())
            {
                markers = client.Query<BusMarker>(m => southWest.Lat() <= m.Lat && m.Lat <= northEast.Lat()
                                                    && southWest.Lng() <= m.Lng && m.Lng <= northEast.Lng()).ToList();
            }

            return markers;
        }
Ejemplo n.º 2
0
        public IList<HelpMarker> List(LatLng southWest, LatLng northEast, User loggedUser)
        {
            var markers = new List<HelpMarker>();

            using (var client = Server.OpenClient())
            {
                markers = client.Query<HelpMarker>(m => southWest.Lat() <= m.Lat && m.Lat <= northEast.Lat() &&
                                                        southWest.Lng() <= m.Lng && m.Lng <= northEast.Lng() &&
                                                        (
                                                            (m.Owner.Email == loggedUser.Email) ||
                                                            (!string.IsNullOrEmpty(m.Question))
                                                        )).ToList();
            }

            return markers;
        }
Ejemplo n.º 3
0
        public IList<MarkerViewModel> ListMarkers(LatLng southWest, LatLng northEast, User loggedUser)
        {
            var markers = new List<MarkerViewModel>();

            var busMarkers = busMarkerRepository.List(southWest, northEast);
            var rideOfferMarkers = rideOfferMarkerRepository.List(southWest, northEast, loggedUser);
            var rideRequestMarkers = rideRequestMarkerRepository.List(southWest, northEast, loggedUser);
            var helpMarkers = helpMarkerRepository.List(southWest, northEast, loggedUser);

            markers.AddRange(Convert(busMarkers));
            markers.AddRange(Convert(rideOfferMarkers));
            markers.AddRange(Convert(rideRequestMarkers));
            markers.AddRange(Convert(helpMarkers));

            return markers;
        }
        public IList<RideRequestMarker> List(LatLng southWest, LatLng northEast, User loggedUser)
        {
            var markers = new List<RideRequestMarker>();

            using (var client = Server.OpenClient())
            {
                markers = client.Query<RideRequestMarker>(m => southWest.Lat() <= m.Lat && m.Lat <= northEast.Lat() &&
                                                             southWest.Lng() <= m.Lng && m.Lng <= northEast.Lng() &&
                                                             (
                                                                (m.Owner.Email == loggedUser.Email) ||
                                                                (m.Destination != null && m.DateTime >= DateTime.Now)
                                                             ))
                                                             .ToList();
            }

            return markers;
        }
Ejemplo n.º 5
0
        public JsonResult LoadMarkers(double sLat, double sLng, double nLat, double nLng)
        {
            var southWest = new LatLng(sLat, sLng);
            var northEast = new LatLng(nLat, nLng);

            var markers = mapService.ListMarkers(southWest, northEast, LoggedUser);
            markers.ToList().ForEach(m => m.ImagePath = GetMarkerImage(m.Type));

            return Json(markers);
        }