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
Table of contents Preface What is ssh What is ssh...
Border Style The border-style property specifies ...
Preface When Ahhang was developing the Springboot...
Table of contents 1. Problem Discovery 2. View de...
Carousel The main idea is: In the large container...
Index merging is an intelligent algorithm provide...
This article shares the installation and configur...
Usually, there are two options when we develop Li...
Quoting Baidu's explanation of pseudo-static:...
1. Introduction Our real servers should not be di...
A recent business involves such a requirement tha...
This article example shares the specific code of ...
Preface JavaScript continues to grow and prosper ...
Chapter 1 Source Code Installation The installati...
Recently I wrote in my blog that in the project l...