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

时间:2019-10-27 12:42:08   收藏:0   阅读:827

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.  如果遇到报错"请求来源未被授权, 此次请求来源域名:",不要设置域名白名单

技术分享图片

 

原文:https://www.cnblogs.com/223zzm/p/11747012.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!