相比,Google地圖在允許顯示在主視圖上時效果很好。谷歌地圖顯示不同的位置,與輸入
但是,當我使用新的Sub時,地圖的位置是錯誤的,即使經緯度值發生變化也不會改變。
代碼段:
import UIKit
import GoogleMaps
class MainVC: UIViewController {
@IBOutlet weak var mapSubView: GMSMapView!
override func viewDidLoad() {
let camera = GMSCameraPosition.cameraWithLatitude(13.009047, longitude: 77.652949, zoom: 6)
let mapView = GMSMapView.mapWithFrame(self.mapSubView.bounds, camera: camera)
mapView.myLocationEnabled = true
self.mapSubView = mapView
// Creates a marker in the center of the map.
let marker = GMSMarker()
marker.position = CLLocationCoordinate2D(latitude: 13.009047, longitude: 77.652949)
marker.title = "Bangalore"
marker.snippet = "India"
marker.map = mapView
}
}
嘗試放大並檢查是否在正確的位置 – Dravidian
號的創建您的標誌標記不可見 –