ios - 谷歌地图显示肤色屏幕
问题描述
查看didload方法
override func viewDidLoad() { super.viewDidLoad() selectedAdressType = "pickup" mapV.delegate = self styleOfMap() mapV.settings.myLocationButton = true mapV.isMyLocationEnabled = true // self.pickupAddressTxtF.setLeftPaddingPoints(7) //self.destinationAddressTxtF.setLeftPaddingPoints(7) googleLocationTableV.rowHeight = UITableViewAutomaticDimension googleLocationTableV.estimatedRowHeight = 50 googleLocationTableV.tableFooterView = UIView(frame: .zero) savedLocationTableV.keyboardDismissMode = .interactive googleLocationTableV.keyboardDismissMode = .interactive // Add footer for set pinn location googleLocationTableV.tableFooterView = AddFooterView() savedLocationTableV.tableFooterView = AddFooterView() redirectMap(to: Double("\(latitude)") ?? 0.0, lng: Double("\(longitude)") ?? 0.0) let userDefaults = UserDefaults.standard if userDefaults.object(forKey: "LocationInitialData") != nil { let retriveArrayData = UserDefaults.standard.object(forKey: "LocationInitialData") as? NSData let dataDic = (NSKeyedUnarchiver.unarchiveObject(with: retriveArrayData! as Data) as? NSDictionary) print(" saved response = \(dataDic!)") self.recentSerchList = dataDic?.value(forKey: "recent_search")as! NSArray self.savedLocationList = dataDic?.value(forKey: "save_address")as! NSArray self.savedLocationTableV.reloadData() } savedLocationTableV.keyboardDismissMode = .onDrag googleLocationTableV.keyboardDismissMode = .onDrag // addressSerachApiCall() if Language.isRTL { pickupAddressTxtF.textAlignment = .right } }
重定向方法
func redirectMap(to lat: Double, lng: Double) { // [_mapView clear]; let position: CLLocationCoordinate2D = CLLocationCoordinate2DMake(lat, lng) let camera = GMSCameraPosition(target: position, zoom: 16, bearing: 0, viewingAngle: 0) mapV.animate(to: camera) }
地图样式显示“无法找到 style.json”
func styleOfMap() { do { if let styleURL = Bundle.main.url(forResource: "style", withExtension: "json") { mapV.mapStyle = try GMSMapStyle(contentsOfFileURL: styleURL) } else { NSLog("Unable to find style.json") } } catch { NSLog("One or more of the map styles failed to load. \(error)") } }
解决方案
推荐阅读
- python - 如何在列表中生成圆的坐标
- python-3.x - 使用 for 循环向 matplotlib 中的子图添加唯一标题
- swiftui - SwiftUI @Binding 误解
- google-chrome - 无法通过 burp 加载 https 站点
- laravel - 被 CORS 政策阻止并没有解决!Laravel + Vuejs
- flutter - 如何在 Dart http_server 中设置单个客户端的最大连接数限制?
- html - 使用复选框在两个不同的标签内容之间切换
- c++ - 类中的while循环不会执行c ++
- java - 在 Hazelcast 中查询
- python - 从 PyCharm 和 Linux 运行时的两个不同输出文件