我希望你能理解我的问题,我的英语不太好。
无论如何,我正在开发一个带有位置的应用程序。它只是一个有趣的应用程序,应该可以帮助我了解更多信息。
它是一个 iOS 应用程序,服务器是一个 WebObjects/WOnder 应用程序(Java)。我想做的是在 iOS 应用程序上获取用户位置,然后将数据发送到服务器。在服务器上,我从数据库中获取注释点。但只发回用户位置附近的注释。
我现在唯一的问题是我不知道如何计算用户附近的位置。我用谷歌搜索了很多,但没有找到有用的东西。只有给我用户的“边界框”的东西。
//To calculate the search bounds...
//First we need to calculate the corners of the map so we get the points
CGPoint nePoint = CGPointMake(self.mapView.bounds.origin.x + mapView.bounds.size.width, mapView.bounds.origin.y);
CGPoint swPoint = CGPointMake((self.mapView.bounds.origin.x), (mapView.bounds.origin.y + mapView.bounds.size.height));
//Then transform those point into lat,lng values
CLLocationCoordinate2D neCoord;
neCoord = [mapView convertPoint:nePoint toCoordinateFromView:mapView];
CLLocationCoordinate2D swCoord;
swCoord = [mapView convertPoint:swPoint toCoordinateFromView:mapView];
有没有人知道如何在 Java 中做到这一点?