Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to open map selection location in Mini Program development

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article "How to open the map to select the location in the development of Mini programs" is not very understood by most people except for the program members. In order to make everyone understand more "How to open the map to select the location in the development of Mini programs," today's editor summarizes the following contents for everyone, which have certain reference value, clear detailed steps and proper details. I hope you will gain something through this article. Let's take a look at the specific contents together.

Open the map and select the location.

User authorization required scope.userLocation

OBJECT Parameter Description:

Parameter Type Required Description successFunction is a callback function successfully invoked by the interface. For details of the return content, see Return Parameter Description. failFunction No interface call failed callback function completeFunction No interface call ended callback function (successful or failed call will be executed)

success Return parameter description:

parameter description name location name address detailed address latitude, floating point number, range-90~90, negative number indicates south latitude longitude, floating point number, range-180~180, negative number indicates west longitude wx.openLocation(OBJECT)

Use WeChat built-in map to view location.

User authorization required scope.userLocation

OBJECT Parameter Description:

Parameter type Required Description latitudeFloat is latitude, range: -90~90, negative number means south latitude longitudeFloat is longitude, range: -180~180, negative number means west longitude scaleINT No scaling, range: 5~18, default: 18nameString No location name addressString No address Details successFunction No interface call successful callback function failFunction No interface call failed callback function completeFunction No interface call finished callback function (successful call, failed call will be executed)

Example code:

wx.getLocation({ type: 'gcj02',//Returns the latitude and longitude that can be used for wx.openLocation success: function(res) {var latitude = res. latitude var longitude = res.longitude wx.openLocation({ latitude: latitude, longitude: longitude, scale: 28}) }}) What does Mini programs mean? Mini programs are applications that can be used without downloading and installing. They can be used immediately by scanning QR codes or searching. They are simple to operate and easy to spread. They can realize seven functions such as message notification, offline scanning code and public number association. It is based on WeChat, similar to APP, want to use it, run out of it, will not occupy memory.

Thank you for your reading, I hope you have a certain understanding of the key problem of "how to open the map and select the location in the development of Mini programs." The specific use situation still needs to be realized by our own experiments. Try it quickly. If you want to read more articles related to knowledge points, 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report