davidwim
davidwim

Reputation: 284

Google Maps SDK iOS Satellite View

How do I get the Satellite View on my iOS App? The code on the Google SDK Website doesn't work. I'm running the latest version of Xcode.

If I use the provided code on the Google SDK Website, I get this error:

Use of unresolved identifier 'kGMSTypeSatellite'.

The code I'm using from the Google Developer website is:

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

Thanks.

Upvotes: 1

Views: 2061

Answers (3)

Rohit Nishad
Rohit Nishad

Reputation: 448

if you want to show the address label in Satelite View use-

        self.mapView.mapType = .hybrid

Upvotes: 0

Hasnain ahmad
Hasnain ahmad

Reputation: 301

you are calling like this: mapView.mapType = kGMSTypeSatellite

You should call your mapView like

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

Upvotes: 2

hongsy
hongsy

Reputation: 1576

Came across the issue noted above with GMSMapView. With Swift 3,

mapView.mapType = kGMSTypeSatellite  

should be changed to

mapView.mapType = .satellite 

and likewise for the other map types. See this answer for more details.

Upvotes: 0

Related Questions