Esempio n. 1
0
        public static IPromise <List <Mark> > queryFuzzyMarks(Coordinate coodinate, int limit)
        {
            BmobQuery query = new BmobQuery();

            query.WhereNear("position", new BmobGeoPoint(coodinate.latitude, coodinate.lontitude));
            query.Limit(limit);
            Debug.LogError("1");
            List <Mark>            marks = new List <Mark>();
            Promise <List <Mark> > p     = new Promise <List <Mark> >(async(resolve, reject) =>
            {
                Debug.LogError(2);
                QueryCallbackData <Marks> data = await Bmob.FindTaskAsync <Marks>(Marks.table_name, query);
                Debug.LogError(333);
                Debug.LogError(data.results.Count);

                foreach (var mark in data.results)
                {
                    marks.Add(new Mark {
                        coordinate = new Coordinate(mark.coordinate.Latitude.Get(), mark.coordinate.Longitude.Get()), id = mark.objectId
                    });
                }
                Debug.LogError(323);
                resolve(marks);
                Debug.LogError(334);
                //Window.instance.startCoroutine(getMark(resolve, reject, query));
            });

            return(p);
            //return promise;
            //Bmob.CreateTaskAsync()
            //query.
        }
Esempio n. 2
0
        public static async Task <QueryCallbackData <Mark> > queryFuzztMarksAsync(Coordinate coodinate, int limit)
        {
            BmobQuery query = new BmobQuery();

            query.WhereNear("position", new BmobGeoPoint(coodinate.latitude, coodinate.lontitude));
            query.Limit(limit);
            return(await Bmob.FindTaskAsync <Mark>(Mark.table_name, query));
        }
Esempio n. 3
0
        public static async Task <QueryCallbackData <Marks> > queryFuzztMarksAsync(Coordinate coodinate, int limit)
        {
            BmobQuery query = new BmobQuery();

            query.WhereNear("position", new BmobGeoPoint(coodinate.latitude, coodinate.lontitude));
            query.Limit(limit);
            List <Mark> marks = new List <Mark>();

            return(await Bmob.FindTaskAsync <Marks>(Marks.table_name, query));

            /*Debug.LogError(333);
            *  Debug.LogError(data.results.Count);
            *
            *  foreach (var mark in data.results)
            *  {
            *   marks.Add(new Mark { coordinate = new Coordinate(mark.coordinate.Latitude.Get(), mark.coordinate.Longitude.Get()), id = mark.objectId });
            *  }
            *  Debug.LogError(323);
            *  resolve(marks);
            *  Debug.LogError(334);*/
        }