【问题标题】:QuickBlox get Locations with GeoRect methodQuickBlox 使用 GeoRect 方法获取位置
【发布时间】:2013-12-09 19:00:46
【问题描述】:

我想获取矩形内的位置。这是我的代码:

    public void getRadarUsers() {

双纬1,经度1,纬度2,经度2;

    latitude1 = CommonProperties.map.getProjection().getVisibleRegion().latLngBounds.southwest.latitude;
    longitude1 = CommonProperties.map.getProjection().getVisibleRegion().latLngBounds.southwest.longitude;

    latitude2 = CommonProperties.map.getProjection().getVisibleRegion().latLngBounds.northeast.latitude;
    longitude2 = CommonProperties.map.getProjection().getVisibleRegion().latLngBounds.northeast.longitude;


    QBLocationRequestBuilder getLocationsBuilder = new QBLocationRequestBuilder();
    getLocationsBuilder.setPerPage(10); // only 10 locations
    getLocationsBuilder.setGeoRect(latitude1, longitude1, latitude2,
            longitude2);
    QBLocations.getLocations(getLocationsBuilder, new QBCallbackImpl() {
        @Override
        public void onComplete(Result result) {
            if (result.isSuccess()) {
                QBLocationPagedResult locationsResult = (QBLocationPagedResult) result;
                if (locationsResult.getLocations() != null) {
                    for (QBLocation location : locationsResult
                            .getLocations()) {
                         UserVO user = new UserVO();
                         user.setLocation(location);
                         user.setUser(location.getUser());
                         QBCommon.getFileService().getUserFile(user);
                    }
                }
            }
        }
    });
}

请求日志: 12-08 16:31:29.505:D/QBASDK RestRequest(29104):参数 12-08 16:31:29.505: D/QBASDK RestRequest(29104): per_page=10 12-08 16:31:29.505: D/QBASDK RestRequest(29104): geo_rect=49.578363078876166;6.082663312554359;49.63331730521349;6.137594617903233 12-08 16:31:29.505:D/QBASDK RestRequest(29104):内联 12-08 16:31:29.505: D/QBASDK RestRequest(29104): GET https://api.quickblox.com/geodata/find.json?per_page=10&geo_rect=49.578363078876166;6.082663312554359;49.63331730521349;6.137594617903233

响应日志: 12-08 16:31:31.997: D/QBASDK RestResponse(29104): 身体 12-08 16:31:31.997: D/QBASDK RestResponse(29104): '{"errors":{"geo_rect":["应该是 GeoRect 格式"]}}' 12-08 16:31:32.005:D/QBASDK QBLocationPagedResult(29104):请求已完成但错误:[geo_rect 应为 GeoRect 格式]

如您所见,错误是: geo_rect:应该是 GeoRect 格式。

纬度和经度的值是:

纬度1 = 49.578363078876166 经度1 = 6.082663312554359

纬度2 = 49.63331730521349 经度2 = 6.137594617903233

请对错误有任何想法?

提前致谢。

更新:我使用的是 Andoid SDK,QuickBlox 版本是 0.8.1 如果我使用 QuickBlox 版本是 0.8。我没有收到任何错误,我可以获取位置。 这似乎是一个错误。有人知道如何举报吗? 谢谢

【问题讨论】:

    标签: android location rectangles quickblox


    【解决方案1】:

    在此处查看最新的 QuickBlox Android SDK 0.8.2 http://quickblox.com/developers/Android#Download_Android_SDK 此功能运行没有任何问题

    【讨论】:

      猜你喜欢
      • 2013-11-05
      • 2013-04-12
      • 1970-01-01
      • 1970-01-01
      • 2016-06-12
      • 1970-01-01
      • 1970-01-01
      • 2022-10-24
      相关资源
      最近更新 更多