这是我的mapViewController.m文件:
@interface MapViewController()
@property (strong, nonatomic) GMSMapView* mapView;
@property (weak, nonatomic) IBOutlet GMSMapView *subView;
@end
@implementation MapViewController
- (void) viewDidLoad{
// 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:self.view.bounds camera:camera];
_mapView.myLocationEnabled = YES;
_mapView.settings.compassButton = YES;
_mapView.settings.myLocationButton = YES;
[self.subView addSubview:_mapView];
}
我的问题是我的位置按钮没有出现,任何帮助不胜感激!:)请告诉我您是否需要看更多我的项目。
解决了。问题是我将mapview添加为子视图,而不是添加到出口视图。现在已修复。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句