Skip to content

Instantly share code, notes, and snippets.

@rogeriolino
rogeriolino / rssproxy.php
Last active February 13, 2018 04:21
RSS proxy for prevent CORS error
<?php
$url = isset($_GET['url']) ? $_GET['url'] : '';
if (filter_var($url, FILTER_VALIDATE_URL) === false || strtolower(substr($url, 0, 4)) !== 'http') {
echo("URL inválida: $url");
exit();
}
$proxy = null; // "http://192.168.0.10:3128"
@chriswhong
chriswhong / README.md
Last active February 22, 2024 08:46
Node.js proxy endpoint to access TMS tiles via XYZ url

TMS vs XYZ

Web map raster tile URL templates usally look like this: //{servername}/{somepath}/{z}/{x}/{y}.png

Z is the zoom level (0 being zoomed all the way out so the earth fits on a single 256px x 256px tile, 18 or higher getting you down to street level) X and Y are the tiles coordinates, but there are two different standards for where the origin of the Y coordinate is.

If you look at [http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/](this site) which shows the various tile coordinates, you'll see that the X's are identical for 'Google' and 'TMS', but the Ys are different. 'Google', aka 'XYZ' aka a few other names that nobody seems to agree on places the Y origin at the north end of the earth, while TMS places it in the south.

Re-serve a TMS tileset as an XYZ tileset using express.js