【发布时间】:2016-09-12 08:43:21
【问题描述】:
我正在尝试使用 IndoorAtlas SDK 构建一个用于室内导航的小示例。我使用的是谷歌地图而不是苹果地图。 从 IndoorAtlas 后端获取平面图图像后,我需要创建 GMSCoordinateBounds,它需要 SouthWest 和 NorthEast 坐标来创建边界。我需要知道如何正确确定这些坐标。 目前我的代码看起来像这样:
CLLocationCoordinate2D southWest = CLLocationCoordinate2DMake(self.floorPlan.topRight.latitude,self.floorPlan.topRight.longitude);
CLLocationCoordinate2D northEast = CLLocationCoordinate2DMake(self.floorPlan.bottomLeft.latitude,self.floorPlan.bottomLeft.longitude);
GMSCoordinateBounds *overlayBounds = [[GMSCoordinateBounds alloc] initWithCoordinate:southWest coordinate:northEast];
UIImage *icon = fpImage;
GMSGroundOverlay *overlay =
[GMSGroundOverlay groundOverlayWithBounds:overlayBounds icon:icon];
overlay.bearing = self.floorPlan.bearing;
overlay.map = _mapView;
GMSCameraUpdate *updatedCamera = [GMSCameraUpdate setTarget:self.floorPlan.center zoom:10];
[self.mapView animateWithCameraUpdate:updatedCamera];
self.marker.position = self.camera.target;
_mapView = [GMSMapView mapWithFrame:CGRectZero camera:self.camera];
如何确定上述坐标。尝试上述坐标我没有得到正确的矩形。
还有其他方法可以确定吗?
【问题讨论】:
-
您找到解决方案了吗?我也面临同样的问题
标签: ios objective-c xcode google-maps-sdk-ios indoor-positioning-system