osmTile2TmsTile static method

List<int> osmTile2TmsTile(
  1. int tx,
  2. int ty,
  3. int zoom
)

Converts Osm slippy map tile coordinates to TMS Tile coordinates.

@param tx the x tile number. @param ty the y tile number. @param zoom the current zoom level. @return the converted values.

Implementation

static List<int> osmTile2TmsTile(int tx, int ty, int zoom) {
  return [tx, (math.pow(2, zoom) - 1).round() - ty];
}