map(withFrame: camera) is deprecated? How do I fix this?

33 Views Asked by At

First time coding and trying to use the Google Maps API.

My line of code is:

let mapView = GMSMapView.map(withFrame: view.frame, camera: camera)

The error I'm getting is:

map(withFrame: camera) is deprecated. use -init or -initWithOptions instead.

Everything I've tried either doesn't work or is also deprecated:

let mapView = GMSMapView(frame: self.view.bounds, camera: camera)
let mapView = GMSMapView.map(withFrame: view.frame, camera: camera)
let mapView = GMSMapView(frame: view.bounds, camera: camera)
let mapView = GMSMapView(view.frame, camera:camera)
let mapView = GMSMapView(frame: view.bounds)
    
    
0

There are 0 best solutions below