Posted By

burnleywallet on 05/11/11


Tagged

conversion coordinates geo


Versions (?)

X,Y from lat,long


 / Published in: PHP
 

URL: http://www.weather-watch.com/smf/index.php/topic,33279.msg269782.html#msg269782

  1. <?php
  2. function getlocationcoords($lat, $lon, $width, $height)
  3. {
  4. $x = (($lon + 180) * ($width / 360));
  5. $y = ((($lat * -1) + 90) * ($height / 180));
  6. return array("x"=>round($x),"y"=>round($y));
  7. }
  8. ?>

Report this snippet  

You need to login to post a comment.