title: Custom google maps style takes a second to load
body: <p>I'm implementing a custom style for my google maps view for a bus transit app I'm developing in XCode 9 w/ Swift 4. Whenever I load a map view, it always takes a little less than a second to load the custom style and I'm not sure what's causing this to happen.</p>
  
  <p>Here's the effect I'm describing:</p>
  
  <p><a href="https://i.stack.imgur.com/BbCAn.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BbCAn.gif" alt="enter image description here"></a></p>
  
  <p>As you can see, the tan background is the default style for google's mapview, and it's visible for only a small period of time. </p>
  
  <p>Here's my code that implements the map view:</p>
  
  <pre><code>class StopPredictionVC: UIViewController {
      override func viewWillAppear(_ animated: Bool) {
          super.viewWillAppear(animated)
          setUpMapView()
      }
  
      private func setUpMapView() {
          let stopLatitude = Double(stop!.lat)
          let stopLongitude = Double(stop!.lon)
  
          let camera = GMSCameraPosition.camera(withLatitude: stopLatitude!, longitude: stopLongitude!, zoom: 16.4)
          let frame = CGRect(x: 0, y: 0, width: self.view.bounds.width, height: self.view.bounds.height)
          mapView = GMSMapView.map(withFrame: frame, camera: camera)
  
          let nightModeEnabled = APIWrapper.sharedInstance.settings.nightMode!
  
          if nightModeEnabled {
              mapView.mapStyle(withFilename: "nightStyle", andType: "json")
          } else {
              mapView.mapStyle(withFilename: "mapStyle", andType: "json")
          }
  
          let marker = GMSMarker()
          marker.icon = #imageLiteral(resourceName: "marker")
          marker.appearAnimation = .pop
          marker.position = CLLocationCoordinate2D(latitude: stopLatitude!, longitude: stopLongitude!)
          marker.title = "Bus Stop Name"
          marker.snippet = "Example description"
          marker.map = mapView
  
          buildRoute(routePath: routeConfig!.path)
  
          view.addSubview(mapView)
      }
  }
  
  extension GMSMapView {
      func mapStyle(withFilename name: String, andType type: String) {
          do {
              if let styleURL = Bundle.main.url(forResource: name, withExtension: type) {
                  self.mapStyle = try GMSMapStyle(contentsOfFileURL: styleURL)
              } else {
                  NSLog("Unable to find style.json")
              }
          } catch {
              NSLog("One or more of the map styles failed to load. \(error)")
          }
      }
  }
  </code></pre>
  
  <p><code>buildRoute(routePath:)</code> is a function that builds the blue colored path on the road if anyone was wondering.</p>
  
  <p>Obviously this isn't a huge bug, but it's quite frustrating to see every time I load a map view. Anyone see anything in my code that could be causing this?</p>