Blogger Information
Blog 55
fans 0
comment 0
visits 58825
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
输入地点转换经纬度(百度地图)
南鸢离梦的博客
Original
901 people have browsed it

// 百度地图

public function baiduMap($address)

{

  1. $newdata = urlencode($address);
  2. $ak = "1234567890";
  3. $url = "http://api.map.baidu.com/geocoding/v3/?address=".$newdata."&output=json&ak=".$ak."";
  4. $address_data = file_get_contents($url);
  5. $json_data = json_decode($address_data);
  6. $gps = [];
  7. $gps['lng'] = $json_data->result->location->lng;
  8. $gps['lat'] = $json_data->result->location->lat;
  9. return $gps;

}

$ak 秘钥性质,注册创建应用可得

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post