使用腾讯地图WebService API进行地点搜索


https://lbs.qq.com/webservice_v1/guide-suggestion.html

1.  通过jsonp方式使用

$.ajax({
    type: "get",
    url:
        "https://apis.map.qq.com/ws/place/v1/suggestion?keyword=" + that.text +
        "&region=" + that.position + 
"&location=" + (that.lat + "," + that.lng) + "&get_subpois=1&key=你的key&output=jsonp" dataType: "jsonp", success: res => { //返回搜索结果 console.log(res); } });

2.  如果遇到报错"请求来源未被授权, 此次请求来源域名:",不要设置域名白名单

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM