首先在index.html文件引入:
<script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=kM1RFA6AzOnv6lmlc7qyOMhqBILu1pgk"></script>
简单实现地图显示:
useReady(() => { const { BMap } = window as any let map: any = new BMap.Map("h5mapcontainer") let point: any = new BMap.Point(longitude, latitude) map.centerAndZoom(point, 15) })
功能操作请详见百度地图api