我正在使用故事板和Google地圖構建iOS應用程序。使用iOS6的從Google地圖中刪除標記iOS
我的應用程序的功能,如Facebook的應用程序看到
在我的左視圖,我在其中有緯度/經度線列表中選擇一個項目,並將其顯示在我的地圖上按照拆分視圖導航方法
- (void)viewWillAppear:(BOOL)animated
我想刪除此方法的所有標記之前我再加一條(所以只有一個標記在地圖上),有沒有辦法做到這一點?下面是我的代碼標記提前添加到的MapView
謝謝 - 喬恩
- (void)loadView
{
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:poi.lat
longitude:poi.lon
zoom:15];
mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera];
mapView.myLocationEnabled = YES;
self.view = mapView;
mapView.mapType = kGMSTypeHybrid;
//Allows you to tap a marker and have camera pan to it
mapView.delegate = self;
}
-(void)viewWillAppear:(BOOL)animated
{
GMSMarkerOptions *options = [[GMSMarkerOptions alloc] init];
options.position = CLLocationCoordinate2DMake(poi.lat, poi.lon);
options.title = poi.title;
options.snippet = poi.description;
options.icon = [UIImage imageNamed:@"flag-red.png"];
[mapView addMarkerWithOptions:options];
[mapView animateToLocation:options.position];
[mapView animateToBearing:0];
[mapView animateToViewingAngle:0];
}
我正在使用GMSMapView - Google maps Class。除非你可以將這些方法應用到谷歌地圖? – jchri853
我的歉意,請參閱編輯。 – iOSGuru248
哈哈NP,在文檔中錯過了,感謝您花時間幫助我! – jchri853