code: public static int[] getTileNumber( final double lat, final double lon, final int zoom ) {
          int xtile = (int) Math.floor((lon + 180) / 360 * (1 << zoom));
          int ytile_osm = (int) Math.floor(
                  (1 - Math.log(Math.tan(Math.toRadians(lat)) + 1 / Math.cos(Math.toRadians(lat))) / Math.PI) / 2 * (1 << zoom));
          if (xtile < 0)
              xtile = 0;
          if (xtile >= (1 << zoom))
              xtile = ((1 << zoom) - 1);
          if (ytile_osm < 0)
              ytile_osm = 0;
          if (ytile_osm >= (1 << zoom))
              ytile_osm = ((1 << zoom) - 1);
          return new int[]{zoom, xtile, ytile_osm};
      }
docs: <p>Code copied from: http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Lon..2Flat._to_tile_numbers </p>
  20131128: corrections added to correct going over or under max/min extent
  - was causing http 400 Bad Requests
  - updated openstreetmap wiki
  
  @param zoom
  @return [zoom, xtile, ytile_osm]