【发布时间】:2013-07-13 22:25:13
【问题描述】:
我正在学习为 iOS 开发。我正在使用适用于 iOS 的 Google Maps API 来制作地图。我在我的项目中放入了一个视图,该视图已放入我的检查器元素中,例如 GMSMapView。
在我的代码中,我把这段代码放在下面:
- (void) setMapView:(GMSMapView *)mapView {
if (!mapView) {
mapView = [[GMSMapView alloc] initWithFrame:mapView.bounds];
}
googleMap = mapView;
}
地图有效,但我想在这张地图上设置我的相机。在viewDidLoad 函数中,我将这段代码放在了下面:
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.8683
longitude:151.2086
zoom:12];
self.mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera];
但谷歌地图只是在伦敦加载这张地图,我不知道为什么。这协调它来自悉尼。我已经尝试过googleMap = [GMSMapView mapWithFrame:CGRectZero camera:camera];,但也不行。
有人可以帮帮我吗?
【问题讨论】: