大佬教程收集整理的这篇文章主要介绍了标记未在子视图IOS SWIFT中的谷歌地图中找到,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
-SWIFT代码
import UIKit import GoogleMaps class HomeViewController: UIViewController,CLLOCATIOnManagerDelegate { @IBOutlet weak var mapView: GMsmapView! let LOCATIOnManager = CLLOCATIOnManager() override func viewDidLoad() { super.viewDidLoad() LOCATIOnManager.delegate = self LOCATIOnManager.requestAlwaysAuthorization() let camera = GMSCameraPosition.cameraWithLatitude(15.4989,longitude: 73.8278,zoom: 6) let mapView = GMsmapView.mapWithFrame(CGRectZero,camera: camera) mapView.myLOCATIOnEnabled = true // self.view = mapView self.view.addSubview(mapView) let marker = GMsmarker() marker.position = CLLOCATIOnCoordinate2DMake(15.4989,73.8278) marker.title = "Panjim" marker.snippet = "Near Don Bosco,Alphran Plaza" marker.map?.addSubview(mapView) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
提前致谢
let marker = GMsmarker() marker.position = CLLOCATIOnCoordinate2DMake(lat,long) marker.appearAnimation = kGMsmarkerAnimationPop marker.title = "Marker" // Marker title here marker.snippet = "Tap the ↱ Navigate button to start navigaTing." marker.infoWindowAnchor = CGPoint(x: 0.5,y: 0) marker.icon = UIImage(named: "marker") //Set marker icon here marker.map = self.mapView // Mapview here
动画相机定位
let camera = GMSCameraPosition.camera(withLatitude: 15.4989,zoom: 17) mapView.animate(to: camera)
以上是大佬教程为你收集整理的标记未在子视图IOS SWIFT中的谷歌地图中找到全部内容,希望文章能够帮你解决标记未在子视图IOS SWIFT中的谷歌地图中找到所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。