1.0.6 • Published 3 years ago
locationgpsrzt v1.0.6
locationgpsrzt
获取经纬度的二次封装;以及城市信息的获取 返回均为一个promise对象;支持.then格式使用。
简介
此 locationgpsrzt 主要有两个方法应用在uap环境中(获取经纬度、当前城市信息):
1、CityMessageRzt 城市信息
2、locationGPSeRzt 当前经纬度
特殊说明
虚拟机环境下(部分手机调试有异常);正式环境是正常的。
使用方式
NODE
- 安装 Using npm:
npm install locationgpsrzt --save-dev
- 使用
import { CityMessageRzt, locationGPSeRzt } from "locationgpsrzt";//引入
export default {
created() {
<!-- 当前的经纬度 -->
locationGPSeRzt().then((res) => {
<!-- 返回格式: {inLat:39.897445,inLog:116.313331398} -->
});
<!-- 当前城市信息 -->
CityMessageRzt().then((res) => {
<!-- 返回格式:{"point":{"lng":116.331398,"lat":39.897445},"address":"北京市丰台区莲花河西路","addressComponents":{"streetNumber":"","street":"莲花河西路","district":"丰台区","city":"北京市","province":"北京市"},"surroundingPois":[],"business":"广安门,北京西站/西客站,马连道"} -->
});
},
};