title: Render OSM tiles using GTRenderer
body: <p>I am trying to render OSM tiles using GTRenderer this way:</p>
  
  <pre><code>MapContent map = new MapContent();    
  String baseURL = "http://&lt;url&gt;"; // OSM url
  TileService service = new OSMService("OSM", baseURL);
  TileLayer tileLayer = new TileLayer(service);
  map.addLayer(tileLayer);
  </code></pre>
  
  <p>Then I send my <code>map</code> to</p>
  
  <pre><code>public static void saveImage(final MapContent map,
                                   final String file,
                                   ReferencedEnvelope envelope,
                                   final int imageWidth,
                                   String formatName) {
  
          GTRenderer renderer = new StreamingRenderer();
          renderer.setMapContent(map);
  
          java.awt.Rectangle imageBounds = null;
          ReferencedEnvelope mapBounds = null;
          try {
              mapBounds = envelope;
              double heightToWidth = mapBounds.getSpan(1) / mapBounds.getSpan(0);
              imageBounds = new java.awt.Rectangle(
                      0, 0, imageWidth, (int) Math.round(imageWidth * heightToWidth));
  
          } catch (Exception e) {
              // failed to access map layers
              throw new RuntimeException(e);
          }
  
          BufferedImage image = new BufferedImage(imageBounds.width, imageBounds.height, BufferedImage.TYPE_INT_RGB);
  
          Graphics2D gr = image.createGraphics();
          gr.setPaint(Color.WHITE);
          gr.fill(imageBounds);
  
          try {
              renderer.paint(gr, imageBounds, mapBounds);
              File fileToSave = new File(file);
              ImageIO.write(image, formatName, fileToSave);
  
          } catch (IOException e) {
              throw new RuntimeException(e);
          }
      }
  </code></pre>
  
  <p>However it returns "white space" image. </p>
  
  <p>At the same time, my <code>saveImage</code> procedure works fine with a WMS layers. What could be the problem of this?</p>
  
  <p>I ahve also checked my OSM service by</p>
  
  <pre><code>Tile t = new OSMTile(
          new OSMTileIdentifier(79234, 40978, new WebMercatorZoomLevel(17), service.getName()),
          service);
  
  BufferedImage image = t.loadImageTileImage(t);
  </code></pre>
  
  <p>It returns correct tile.</p>
  
  <p><strong>EDITED</strong> </p>
  
  <p>I have also found the following message in the log:</p>
  
  <p><code>[pool-2-thread-1] org.geotools.tile Reached tile limit of 128. Returning an empty collection.</code></p>