ios - Google map SDK iOS 卫星 View

标签 ios swift xcode google-maps

如何在我的 iOS 应用程序上获取卫星 View ? Google SDK 网站上的代码不起作用。我正在运行最新版本的 Xcode。

如果我使用 Google SDK 网站上提供的代码,则会收到此错误:

Use of unresolved identifier 'kGMSTypeSatellite'.

我在 Google Developer 网站上使用的代码是:

let camera = GMSCameraPosition.camera(withLatitude: -33.8683, longitude: 151.2086, zoom: 6)
let mapView = GMSMapView.map(withFrame: .zero, camera: camera)
mapView.mapType = kGMSTypeSatellite

谢谢。

最佳答案

您这样调用: mapView.mapType = kGMSTypeSatellite

你应该像这样调用你的mapView

let mapView = GMSMapView.map(withFrame: CGRect.zero, 相机: 相机) mapView.mapType = GMSMapViewType.satellite.

关于ios - Google map SDK iOS 卫星 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59817165/

相关文章:

ios - 通过长按代码创建的按钮的弹出窗口

ios - xcode info.plist 构建变量 ${PRODUCT_NAME :rfc1034identifier} seems completely undocumented?

ios - 简单的 For 循环问题

ios - 无法将自动布局约束添加到UITableViewCell中的元素

ios - swift |没有 Storyboard的 UICollectionView 显示不正确的数据

xcode - 持久dyld : Symbol not found in Xcode 7. 2

swift - 如何为 swift 字典实现观察者模式

iphone - ScheduleLocalNotification 不适用于越狱应用程序?

iOS - 设备来自其蜂窝网络的位置

ios - NSPersistentStoreDidImportUbiquitousContentChangesNotification 返回空