title: Unable to retrieve map tiles at high zoom level (i.e. zoomed out) with Matplotlib/Cartopy/Python
body: <p>I am creating a mapping application with Python and Cartopy, and attempting to use open-source map tiles for backgrounds, to have more options than the default Cartopy map.</p>
  
  <p>It works perfectly for maps that are zoomed in fairly close, but when I try to get a view from a higher elevation, something fails. If I have the zoom set to 11, it works. If I set it to 12, it hangs indefinitely and gives no traceback.</p>
  
  <p>Same result with both the OSM and Stamen map servers.</p>
  
  <p>Here is a short, self-contained example (note that a line or two may be artifacts from the various ways I've tried this)</p>
  
  <pre><code>import matplotlib as mpl
  mpl.use('Agg')
  import matplotlib.pyplot as plt
  import cartopy.crs as ccrs
  import cartopy.io.img_tiles as cimgt
  
  
  def custom_background(source_point):
  
      source_point = source_point.split(" ")
      source_point = (float(source_point[0]), float(source_point[1]))
      dx = 1.5
      dy = 1.5
      lon_min, lon_max = source_point[0]-dx, source_point[0]+dx
      lat_min, lat_max = source_point[1]-dy, source_point[1]+dy
      zoom = 7
      map_url = "https://www.openstreetmap.org/#map={}/{}/{}".format(zoom,source_point[0],source_point[1])
      tile = cimgt.OSM(url=map_url)
      tile = cimgt.StamenTerrain()
      ax = plt.axes(projection=ccrs.PlateCarree())
      ax.set_extent([lat_min, lat_max, lon_min, lon_max])
      ax.add_image(tile, zoom)
      #~ ax.add_image(tile)
      return ax
  
  custom_background("45.068466 -66.45477")
  plt.savefig("tile.png")
  </code></pre>
  
  <p>the result, with zoom = 7:</p>
  
  <p><a href="https://i.stack.imgur.com/q2Lt7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q2Lt7.png" alt="the result of code running for zoom = 7"></a></p>
  
  <p>but if I were to change zoom to say, 14, the program will not complete no matter how long I allow it to run.</p>
  
  <p>The url parameter that is passed to cimgt.OSM() is optional. I get the same result with or without it. (See:  <a href="https://scitools.org.uk/cartopy/docs/v0.16/cartopy/io/img_tiles.html#cartopy.io.img_tiles.OSM" rel="nofollow noreferrer">https://scitools.org.uk/cartopy/docs/v0.16/cartopy/io/img_tiles.html#cartopy.io.img_tiles.OSM</a>)</p>
  
  <p>Am I missing something here? Any help would be appreciated, thank you.</p>