微信小程序之地圖功能(map)實戰(zhàn)教程。本文主要介紹微信小程序中的地圖模塊相關(guān)功能。
地圖組件使用起來也很簡單。
.wxml
<map id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="14" controls="{{controls}}" bindcontroltap="controltap" markers="{{markers}}" bindmarkertap="markertap" polyline="{{polyline}}" circles="{{circles}}" bindregionchange="regionchange" show-location > </map>
除了顯示基本地圖,還可以在地圖上添加markers–標(biāo)注,polyline–折線,circles–圓形,controls–控件。
data: { // markers: [{ iconPath: "../../img/marker_red.png", id: 0, latitude: 40.002607, longitude: 116.487847, width: 35, height: 45 }], ... //省略代碼 }
在data中定義markers變量來表示覆蓋物
然后map控件引入即可:
<map id="map" longitude="{{longitude}}" markers="{{markers}}" ...//省略代碼> </map>
data: { // polyline: [{ points: [{ longitude: '116.481451', latitude: '40.006822' }, { longitude: '116.487847', latitude: '40.002607' }, { longitude: '116.496507', latitude: '40.006103' }], color: "#FF0000DD", width: 3, dottedLine: true }], ... //省略代碼 } ?<map id="map" longitude="{{longitude}}" latitude="{{latitude}}" polyline="{{polyline}}" >
data: { // circles: [{ latitude: '40.007153', longitude: '116.491081', color: '#FF0000DD', fillColor: '#7cb5ec88', radius: 400, strokeWidth: 2 }], ... //省略代碼 }
KESION 科汛軟件
KESION 科汛軟件是國內(nèi)領(lǐng)先的在線教育軟件及私域社交電商軟件服務(wù)提供商,長期專注于為企業(yè)提供在線教育軟件及社交電商SaaS平臺解決方案。
公司核心產(chǎn)品云開店SaaS社交電商服務(wù)平臺、在線教育SaaS服務(wù)平臺、教育企業(yè)數(shù)字化SaaS云平臺、企微營銷助手、私有化獨立部署品牌網(wǎng)校和在線教育咨詢等。KESION 不斷通過技術(shù)創(chuàng)新,提供產(chǎn)品和服務(wù),助力企業(yè)向數(shù)字化轉(zhuǎn)型,通過科技驅(qū)動商業(yè)革新,讓商業(yè)變得更智慧!
我們在進(jìn)入小程序時,會有一個彈窗是獲取你的信息授權(quán),那么小程序是如何獲取用戶信息的,下面從開發(fā)者角度出發(fā)說說小程序是如何獲取用戶信息的?...
自從2017年微信小程序的上線,許多商家都已經(jīng)開始研究微信小程序如何來經(jīng)營店面生意,維護(hù)客戶了,從而小程序商家也越來越多,于是微信開發(fā)了附近的小程序新功能,方便在最短...