uniapp在H5和App使用百度地图的关键字提示输入、获取地图信息

登录百度账号 应用类别选择(浏览器端)

在根目录下的static/html创建Bmap.html

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
		<style type="text/css">
			body,
			html {
				width: 100%;
				height: 100%;
				margin: 0;
				font-family: "微软雅黑";
				font-size: 14px;
			}

			#l-map {
				height: 100%;
				width: 100%;
			}

			#myPageTop {

				position: absolute;
				top: 5px;
				left: 10px;
				background: #fff none repeat scroll 0 0;
				border: 1px solid #ccc;
				padding: 6px;
				font-family: "Microsoft Yahei", "΢���ź�", "Pinghei";
				font-size: 14px;
			}

			#r-result {
				position: absolute;
				top: 1px;
				right: 10px;
				width: 100%;
			}

			.container {
				width: 130px;
				background-color: #fff;
				position: absolute;
				top: 5px;
				right: 10px;
				border-radius: 10px;
				overflow: hidden;
				padding: 6px;

			}

			.container .row2 {
				margin: 6px 0;
			}

			.container .row3 {
				text-align: center;
			}
		</style>
		<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=你的ak">
		</script>
		<!-- 只对App有效 -->
		<script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js">
		</script>
		<title>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值