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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM