Created
May 31, 2014 08:53
-
-
Save slopjong/b4ed79cc76f9f7057a1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$zoom = 0; | |
$n = pow(2, $zoom); | |
$lon = 6.07057; | |
$lat = 49.61629; | |
$xtile = floor((($lon + 180) / 360) * pow(2, $zoom)) + 0.5; | |
$ytile = floor((1 - log(tan(deg2rad($lat)) + 1 / cos(deg2rad($lat))) / pi()) /2 * pow(2, $zoom)) + 0.5; | |
echo "<html><body>"; | |
echo '<a target="_blank" href="http://c.tile.openstreetmap.org/'. $n .'/'. $xtile .'/'. $ytile .'.png">http://c.tile.openstreetmap.org/'. $n .'/'. $xtile .'/'. $ytile .'.png</a>'; | |
echo "</body></html>"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment