当前位置:网站首页>Uniapp wechat applet calls mobile map to navigate to the target point
Uniapp wechat applet calls mobile map to navigate to the target point
2022-06-24 18:13:00 【Gongsun yuaner】
If your page has obtained the user's location permission , That's how it's written
toAddress(position,positionAddress){
let arr = position.split(',')
const latitude = arr[0]
const longitude = arr[1]
console.log(' Call up the map :',arr)
// Open the map and navigate to the location
uni.openLocation({
latitude: parseFloat(latitude),
longitude: parseFloat(longitude),
scale: 15,
name: ' Destination ',
address: positionAddress,
success: res => {
console.log(' Map opened successfully :', res)
},
fail: res => {
console.log(' Failed to open map :', res)
},
})
},
If not , It should be :
uni.getLocation({
type: 'gcj02', // Return can be used for uni.openLocation Longitude and latitude of
success: function (res) {
const latitude = res.latitude;
const longitude = res.longitude;
uni.openLocation({
latitude: latitude,
longitude: longitude,
success: function () {
console.log('success');
}
});
}
});
边栏推荐
- Exception: Gradle task assembleDebug failed with exit code 1
- Bigdecimalavoiddoubleconstructorrule: do not directly use the double variable as a parameter to construct BigDecimal
- Four security issues of low code and no code development
- 03. Tencent cloud IOT device side learning -- overview of mqtt control package
- He "painted" what a smart city should look like with his oars
- EasyNVR使用Onvif探测设备失败,显示“无数据”是什么原因?
- Paper sharing | self supervised learning paper jointly released by Yann Lecun and read by engineers
- 持续助力企业数字化转型-TCE获得国内首批数字化可信服务平台认证
- variable
- How does the video platform import the old database into the new database?
猜你喜欢

Software testing methods: a short guide to quality assurance (QA) models

Several key points for enterprises to pay attention to digital transformation
Online sequence flow chart making tool

How to start cloud native application development

Exception: Gradle task assembleDebug failed with exit code 1

Ten excellent business process automation tools for small businesses

13 ways to reduce the cost of cloud computing
Issue 39: MySQL time class partition write SQL considerations

How can programmers reduce bugs in development?

13 skills necessary for a competent QA Manager
随机推荐
Welcome to the network security threat information sharing program
Mysql database performance testing tool recommendation
Is it safe to open an account online? What should I do?
EasyNVR使用Onvif探测设备失败,显示“无数据”是什么原因?
Selection (032) - what is the output of the following code?
An analysis of the comments on the TV series Douban by procedural apes
What if the database table structure changes? Smartbi products support one click synchronization
Seven strategies for successfully integrating digital transformation
Overall planning and construction method of digital transformation
Two micro service interviews where small companies suffer losses
[can you really use es] Introduction to es Basics (I)
腾讯云TCS:面向应用的一站式PaaS 平台
Ten software development indicators for project managers
Application service access configuration parameters
Mengyou Technology: tiktok current limiting? Teach you to create popular copywriting + popular background music selection
Restcloud ETL extracting dynamic library table data
Complete Guide to web application penetration testing
Leveldb source code analysis -- log file format
EasyGBS视频平台TCP主动模式拉流异常情况修复
Cloud service selection of enterprises: comparative analysis of SaaS, PAAS and IAAs