I\'m making a PHP application involving Google Maps. Maps only accepts lat&lng pairs, and the data I want to display comes only with UTM style coordinat
I know it's late to answer this question but since I couldn't use any of the above codes, I wrote my own version which is actually very easy to use. This is the address: https://github.com/maroofi/coordinates To convert UTM to LatLong:
utm2ll(729286.9550018794,4021544.8279992654,40,true);
output:
{"success":true,"attr":{"lat":36.311665575271,"lon":59.553858137274}}
To convert LatLong to UTM:
ll2utm(36.311665575277935,59.55385813725379);
output:
{"success":true,"attr":{"x":729286.95500188,"y":4021544.8279993,"zone":40,"aboveEquator":true}}
Hope it helps.