How to call a third party location navigation on WeChat HTML5 page

How do WeChat HTML5 pages call third-party location navigation? This issue may be often seen in our daily study or work. I hope that you can give you a deep harvest through this issue. Below is the reference content brought by Xiaobian, let’s take a look!

    through WeChat certified public account
  1. has filed domain name
  2. Background: WeChat public account Click on the menu bar to jump to the h6 page, you need to use the navigation function

  3. requirement: When the user clicks on the navigation button, jump to third-party APP for navigation

Reference: WeChat public account development document


Introducing a page of the JS interface to introduce the following JS file, (support https): http: //Res.wx.

jssdk signature, this permission is provided by the background, the front end only needs to inject the signature authority into wx.config, I believe This step of WeChat Other API can save

“wx.config ({debug: true, // open debug mode, the return value of all APIs called will be on the client Alert comes out, to view the incoming parameters, you can open in the PC side, the parameter information will be played through the log, only in the PC terminal, will print. Appid: ”, // Required, the unique identity of the public number TimeStamp: , // must-fill, generate the timestamp of the signature Noncestr: ”, // Required, generate the random string signature: ”, // mustal, signature JSAPILIST: [‘OpenLocation’] // mustal, need MakeUse the JS interface list Here you can use the WeChat API OpenLocation to use the WeChat built-in map to view location interface}); “

  The place debug you need to pay attention to is changed to Fallse, Jsapilist to fill in the interface you want to use, no effect  
to register with the navigation button, call wx.openLocation method

$ (‘. btn2 ‘) .click () {wx.openLocation ({Latitude: 22.545538, // latitude, floating point number, range from 90 ~ -90 longitude: 114.054565, // longitude, floating point number, range of 180 ~ -180. Name : ‘Here you fill in the location name’, // Location name Address: ‘Location name details’, // Address Details Scale: 10, // Map Zoom Level, Integility Value, Range from 1 to 28. The default is maximum} );})

After clicking, you can jump to the WeChat location page, click the navigation in the lower right corner to pull up the third party’s navigation pull!
  5. WeChat uses the coordinates of GCJ02. Some maps use the wgs84 coordinates. If the error occurs, it can be considered whether it is incoming latitude and longitude problem, the specific question  
Thank you! After reading the above, do you call the third party location navigation about the WeChat HTML5 page? I hope the content of the article is helpful to everyone. If you want to know more about the article content, please pay attention to the Tumi Yun Industry Information Channel.

© Copyright Notice
Just support it if you like
comment Grab the couch

Please log in to comment