Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Map flickering in iOS

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
  }
}
like image 205
Avnish Gaur Avatar asked Nov 09 '22 11:11

Avnish Gaur


1 Answers

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.

like image 129
Avnish Gaur Avatar answered Nov 15 '22 07:11

Avnish Gaur