The function of using Tencent map navigation in the uniapp applet

1. First, apply for a key on the official website of Tencent Maps

2. Open the WeChat public platform

Settings>Third Party Settings>Add Plugin Search Tencent Maps Service

 

 After entering, click Apply

Introduce the plug-in in uniapp manifest.json and add the code in the circle

 Used in the page, add the following fields when calling the method

	let plugin = requirePlugin('routePlan');
	let key = ; //使用在腾讯位置服务申请的key
	let referer = ''; //调用插件的app的名称
	let endPoint = JSON.stringify({ //终点经纬度
			'name': ,
			'latitude': ,
			'longitude': 
	});
	uni.navigateTo({
			url: 'plugin://routePlan/index?key=' + key + '&referer=' + referer +             
           '&endPoint=' + endPoint
				});

 navigation page

 

Guess you like

Origin blog.csdn.net/m0_68812159/article/details/127815208