在调用高德javascriptAPI的基础上,修改marker样式,填充内容,处理点击markerClick事件,调用公交、步行、自驾三种路线规则接口。界面从无到有,自己规划界面,但成品美观上过不了企划眼,仍需加油努力才行
<div id="wrap">
<div id="mapDiv"></div><!-- 地图容器 -->
<div id="panel" style="display:none;"></div>
<a href="javascript:void(0);" class="hidden-road-line">关闭路线</a>
<a href="javascript:void(0);" class="show-road-line">显示路线</a>
<a href="javascript:void(0);" class="user-map">显示我的足迹</a>
<a href="javascript:void(0);" class="shop-lists">商家信息</a>
<div class="button-content" style="display:none;" id="roadStyle">
<p style="text-align:right;padding-right:5px;">
<span onClick="closeAddressWindow();">X</span>
</p>
<p class="f18">到这里去</p>
<input type="text" placeholder="请输入起点" id="beginAddress"/>
<br/>
<input type="button" class="button" value="公交" onclick="transfer();"/>
<input type="button" class="button" value="步行" onclick="walking();"/>
<input type="button" class="button" value="自驾" onclick="driving();"/>
</div>
</div>
//初始化地图
var map = new AMap.Map('mapDiv', {
resizeEnable: true,
zoom:11,
center: [113.360975,23.125178]
});
map.setMapStyle('amap://styles/78b63097b9675c8e575c705678348ac4');
//后续数据处理
點(diǎn)擊查看更多內(nèi)容
4人點(diǎn)贊
評(píng)論
評(píng)論
共同學(xué)習(xí),寫(xiě)下你的評(píng)論
評(píng)論加載中...
作者其他優(yōu)質(zhì)文章
正在加載中
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說(shuō)多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開(kāi)微信掃一掃,即可進(jìn)行掃碼打賞哦