In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, I would like to share with you the relevant knowledge about how WeChat Mini Programs API obtains the location. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
Wx.getLocation (OBJECT)
Get the current geographic location and speed. This API cannot be called when the user leaves Mini Program; when the user clicks "Show at the top of chat", the API can continue to be called.
OBJECT parameter description:
The required parameter type indicates whether typeString returns gps coordinates by default "wgs84", and "gcj02" returns the coordinates available for wx.openLocation. SuccessFunction is a callback function successfully called by the API. For more information, please see the returned parameters. FailFunction No API calls failed callback function completeFunction No API calls the finished callback function (both successful and failed calls will be executed)
Success return parameter description:
Parameter description minimum version latitude latitude, floating point number, range is-90mm 90, negative number indicates south latitude longitude longitude, floating point number, range is-180mm 180. negative number indicates west longitude speed speed, floating point number, accuracy altitude height of unit m/saccuracy position, unit m1.2.0verticalAccuracy vertical precision, unit m (Android cannot be obtained, returns 0) 1.2.0horizontalAccuracy horizontal precision, unit m1.2.0
Sample code:
Wx.getLocation ({type: 'wgs84', success: function (res) {var latitude = res.latitude var longitude = res.longitude var speed = res.speed var accuracy = res.accuracy}}) wx.chooseLocation (OBJECT)
Open the map and select the location.
User authorization scope.userLocation is required
OBJECT parameter description:
The parameter type is required to indicate that successFunction is a callback function successfully called by the API. For more information, please see the returned parameters. Call failFunction No API to call failed callback function when cancelFunction No user cancels. CompleteFunction No API calls the finished callback function (both successful and failed calls will be executed)
Success return parameter description:
Parameter description name location name address detailed address latitude latitude, floating point number, range is-90mm 90, negative number indicates south latitude longitude longitude, floating point number, range is-180mm 180, negative number represents west longitude
These are all the contents of the article "how to get the location of WeChat Mini Programs API". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.