企業(yè)官網(wǎng)中比較常用需要調(diào)用位置地圖,迅睿CMS有百度地圖插件可以方便調(diào)用,
但有一個(gè)嚴(yán)重缺點(diǎn):就是必須申請(qǐng)百度地圖的KEY密鑰,比較麻煩,而且百度地圖的KEY密鑰是不能商用的,購(gòu)買商用5萬(wàn)/年。
帝云網(wǎng)絡(luò)給大家分享一種無(wú)法KEY密鑰的調(diào)用方法,非常方便。
<iframe src="http://api.map.baidu.com/marker?location=坐標(biāo)值&title=標(biāo)題&content=簡(jiǎn)介&output=html&src=webapp.baidu.openAPIdemo&zoom=17" frameborder="0" width="100%" height="550"></iframe>
如果網(wǎng)站啟用了https模式,即便src填寫:https://api. 可能仍然無(wú)法顯示,一片空白。
那就使用
<iframe src="https://map.baidu.com/@4095283.353738712,19430487,17z/latlng=坐標(biāo)值(反過(guò)來(lái))&title={SITE_NAME}&content=簡(jiǎn)介&autoOpen=true" frameborder="0" width="100%" height="550"></iframe>說(shuō)明:
zoom=17 表示縮放級(jí)別
location=坐標(biāo)值,坐標(biāo)值必須反過(guò)來(lái)填寫,
比如,獲取的坐標(biāo)值如下:

那么就要填寫為:
location=33.307604,119.595109
否則無(wú)法正常顯示。
https://api.map.baidu.com/lbsapi/getpoint/index.html

移動(dòng)端效果:
