uni-app 通过本地经纬度获取详细地理位置

uni.getLocation({
	type: 'wgs84',
	success: function(res) {
		console.log('当前位置的经度:' + res.longitude);
		console.log('当前位置的纬度:' + res.latitude);
		var point = new plus.maps.Point(res.longitude, res.latitude);
		plus.maps.Map.reverseGeocode(
			point,
			{},
			function(event) {
				var address = event.address; // 转换后的地理位置
				var point = event.coord; // 转换后的坐标信息
				var coordType = event.coordType; // 转换后的坐标系类型
				console.log(address, 'address');
			},
			function(e) {}
		);
	}
});

猜你喜欢

转载自blog.csdn.net/weixin_44285250/article/details/113879078
今日推荐