コード例 #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;
        }
コード例 #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;
        }
コード例 #3
0
        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;
        }