腾讯地图根据经纬度解析坐标位置描述

	public function positioning(){if(Request() -> isPost()){header("Content-type:text/html;charset=utf-8"); //维度//$lat=input('post.lat');$lat="37.47517";//经度//$lng=input('post.lng'); $lng="121.37377"; $str = "https://apis.map.qq.com/ws/geocoder/v1/?location=$lat,$lng&key="."腾讯地图申请key值"."&get_poi=1";  $content = file_get_contents($str); $arr = json_decode($content, true); return json(['status' => 1,'arr' => $arr]);}}

输出值

{"status": 1,"arr": {"status": 0,"message": "query ok","request_id": "090e2a6e-2b2d-11ec-a3bc-525400ad3e61","result": {"location": {"lat": 37.47517,"lng": 121.37377},"address": "山东省烟台市芝罘区通世南路","formatted_addresses": {"recommend": "芝罘区山东省烟台第十五中学(通世南路西)","rough": "芝罘区山东省烟台第十五中学(通世南路西)"},"address_component": {"nation": "中国","province": "山东省","city": "烟台市","district": "芝罘区","street": "通世南路","street_number": "通世南路"},"ad_info": {"nation_code": "156","adcode": "370602","city_code": "156370600","name": "中国,山东省,烟台市,芝罘区","location": {"lat": 37.415199,"lng": 121.375},"nation": "中国","province": "山东省","city": "烟台市","district": "芝罘区"},"address_reference": {"street_number": {"id": "","title": "","location": {"lat": 37.462452,"lng": 121.373611},"_distance": 46,"_dir_desc": "西"},"business_area": {"id": "11661363937018377453","title": "机场路","location": {"lat": 37.478241,"lng": 121.368217},"_distance": 0,"_dir_desc": "内"},"famous_area": {"id": "11661363937018377453","title": "机场路","location": {"lat": 37.478241,"lng": 121.368217},"_distance": 0,"_dir_desc": "内"},"crossroad": {"id": "5161453","title": "峰山路/通世南路(路口)","location": {"lat": 37.476189,"lng": 121.374237},"_distance": 115.1,"_dir_desc": "南"},"town": {"id": "370602009","title": "黄务街道","location": {"lat": 37.463146,"lng": 121.310013},"_distance": 0,"_dir_desc": "内"},"street": {"id": "2301293910130777050","title": "通世南路","location": {"lat": 37.462452,"lng": 121.373611},"_distance": 46,"_dir_desc": "西"},"landmark_l1": {"id": "11400571335276793383","title": "通世新城","location": {"lat": 37.472343,"lng": 121.377007},"_distance": 87.9,"_dir_desc": "西北"},"landmark_l2": {"id": "8309582130146904515","title": "山东省烟台第十五中学","location": {"lat": 37.474285,"lng": 121.373146},"_distance": 0,"_dir_desc": "内"}},"poi_count": 10,"pois": [{"id": "8309582130146904515","title": "山东省烟台第十五中学","address": "山东省烟台市芝罘区通世南路","category": "教育学校:中学","location": {"lat": 37.474285,"lng": 121.373146},"ad_info": {"adcode": "370602","province": "山东省","city": "烟台市","district": "芝罘区"},"_distance": 0,"_dir_desc": "内"},{"id": "14524327603739928378","title": "烟台服务外包基地","address": "山东省烟台市芝罘区峰山路1号(近通世南路)","category": "公司企业:公司企业","location": {"lat": 37.475624,"lng": 121.373917},"ad_info": {"adcode": "370602","province": "山东省","city": "烟台市","district": "芝罘区"},"_distance": 43.2,"_dir_desc": "南"},{"id": "11423042135550006590","title": "夏家卧龙公交站","address": "山东省烟台市芝罘区夏家卧龙公交站","category": "基础设施:交通设施:公交车站","location": {"lat": 37.475269,"lng": 121.374023},"ad_info": {"adcode": "370602","province": "","city": "","district": ""},"_distance": 24.8,"_dir_desc": ""},{"id": "12469446539344322841","title": "烟台互联网智慧产业园","address": "山东省烟台市芝罘区峰山路1号(近通世南路)","category": "房产小区:产业园区","location": {"lat": 37.475719,"lng": 121.373894},"ad_info": {"adcode": "370602","province": "山东省","city": "烟台市","district": "芝罘区"},"_distance": 62.1,"_dir_desc": "南"},{"id": "11400571335276793383","title": "通世新城","address": "山东省烟台市芝罘区通世南路","category": "房产小区:住宅区:住宅小区","location": {"lat": 37.472343,"lng": 121.377007},"ad_info": {"adcode": "370602","province": "山东省","city": "烟台市","district": "芝罘区"},"_distance": 87.9,"_dir_desc": "西北"},{"id": "11587238450016162586","title": "烟台市芝罘区青年创业园(通世南路)","address": "山东省烟台市芝罘区峰山路1号","category": "房产小区:产业园区","location": {"lat": 37.475689,"lng": 121.373741},"ad_info": {"adcode": "370602","province": "山东省","city": "烟台市","district": "芝罘区"},"_distance": 57.8,"_dir_desc": "南"},{"id": "18417135939015001618","title": "山东电小二工程管理有限公司","address": "山东省烟台市芝罘区峰山路1号3层","category": "公司企业:公司企业","location": {"lat": 37.475685,"lng": 121.373901},"ad_info": {"adcode": "370602","province": "山东省","city": "烟台市","district": "芝罘区"},"_distance": 58.5,"_dir_desc": "南"},{"id": "1458204930238432003","title": "烟台物联网产业园","address": "山东省烟台市芝罘区峰山路1号","category": "房产小区:产业园区","location": {"lat": 37.475956,"lng": 121.373688},"ad_info": {"adcode": "370602","province": "山东省","city": "烟台市","district": "芝罘区"},"_distance": 87.8,"_dir_desc": "南"},{"id": "15797572331575909171","title": "智科畅联科技有限公司","address": "山东省烟台市芝罘区峰山路与通世南路交叉口西南100米","category": "公司企业:公司企业","location": {"lat": 37.475513,"lng": 121.372772},"ad_info": {"adcode": "370602","province": "山东省","city": "烟台市","district": "芝罘区"},"_distance": 96.2,"_dir_desc": "东南"},{"id": "586288757560636735","title": "淘小西电子商务产业园","address": "山东省烟台市芝罘区峰山路1号","category": "房产小区:产业园区","location": {"lat": 37.476028,"lng": 121.372871},"ad_info": {"adcode": "370602","province": "山东省","city": "烟台市","district": "芝罘区"},"_distance": 124.3,"_dir_desc": "东南"}]}}
}


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部