我在Xcode 6.1中顯示谷歌地圖時出現了一些問題我設法讓地圖顯示在UIView的一部分中,但它顯示的是世界地圖而不是特定的座標。谷歌地圖SDK無法在UIView中正確顯示?
這裏是問題:
.H:
@interface MapViewController : UIViewController
@property (strong, nonatomic) IBOutlet UIView *googleMapView;
- (IBAction)mapToMain:(UIButton *)sender;
@end
.M:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude: 32.915134
longitude: -117.140269 zoom: 17];
GMSMapView *mapView = [GMSMapView mapWithFrame:self.googleMapView.bounds
camera:camera];
mapView.myLocationEnabled = YES;
self.googleMapView = mapView;
GMSMarker *marker = [ [GMSMarker alloc] init];
marker.position = CLLocationCoordinate2DMake(32.915134, -117.140269);
marker.title = @"Tet Festival 2015";
marker.snippet = @"VAYA Tet";
marker.map = mapView;
}
我在這裏看到了一些建議,但沒有奏效:
點Cannot put a google maps GMSMapView in a subview of main main view?
Using the Google Maps SDK in views other than the main view
有什麼建議?
我基本上是試圖使地圖顯示標記的位置,但它顯示的世界地圖來代替。 – Pangu 2014-11-06 02:31:22
其他人可以幫忙嗎?我搜索了,仍然無法得到這個工作:( – Pangu 2014-11-06 03:43:31