Google Map flickering in iOS

佐手、 提交于 2019-11-30 05:34:33

问题


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:


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.



来源:https://stackoverflow.com/questions/30801951/google-map-flickering-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!