I've been writing a WeChat applet recently and encountered some problems. I searched a lot on the Internet, but I didn't find the answer I wanted. I just dealt with the problem of this map and summarized it here, hoping it can help everyone. There are actually two ways to access Tencent Maps in WeChat Mini Programs. The first is to call Tencent's own map, and the second is to use the plug-in ma-route 1. Calling Tencent’s own mapThe implementation results are as follows: This is very simple and many people use it. You only need to call two map APIs. It’s the two above. Of course, when calling openLocation, you must first call getLocation for authorization You need to configure the information in app.json as follows: Write the following method on the page where you need to jump to the map: Click Can pop up Baidu Maps, Amap and other third-party software The above is the first method. 2. The second methodFirst, find the WeChat applet Add the plugin in the plugin manager Directions: First configure in the app.json file Secondly, configure the main.json file in its directory I wrote it based on mpvue, so it is slightly different from the development documentation First, get the destination address from the page you are redirected to, and then get the current location coordinates through getLocation The code is as follows: The following is the second method: the effect picture after success This concludes this article on two ways to connect WeChat mini-programs to Tencent Maps. For more information on connecting WeChat mini-programs to Tencent Maps, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed steps for developing WeChat mini-programs using Typescript
>>: Application example tutorial of key in Vue page rendering
Preface There are 4 types of operators in MySQL, ...
1. Introduction to mysqlbackup mysqlbackup is the...
This article uses an example to describe how MySQ...
Run the script in debug mode You can run the enti...
First of all, the formation of web page style main...
Preface: Speaking of sandboxes, our minds may ref...
The operating environment of this tutorial: Windo...
Note: Other machines (IP) cannot connect to the M...
Syn attack is the most common and most easily exp...
1. Docker Compose Overview Compose is a tool for ...
The specific code for JavaScript to implement the...
1. Environmental preparation: Operating system: C...
Sometimes our pages will need some prompt boxes o...
Table of contents 1. What is currying 2. Uses of ...
1. Multi-header table code Copy code The code is a...