当前位置:网站首页>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');
}
});
}
});
边栏推荐
- Selection (031) -cool_ How long can secret be accessed?
- NVM download, installation and use
- How to create simple shapes in illustrator 2022
- Mysql database performance testing tool recommendation
- [quick news] the jeecgboot low code platform was successfully selected into the 2021 scientific innovation China · open source innovation list
- Digital transformation informatization data planning and technology planning
- Welcome to the network security threat information sharing program
- Erc-721 Standard Specification
- 腾讯云荣获“可信云技术最佳实践-虚拟化”
- 专有云TCE COS新一代存储引擎YottaStore介绍
猜你喜欢

Crmeb multi merchant PC packaging tutorial

Specification for self test requirements of program developers

On software requirement analysis

Six configuration management tools that administrators must know

Project Management Guide: tips, strategies and specific practices
Using flex to implement common layouts

High quality defect analysis: let yourself write fewer bugs
Online sequence flow chart making tool

Overall planning and construction method of digital transformation

Cloud service selection of enterprises: comparative analysis of SaaS, PAAS and IAAs
随机推荐
股票网上开户安全吗?应该怎么办理?
About whether arm's large and small end mode is related to CPU or compiler
Considerations for it project demand analysis
[quick news] the jeecgboot low code platform was successfully selected into the 2021 scientific innovation China · open source innovation list
How can programmers reduce bugs in development?
[JS Framework] Failed to execute the callback function:
Online sequence flow chart making tool
On software requirement analysis
Design topic: MATLAB cellular automata personnel evacuation
Easyplayer streaming media player plays HLS video. Technical optimization of slow starting speed
国家出手了!对知网启动网络安全审查
Fragment usage
浅谈云流送多人交互技术原理
Exception: Gradle task assembleDebug failed with exit code 1
13 skills necessary for a competent QA Manager
Why are more and more people studying for doctors? Isn't it more and more difficult to graduate a doctor?
C language | printf output function
投资理财产品的钱能随时取出来吗?
Do you charge for PDF merging software? Programmers make one by themselves
Tencent cloud won the "trusted cloud technology best practice - virtualization"