Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php convert latitude longitude to map tile

$xtile = floor((($lon + 180) / 360) * pow(2, $zoom));
$ytile = floor((1 - log(tan(deg2rad($lat)) + 1 / cos(deg2rad($lat))) / pi()) /2 * pow(2, $zoom));
 
PREVIOUS NEXT
Tagged: #php #convert #latitude #longitude #map #tile
ADD COMMENT
Topic
Name
9+6 =