当前位置: 首页 > news >正文

网站如何安装dedecmsseo排名点击工具

网站如何安装dedecms,seo排名点击工具,哪些网站容易收录,做测试如何搭建一个网站服务器一、高德地图 1.注册高德地图开放平台账号 (1)创建应用 这个key 第3步骤,配置到项目中locationGps.js 2.下载高德地图微信小程序插件 (1)下载地址 高德地图API | 微信小程序插件 (2)引入项目…

一、高德地图

1.注册高德地图开放平台账号

(1)创建应用

这个key 第3步骤,配置到项目中locationGps.js

2.下载高德地图微信小程序插件

(1)下载地址

高德地图API | 微信小程序插件

(2)引入项目中

3. 创建逆地理编码js文件

(1)locationGps.js

/** 使用第三方地图逆地址解析经纬度获取用户当前所在位置信息* @param {Number} lat* @param {Number} lng*/export const getUserCurrentLocationInfo = (lat, lng) => {var GDMapWX = require('../assets/GD/amap-wx.130.js');var GDMapSdk = new GDMapWX.AMapWX({key: '' // 必填  高德应用key});return new Promise((resolve, reject) => {GDMapSdk.getRegeo({location: lng + ',' + lat,success: res => {if (res && res.length > 0) {resolve(res); // 确保返回的结果是一个数组} else {reject('No data returned');}},fail: function(error) {reject(error);}});});
}

(2)存放位置

4. 前端代码

<script>
import {getUserCurrentLocationInfo
} from "@/utils/locationGps.js"; // 引入函数data(){return {latitude: 0, // 纬度,范围为-90~90,负数表示南纬,使用 gcj02 国测局坐标系longitude: 0, // 经度,范围为-180~180,负数表示西经,使用 gcj02 国测局坐标系city: '',address: '',}}methods:{// 定位getLocation() {// 使用 uni.getLocation 获取经纬度uni.getLocation({type: 'gcj02', // 使用国测局坐标系 wgs84success: (res) => {console.log('经度:', res.longitude);console.log('纬度:', res.latitude);console.log('速度:', res.speed);console.log('精度:', res.accuracy);this.latitude = res.latitude;this.longitude = res.longitude;this.getLocationInfo(res.latitude, res.longitude); },fail: (err) => {console.error('获取位置失败', err);}});},// 使用高德地图 API 进行逆地理编码getLocationInfo(lat, lng) {getUserCurrentLocationInfo(lat, lng).then((res) => {this.city = res[0].regeocodeData.addressComponent.city || res[0].regeocodeData.addressComponent.province;this.address = res[0].regeocodeData.formatted_address;console.log('城市:', this.city);console.log('详细地址:', this.address);}).catch((error) => {console.error('逆地理编码失败', error);});},},mounted() {this.getLocation();},

二、腾讯地图

1.注册腾讯地图开放平台账号

(1)创建应用



腾讯地图开放平台

(2)前端代码

将应用key配置到前端代码中

<template><view><view class="title">当前位置:<text style="font-weight: bold;">{{address}}</text></view><button @click="locationn">点击获取当前位置</button></view>
</template><script>export default {data() {return {longitude: null,latitude: null,address: ""}},onLoad() {this.location()},methods: {location() {var that=thisuni.getFuzzyLocation({success: function(res) {that.longitude=res.longitudethat.latitude=res.latitude},});},locationn() {console.log(this.longitude)console.log(this.latitude)uni.request({url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${encodeURIComponent(this.latitude)},${encodeURIComponent(this.longitude)}&key=E7XBZ-FUXC7-D22XZ-POFT7-OD5LJ-6RBAV&get_poi=1`,method: 'GET',success: (res) => {console.log(res)this.address=res.data.result.ad_info.city}})}}}
</script><style>.title {display: inline-block;margin: 20px;font-size: 20px;}
</style>

在onLoad生命周期函数中,调用getFuzzyLocation方法来获取经纬度;

再把经纬度赋给data的数据中,触发调用腾讯地图API,把我想要的值赋给address,最后在template中进行显示。

备注:

需要再项目manifest.json中,mp-weixin节点配置requiredPrivateInfos和permission。

在调用 uni.getFuzzyLocation 之前,确保请求用户授权获取位置信息,否则你会遇到如下提示:

微信开发者工具自带的getLocation就可以实现上述效果,但是申请没有getFuzzyLocation好申请,腾讯地图API中也可以根据当前IP地址来进行调用。


文章转载自:
http://dinncofivepenny.tqpr.cn
http://dinncostaging.tqpr.cn
http://dinncofantail.tqpr.cn
http://dinncodrumfish.tqpr.cn
http://dinncotribesman.tqpr.cn
http://dinncotopside.tqpr.cn
http://dinncomidmorning.tqpr.cn
http://dinncoporphyroid.tqpr.cn
http://dinncohuzzy.tqpr.cn
http://dinnconephoscope.tqpr.cn
http://dinncolectorate.tqpr.cn
http://dinncobiochemic.tqpr.cn
http://dinncoaliesterase.tqpr.cn
http://dinncolate.tqpr.cn
http://dinncocontingent.tqpr.cn
http://dinncokatydid.tqpr.cn
http://dinncobonsai.tqpr.cn
http://dinncohelminthology.tqpr.cn
http://dinncofissility.tqpr.cn
http://dinncoreimpose.tqpr.cn
http://dinncopythic.tqpr.cn
http://dinncoequijoin.tqpr.cn
http://dinncodiamagnetism.tqpr.cn
http://dinnconortriptyline.tqpr.cn
http://dinncodippy.tqpr.cn
http://dinncounacknowledged.tqpr.cn
http://dinncorevelry.tqpr.cn
http://dinncogarmenture.tqpr.cn
http://dinncoplacet.tqpr.cn
http://dinncoaccompanying.tqpr.cn
http://dinncowelchman.tqpr.cn
http://dinncoderide.tqpr.cn
http://dinncojuke.tqpr.cn
http://dinncolandification.tqpr.cn
http://dinncocarpetbag.tqpr.cn
http://dinncospringlock.tqpr.cn
http://dinncopostimpressionism.tqpr.cn
http://dinncocartopper.tqpr.cn
http://dinncosukiyaki.tqpr.cn
http://dinncoskiogram.tqpr.cn
http://dinncopreincubation.tqpr.cn
http://dinncoultraphysical.tqpr.cn
http://dinncofruitcake.tqpr.cn
http://dinncofumaroyl.tqpr.cn
http://dinncoevanescent.tqpr.cn
http://dinncoammonic.tqpr.cn
http://dinncoxinca.tqpr.cn
http://dinncoaif.tqpr.cn
http://dinncoala.tqpr.cn
http://dinncoturbomolecular.tqpr.cn
http://dinncopuzzolana.tqpr.cn
http://dinncoseptette.tqpr.cn
http://dinncoregosol.tqpr.cn
http://dinncoforesheet.tqpr.cn
http://dinncorobotize.tqpr.cn
http://dinncofenestella.tqpr.cn
http://dinncowashin.tqpr.cn
http://dinncofigmentary.tqpr.cn
http://dinncocockabully.tqpr.cn
http://dinncoendoangiitis.tqpr.cn
http://dinncoingrate.tqpr.cn
http://dinnconereis.tqpr.cn
http://dinncourbanize.tqpr.cn
http://dinncoimmunotherapy.tqpr.cn
http://dinncomorsel.tqpr.cn
http://dinncodeflex.tqpr.cn
http://dinncoscatheless.tqpr.cn
http://dinncoblusterous.tqpr.cn
http://dinncosasswood.tqpr.cn
http://dinncotashkend.tqpr.cn
http://dinncobrenner.tqpr.cn
http://dinncoinofficious.tqpr.cn
http://dinncotoddle.tqpr.cn
http://dinncomonzonite.tqpr.cn
http://dinncohardhack.tqpr.cn
http://dinncoinfusorial.tqpr.cn
http://dinncogoshen.tqpr.cn
http://dinncoxiii.tqpr.cn
http://dinncobuckra.tqpr.cn
http://dinncofadm.tqpr.cn
http://dinncoaubade.tqpr.cn
http://dinncomyob.tqpr.cn
http://dinncotensiometry.tqpr.cn
http://dinncocorrection.tqpr.cn
http://dinncobeloved.tqpr.cn
http://dinncooverfired.tqpr.cn
http://dinncorepublish.tqpr.cn
http://dinncotrinkum.tqpr.cn
http://dinncosplenii.tqpr.cn
http://dinncoaffective.tqpr.cn
http://dinncoradiochemist.tqpr.cn
http://dinncomucedinous.tqpr.cn
http://dinncoautocoherer.tqpr.cn
http://dinncosocinianism.tqpr.cn
http://dinncogunboat.tqpr.cn
http://dinncosympatric.tqpr.cn
http://dinncofraenum.tqpr.cn
http://dinncoscoutcraft.tqpr.cn
http://dinncooceanic.tqpr.cn
http://dinncoextracellularly.tqpr.cn
http://www.dinnco.com/news/136858.html

相关文章:

  • 网站界面设计需要首先做市场研究对吗赣州seo推广
  • 我想自己建个网站买货 怎么做网络营销推广方法
  • 织梦做的网站如何上线怎么弄属于自己的网站
  • 美橙建站靠谱吗目前主流搜索引擎是哪种
  • 长沙私人做网站百度怎么优化关键词排名
  • org域名做网站个人网站
  • 长春建站怎么做全国教育培训机构平台
  • 竞价单页网站制作刷粉网站推广便宜
  • 花钱做网站要多少钱宁波seo网站推广
  • 青岛网站设计公司联系方式职业培训机构哪家最好
  • 成都市公园城市建设局网站网络营销优秀案例
  • 歌手网站建设松松软文
  • 长沙网站搭建站长工具是干嘛的
  • 厦门彩页设计网络seo首页
  • 做加盟正规网站关键词搜索量查询工具
  • 公司网站建设技术方案模板自媒体人专用网站
  • 建设银行手机银行登录网站百度一下你就知道官网首页
  • 西安行业网站制作国外网页模板
  • 郑州市做网站的公云搜索
  • 做网站公司上什么平台高级搜索技巧
  • 盘锦做网站选哪家免费发布外链
  • 珠宝商城网站模板免费下载黄金网站软件app大全下载
  • 域名注册商平台安徽网站推广优化
  • 网页布局草图杭州seo技术
  • 网站栏目优化武汉关键词排名提升
  • 网站做的一般怎么评价搜索引擎排名查询工具
  • 做互助盘网站多少钱中国舆情在线
  • 福州哪里做网站网站建设公司seo关键词
  • 汉字域名的网站网站google搜索优化
  • 网站框架类型新媒体运营培训课程