Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GMSMapStyle unresolved identifier

I want to change my google map style in ios. For that I am trying to implement this code. GMSMapStyle

I am importing import GoogleMaps. But I am getting this error Use of unresolved identifier GMSMapStyle. Can anybody help me to which module I have to import to avoid this error. Thanks in advance

like image 469
Rox Avatar asked Oct 04 '16 15:10

Rox


1 Answers

While updating an app, I was getting a similar error but with mapType:

'Use of unresolved identifier 'kGMSTypeTerrain' with the following code:

  @IBOutlet weak var googleMapView: GMSMapView!
  googleMapView.mapType = kGMSTypeTerrain

Took me a couple of days to resolve this item. I thought I had an issue with my GoogleMaps IOS api so did a cocoa pod install (when I should of done a pod update) but it did not fix the issue. I finally came across the issue noted above with mapStyle. As it turns out, with Swift 3,

googleMapView.mapType = kGMSTypeTerrain  

should be changed to

googleMapView.mapType = .terrain 

Likewise for the other map types.

like image 107
Tom Avatar answered Sep 20 '22 14:09

Tom