当前位置:网站首页>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');
}
});
}
});
边栏推荐
- On the principle of cloud streaming multi person interaction technology
- Ten excellent business process automation tools for small businesses
- PHP WMI get hostname
- Error reported after NPM I
- Do you know CMDB?
- 13 skills necessary for a competent QA Manager
- Business based precipitation component = & gt; manage-table
- How to use SEO to increase the inquiry volume?
- Optimizing bloom filter: challenges, solutions, and comparisons
- An analysis of the comments on the TV series Douban by procedural apes
猜你喜欢

How to start cloud native application development
Online sequence flow chart making tool

The country has made a move! Launch network security review on HowNet

Three indicators to help you measure the effectiveness of digital transformation

Seven strategies for successfully integrating digital transformation

Regression testing strategy for comprehensive quality assurance system
Millions of dollars worth of NFT were stolen in the attack, and Google issued an emergency warning to 3.2 billion users worldwide | February 21 global network security hotspot

(Video + graphics) introduction to machine learning series - Chapter 11 support vector machines
Business based precipitation component = & gt; manage-table

Recommend 14 commonly used test development tools
随机推荐
Operation and maintenance guide | cos back source setting practice
variable
Optimizing bloom filter: challenges, solutions, and comparisons
Five skills of selecting embedded programming language
持续助力企业数字化转型-TCE获得国内首批数字化可信服务平台认证
Is it safe to open an account online? What should I do?
Three years of bug free, tips for improving code quality
Explanation of pod DNS configuration & cases of DNS resolution failure
Three simple steps to quickly complete order data processing through workflow (ASW)
[NLP] 3 papers on how Stanford team builds a better chat AI
这个巡检平台你还不知道,真是亏大了!
Quickly build MySQL million level test data
What are the reasons for the abnormal playback of the online channel of the channel accessed by easycvr national standard protocol?
1. Leveldb getting started
The 'ng' entry cannot be recognized as the name of a cmdlet, function, script file, or runnable program. Check the spelling of the name. If you include a path, make sure the path is correct, and then
Recommend 14 commonly used test development tools
Seven strategies for successfully integrating digital transformation
Tencent cloud won the "trusted cloud technology best practice - virtualization"
Nine practical guidelines for improving responsive design testing
Tencent cloud TCS: an application-oriented one-stop PAAS platform