In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you how to obtain the current geographical location and speed in the development of Mini Program. The content is simple and clear. I hope it can help you solve your doubts. Next, let the editor take you to study and learn the article "how to obtain the current geographical location and speed in Mini Program development".
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:
Required parameter type indicates whether the minimum version of typeString returns gps coordinates by default. If gcj02 returns the coordinates available for wx.openLocation, whether altitudeBoolean is passed into true will return height information, which will slow down the return speed of the API due to the high accuracy required to obtain height. 1.6.0successFunction 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.latitudevar longitude = res.longitudevar speed = res.speedvar accuracy = res.accuracy}) what does Mini Program mean? Mini Program is an application that can be used without download or installation. It can be used immediately by scanning a QR code or searching it. It is easy to operate and easy to spread. It can achieve seven major functions, such as message notification, offline code scanning, and official account association. It is based on Wechat, similar to APP. You can use it whenever you want. After using it, you will leave without taking up memory.
The above is about "how to get the current geographical location and speed in Mini Program development". If this article is helpful to you and think it is well written, please share it with your friends to learn new knowledge. if you want to know more about it, please pay more 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.