Tencent location service---vue WeChat applet SDK use (1)---download the SDK and package again

Download address and document https://lbs.qq.com/miniProgram/jsSdk/jsSdkGuide/jsSdkOverview
Tencent's location service can search for keywords to remind inverse address resolution address resolution route planning distance calculation to obtain the city list The way to
university is also in its own, hard work Learning, passionate youth
If you are interested in programming, you can join our qq group to communicate together: 974178910

Download SDK and package again

download

Download address https://lbs.qq.com/miniProgram/jsSdk/jsSdkGuide/jsSdkOverview After
downloading, remember to apply for a key to
Insert picture description hereenable WebServiceApi
Insert picture description here

Get the key and call the interface to use
Insert picture description here

Repackage

If you are uniapp

Create a new directory common/mapApi Create a new file common/mapApi/index.js
Put the downloaded file into it,
you can delete min
Insert picture description here

In index.js

const QQMapWX = require('./qqmap-wx-jssdk.js')

const mapApi = new QQMapWX({
    
    
	key: "位置服务后台 拿到的key值"
})

module.exports = mapApi;

If not uniapp

The directory is
Insert picture description herealso in the index as follows

const QQMapWX = require('./qqmap-wx-jssdk.js')

const mapApi = new QQMapWX({
    
    
	key: "位置服务后台 拿到的key值"
})

module.exports = mapApi;

test

We conduct a location search

Document address https://lbs.qq.com/miniProgram/jsSdk/jsSdkGuide/methodSearch
This is the usage of the official website.
Insert picture description hereLet's write a test.
Introduce
Insert picture description here

testing method
Insert picture description here

test() {
    
    
	mapApi.search({
    
    
		keyword: "酒店",
		success: res => {
    
    
			console.log(res)
		}
	})
}

testing successfully
Insert picture description here

The way of university is also in oneself, study hard, youth
with passion. If you are interested in programming, you can join our qq group to communicate together: 974178910

Guess you like

Origin blog.csdn.net/qq_42027681/article/details/114096662