Unresolved GMSMapStyle ID

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

I import import GoogleMaps. But I get this error Use of unresolved identifier GMSMapStyle. Can someone help me which module I need to import to avoid this error. thanks in advance

+4
source share
5 answers

The problem is that I tried to implement this code in GoogleMapSDK version 2.0.1. But it is available from 2.1.0.

+3
source

When updating the application, I received a similar error, but with mapType:

' ' kGMSTypeTerrain ' :

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

, . , Apache GoogleMaps IOS, ​​ cocoa pod ( pod), . , , , , mapStyle. , Swift 3,

googleMapView.mapType = kGMSTypeTerrain  

googleMapView.mapType = .terrain 

.

+4

, pod pod, pod install , pod !

pod SDK

+1

, :

:

let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
mapView.mapType = GMSMapViewType.terrain
+1
source

In the old version, you can also add a map style in the following way.

let mapView = GMSMapView.map(withFrame: .zero, camera: camera)
    // Available map types: kGMSTypeNormal, kGMSTypeSatellite,kGMSTypeHybrid,
    // kGMSTypeTerrain, kGMSTypeNone
    // Set the mapType to Satellite
    mapView.mapType = kGMSTypeSatellite
    view = mapView
0
source

Source: https://habr.com/ru/post/1656707/


All Articles