H5调用百度地图导航

template

    <div class="map">
        <div class="content_flex"><img src="./../../assets/img/dingwei.png" /><p>沃尔玛门店(徐汇店) 888m</p></div>
        <div>
            <a :href="baiduHref" class="content_flex"><img src="./../../assets/img/daohang.png" /><p class="daohang">导航</p></a>
        </div>
    </div>

    //注: 这里只讲述点击导航按钮 如果调用百度地图导航

script

export default {
    data(){
        return {
            baiduHref:'http://api.map.baidu.com/marker?location=31.2503561772,121.3322653843&title=沃尔玛门店&content=即将前往目的地&output=html&src=webapp.baidu.openAPIdemo',
        }
    }
}

// 注: 这里的location是你要去附近最近的门店的目的地,应该是后台接口返回的经纬度。

高德:

    <a href="https://uri.amap.com/marker?position=经度,纬度&name=所在的位置名称">高德地图</a>

百度

    <a href="http://api.map.baidu.com/marker?location=纬度,经度&title=所在位置名称&content=所在位置的简介(可选)&output=html">百度地图</a>

相关文档地址:1 http://lbsyun.baidu.com/index.php?title=uri/api/web

相关文档地址:2 https://www.cnblogs.com/bfc0517/p/8686686.html

猜你喜欢

转载自www.cnblogs.com/wangRong-smile/p/12027366.html
今日推荐