title: Swift IOS Overlay
body: <p>My IOS map isn't rendering the NOAA tiles on top of it. Can someone give my a clue what is wrong? Here is my viewcontroler. It's just a standard mapkit viewer. Anyways, it is not working and is just giving me a standard satellite map when I run this code. Does anyone know what I am doing wrong?
  Thanks for any help you can give me.</p>
  <p>Have a great rest of your weekend.</p>
  <pre><code>import UIKit
  import MapKit
  
  
  class ViewController: UIViewController, MKMapViewDelegate, CLLocationManagerDelegate {
      @IBOutlet weak var mapView: MKMapView!
      //Linking MapView
      
      override func viewDidLoad() {
          super.viewDidLoad()
          self.mapView.delegate = self
  
          self.mapView.mapType = MKMapType.satellite
  
          let centre = CLLocationCoordinate2D(latitude: 39.2189, longitude: -76.0690)
  
         let span = MKCoordinateSpan(latitudeDelta: 0.05, longitudeDelta: 0.05)
  
         let region = MKCoordinateRegion(center: centre, span: span)
         self.mapView.setRegion(region, animated: false)
         self.mapView.regionThatFits(region)
  
  
  
         let template = &quot;https://tileservice.charts.noaa.gov/tiles/50000_1/{z}/{x}/{y}.png&quot;
  
         let carte_indice = MKTileOverlay(urlTemplate:template)
  
  
         carte_indice.isGeometryFlipped = true
  
         carte_indice.canReplaceMapContent = false
  
  
         self.mapView.addOverlay(carte_indice)
      }
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
      func mapView(
          mapView: MKMapView!, rendererFor overlay: MKOverlay!) -&gt; MKOverlayRenderer!
      {
  
      if overlay is MKTileOverlay{
          var renderer = MKTileOverlayRenderer(overlay:overlay)
          renderer.alpha = 0.8
          return renderer
      }
          return nil
      }
  
  
  }
  </code></pre>