当前位置:网站首页>Use and arrangement of wechat applet coordinate position interface (I)
Use and arrangement of wechat applet coordinate position interface (I)
2022-06-13 02:55:00 【Tianma 3798】
Use and arrangement of coordinate position interface of wechat applet
Common location scenarios :
1. Get current location coordinate
2. Check the location 、 Navigation
3. Select location 、 coordinate
4. analysis / Inverse analysis Location 《=》 coordinate
5. Route planning
One 、 Get current location ,wx.getLocation()
official API:wx.getLocation(Object object) | Wechat open documents
Support applet mobile terminal ,windows Computer terminal ,mac Computer terminal .
Use cases :
// Get current location
wx.getLocation({
success: res => {
console.info(res);
},
fail: res => {
console.error(res);
}
})
In particular : The location in the applet needs to be authorized by the user , It is required to use the instructions in the configuration general settings .
app.json The configuration is as follows : The description can be modified by itself
"permission": {
"scope.userLocation": {
"desc": " Your location information will be used to show the effect of the applet location interface "
}
}Two 、wx.openLocation(Object object) Map open position navigation
Official website API:wx.openLocation(Object object) | Wechat open documents
Support applet mobile terminal ,Mac Computer terminal
// Get current location
wx.getLocation({
success: res => {
console.info(res);
// Open position
wx.openLocation({
latitude: res.latitude,
longitude: res.longitude,
name: ' Stephen ',
address: '12341234'
})
},
fail: res => {
console.error(res);
}
})
3、 ... and 、wx.chooseLocation(Object object) Select location , Select Business District
official API:wx.chooseLocation(Object object) | Wechat open documents
Only the mobile side of the applet is supported
wx.chooseLocation({
latitude: 0,
success:res=>{
console.info(res);
}
})

Other interfaces are being improved
more :
Wechat applet switch Style rewriting
Applet Image Component long press to identify supported codes
边栏推荐
- Hash tables: metaphrases
- Traverse the array and delete an element until it is deleted
- IOS development interview knowledge sorting - OC Foundation (II)
- Vant框架中关于IndexBar索引栏的CDN单页面引用,无法正常展示
- Modify the color of El input, textarea and El checkbox when they are disabled
- The extra money we made in those years
- A wechat app for shopping
- 六款国产飞机专用GPU产品通过鉴定审查
- redis. Conf general configuration details
- Radio design and implementation in IVI system
猜你喜欢

小程序 input,textarea组件权重比fixed的z-index都高

Code d'initialisation de l'arbre binaire

Logiciel professionnel de gestion de base de données: Valentina Studio Pro pour Mac

Binary tree initialization code

OneNote User Guide (1)

JS merge multiple string arrays to maintain the original order and remove duplicates

Prometheus node_ Exporter installs and registers as a service
![[data and Analysis Visualization] data operation in D3 tutorial 3-d3](/img/c9/82385b125a8e47d900c320b5f4f3b2.jpg)
[data and Analysis Visualization] data operation in D3 tutorial 3-d3

Linked list: palindrome linked list

Spark UDF instance details
随机推荐
JS merge multiple string arrays to maintain the original order and remove duplicates
Vscode liveserver use_ Liveserver startup debugging
Entity framework extends the actual combat, small project reconfiguration, no trouble
六款国产飞机专用GPU产品通过鉴定审查
The latest Matlab r2020 B ultrasonic detailed installation tutorial (with complete installation files)
OpenCVSharpSample05Wpf
Scala implements workcount
[data analysis and visualization] key points of data drawing 10- construction of legend
wx.createSelectorQuery()在components获取Dom节点的使用
OpenCVSharpSample04WinForms
In my ten years, every bit has become a landscape?
HEAP[xxx.exe]: Invalid address specified to RtlValidateHeap( 0xxxxxx, 0x000xx)
Kotlin memorandum
IOS development interview knowledge sorting - OC Foundation (II)
Graduation project - campus old thing recycling system based on stm32
[thoughts in the essay] mourn for development technology expert Mao Xingyun
PCR validation of basic biological experiments in [life sciences]
Six special GPU products for domestic aircraft passed the appraisal and review
For loop instead of while loop - for loop instead of while loop
Pycharm and Anaconda ultra detailed installation and configuration tutorial