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
<br />Some web pages may not look large but ...
Preface I recently made a fireworks animation, wh...
For Centos installation of MySQL, please refer to...
Effect: <!doctype html> <html> <he...
This article uses examples to illustrate the MySQ...
Correct answer Using useRouter : // router path: ...
In addition to B-Tree indexes, MySQL also provide...
Preface Students who learn JavaScript know that A...
The reason why Docker is so popular nowadays is m...
Zabbix 2019/10/12 Chenxin refer to https://www.za...
Table of contents Preface Features of Vue Native ...
A master once said that you should know the datab...
We will install phpMyAdmin to work with Apache on...
Table of contents Overview Getting started with d...
What is bond NIC bond is a technology that is com...