我是靠谱客的博主 彩色大白,这篇文章主要介绍H5获取经纬度(通过IP定位),现在分享给大家,希望可以做个参考。

let data = {

                key: "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" //腾讯地图申请的密钥

            };

            let url = "https://apis.map.qq.com/ws/location/v1/ip"; //这个就是地理位置信息的接口

            data.output = "jsonp";

            this.$jsonp(url, data) 

                .then(res => {

                    console.log(res.result.location.lat);

                    console.log(res.result.location.lng);

                }).catch(error => {

                    console.log(error);

                });

最后

以上就是彩色大白最近收集整理的关于H5获取经纬度(通过IP定位)的全部内容,更多相关H5获取经纬度(通过IP定位)内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(133)

评论列表共有 0 条评论

立即
投稿
返回
顶部