@RequestMapping(value = "/map/mapnik/osm({z}/{x}/{y}.png", method=RequestMethod.GET)
public @ResponseBody byte[] renderRequest(
                                          @PathVariable("z") int zoom,
                                          @PathVariable("x") int xOffset,
                                          @PathVariable("y") int yOffset) {
  Mapnik.initialize();
  
  int x = xOffset * 256;
  int y = yOffset * 256;

  int[] p0 = new int[] { x, y + 256 };
  int[] p1 = new int[] { x + 256, y }

  MapDefinition m = new MapDefinition();

  byte[] contents = new byte[0];

  m.loadMap(styleFile, false);

  double[] c0 = CoordinateTransformer.fromPixelToMerc(p0, zoom);
  double[] c1 = CoordinateTransformer.fromPixelToMerc(p1, zoom);

  Box2d bounds = new Box2d(c0[0], c0[1], c1[0], c1[1]);

  m.resize(256, 256);
  m.zoomToBox(bounds);
  m.setBufferSize(128);

  Image image = new Image(256, 256);

  Renderer.renderAgg(m, image);

  contents = image.saveToMemory("png");
  image.disponse();
  m.disponse();

  return contents;
}
