2017-02-16 29 views
0

我正在用歐洲首都建立一個測驗,地圖將移動到特定的國家,我不希望用戶滾動並查看首都的名稱。所以基本上我有2個選擇,我需要幫助:1.不要讓用戶滾動 2.隱藏從谷歌地圖IOS Swift從谷歌地圖中刪除首都

這裏所有的省會城市或者是代碼:

switch(randomNumber) { 

     case 1: 

     let latitude:Double = 45.943161 
     let longitude:Double = 24.966760000000022 

     let span = MKCoordinateSpanMake(25, 25) 
     let region = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: latitude, longitude: longitude), span: span) 

     mapView.setRegion(region, animated: true) 

     let pinLocation: CLLocationCoordinate2D = CLLocationCoordinate2DMake(latitude, longitude) 

     let objectAnn = MKPointAnnotation() 
     objectAnn.coordinate = pinLocation 

     self.mapView.addAnnotation(objectAnn) 




     questionLabel.text = "Iceland" 
     button1.setTitle("Copenhagen", for: UIControlState.normal) 
     button2.setTitle("Reykiavik", for: UIControlState.normal) 
     button3.setTitle("Oslo", for: UIControlState.normal) 
     button4.setTitle("Ljubiana", for: UIControlState.normal) 

     correctAnswer = "2" 

     break 

回答

1

類似MapKit question用戶交互

要刪除的首都,你可以嘗試MapKit蘋果文檔:showsPointsOfInterest

此外,它看起來像你使用蘋果的MapKit,而不是谷歌地圖,只是fyi。

+0

感謝,縮放工作的問題,仍然無法找到如何刪除谷歌地圖首都,如果可能的話 –