用于查找位置坐标的Java脚本代码 [英] Java script code for find cordinate of place
本文介绍了用于查找位置坐标的Java脚本代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人
实际上,我想查找使用Php代码的任何地方的纬度和经度,但是我需要使用Java Script代码.
php代码:
Dear All
Actually i want to find latitude and longitude of any place I use Php code for it but i need Java Script code for same.
php code:
$place="Delhi" //data
$urlc="http://maps.google.com/maps/api/geocode/json?address=".$place."&sensor=false";
$geocode=file_get_contents($urlc);
$output= json_decode($geocode);
$latitude = $output->results[0]->geometry->location->lat;
$longitude = $output->results[0]->geometry->location->lng;
请帮助我
Vivek
Kindly help me
Vivek
推荐答案
place = " // 数据
place="Delhi" //data
urlc = " http://maps.google.com/maps/api/geocode/json?address=".
位置." ;
这篇关于用于查找位置坐标的Java脚本代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文