【发布时间】:2014-06-05 11:18:15
【问题描述】:
我在故事板中有一个视图控制器,我想在上面显示谷歌地图
一切顺利,我拿到了,我可以显示地图了
我的问题是相机没有指向标记
这是我的代码
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(@"we are in the show stadium");
// Create a GMSCameraPosition that tells the map to display the
// coordinate -33.86,151.20 at zoom level 6.
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86
longitude:151.20
zoom:6];
mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
mapView_.myLocationEnabled = YES;
self.mynewmap = mapView_;
// Creates a marker in the center of the map.
GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = CLLocationCoordinate2DMake(-33.86, 151.20);
marker.title = @"Sydney";
marker.snippet = @"Australia";
marker.map = mapView_;
}
mynewmap是一个 UIView 出口
这是我看到的
标记在 austrail 但相机没有指向它并且标记不在地图上
【问题讨论】:
-
我想知道你为什么投反对票?我有一个问题,我试图解决它,但我不能
-
看看如果你注释掉'self.mynewmap = mapView_;'会发生什么设置 myLocation Enabled 应该会在地图的右下角显示一个图标。
标签: ios google-maps marker google-maps-sdk-ios