Google Map flickering in iOS

3.4k views Asked by At

I am using Google Maps SDK for iOS version: 1.10.17867.0 in my app via pod. But when I initialise the map at a particular position, all the titles and map starts flickering. Example Code (swift):

import UIKit
import GoogleMaps

class ViewController: UIViewController {

  override func viewDidLoad() {
    super.viewDidLoad()
    self.view.backgroundColor = UIColor.whiteColor();
    var camera = GMSCameraPosition.cameraWithLatitude(19.0176147, longitude: 72.8561644, zoom:18) 
    // even try this: 28.6469655, longitude: 77.0932634, zoom:10 
    var mapView = GMSMapView.mapWithFrame(CGRectZero, camera:camera)

    var marker = GMSMarker()
    marker.position = camera.target
    marker.snippet = "Hello World"
    marker.appearAnimation = kGMSMarkerAnimationPop
    marker.map = mapView

    self.view = mapView
  }
}
1

There are 1 answers

1
Avnish Gaur On BEST ANSWER

I have figured out the reason.

If you are using an incorrect google maps api key, or correct key with insufficient permissions, then this will happen. It was the latter reason for us.

For further reading, documentation link, although the said behaviour is not mentioned anywhere. It should rather log an error message.