創(chuàng)新互聯(lián)www.cdcxhl.cn八線動(dòng)態(tài)BGP香港云服務(wù)器提供商,新人活動(dòng)買多久送多久,劃算不套路!
這篇文章將為大家詳細(xì)講解有關(guān)微信小程序地圖實(shí)現(xiàn)展示線路的方法,小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。
效果圖:
思路:
1、首先獲取一系列的坐標(biāo)點(diǎn),然后將這些坐標(biāo)從頭到尾鏈接起來(lái)。(參考微信小程序地圖組件polyline屬性)
2、在獲取的坐標(biāo)點(diǎn)上標(biāo)注某一個(gè)位置,實(shí)現(xiàn)打點(diǎn)。(參考微信小程序地圖組件marker屬性 )
3、使用map組件
微信小程序地圖組件api地址
下面直接展示代碼:
wxml:
<view class="page-section page-section-gap"> <!-- longitude="{{longitude}}" latitude="{{latitude}}" scale="16" height: {{view.Height}}px;show-location--> <map class="navi_map" include-points='{{points}}' longitude="{{longitude}}" latitude="{{latitude}}" polyline="{{polyline}}" markers="{{markers}}" bindcallouttap="bindcallouttap" bindmarkertap="markertap" wx:if="{{hasMarkers}}" scale="10" ></map> </view> <view class="maptext" wx:if="{{mapList!=''}}"> <view class="news"> <view wx:if="{{mapList.polylineJson!=null}}">預(yù)計(jì)<text >{{now}}</text>送達(dá)</view> <view class="tishi">由藥店提供配送服務(wù)</view> </view> <view class="phone_box"> <view class="right_box" data-phone="{{mapPhone}}" bindtap="makeCallPhone" wx:if="{{mapPhone!=null}}"> <image src="{{imgUrl}}mapshop_phone.png"></image><view >聯(lián)系商家</view> </view> <view class="left_box" data-deliverhone="{{deliverPhone}}" bindtap="makesCallPhone" wx:if="{{deliverPhone!=null}}"> <image src="{{imgUrl}}map_phone.png"></image><view >聯(lián)系配送員</view> </view> </view> </view>
當(dāng)前題目:微信小程序地圖實(shí)現(xiàn)展示線路的方法-創(chuàng)新互聯(lián)
網(wǎng)頁(yè)鏈接:http://www.chinadenli.net/article12/gsddc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供商城網(wǎng)站、品牌網(wǎng)站設(shè)計(jì)、靜態(tài)網(wǎng)站、外貿(mào)建站、定制開發(fā)、網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容