做爰高潮a片〈毛片〉,尤物av天堂一区二区在线观看,一本久久A久久精品VR综合,添女人荫蒂全部过程av

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當前位置: 首頁 - 科技 - 知識百科 - 正文

微信小程序map組件結(jié)合高德地圖API實現(xiàn)wx.chooseLocation功能示例

來源:懂視網(wǎng) 責編:小采 時間:2020-11-27 22:01:38
文檔

微信小程序map組件結(jié)合高德地圖API實現(xiàn)wx.chooseLocation功能示例

微信小程序map組件結(jié)合高德地圖API實現(xiàn)wx.chooseLocation功能示例:本文實例講述了微信小程序map組件結(jié)合高德地圖API實現(xiàn)wx.chooseLocation功能。分享給大家供大家參考,具體如下: 聲明 bug: 頁面搜索返回的列表在真機測試是會出現(xiàn)不顯示問題? 造成原因:在小程序map組件的同一區(qū)域,map組件的視圖層比普通的文本視圖層
推薦度:
導讀微信小程序map組件結(jié)合高德地圖API實現(xiàn)wx.chooseLocation功能示例:本文實例講述了微信小程序map組件結(jié)合高德地圖API實現(xiàn)wx.chooseLocation功能。分享給大家供大家參考,具體如下: 聲明 bug: 頁面搜索返回的列表在真機測試是會出現(xiàn)不顯示問題? 造成原因:在小程序map組件的同一區(qū)域,map組件的視圖層比普通的文本視圖層

WXML

<view class="map-inputtips-input">
 <input bindinput="bindInput" placeholder="搜索" focus="true" />
</view>
<view class="map_container">
 <map class="map" latitude='{{latitude}}' longitude='{{longitude}}' markers='{{markers}}'>
 <cover-view class="map-search-list {{isShow ? '' : 'map-hide'}}">
 <cover-view bindtouchstart="bindSearch" wx:key="searchId" data-keywords="{{item.name}}" data-location="{{item.location}}" class="map-box" wx:for="{{tips}}">
 {{item.name}}
 </cover-view>
 </cover-view>
 </map>
</view>

WXSS

.map-inputtips-input{
 height: 80rpx;
 line-height: 80rpx;
 width: 100%;
 box-sizing: border-box;
 font-size: 30rpx;
 padding: 0 10px;
 background-color: #fff;
 position: fixed;
 top: 0;
 left: 0;
 z-index: 1000;
 border-bottom:1px solid #c3c3c3;
}
.map-inputtips-input input{
 border: 1px solid #ddd;
 border-radius: 5px;
 height: 60rpx;
 line-height: 60rpx;
 width: 100%;
 box-sizing: border-box;
 padding: 0 5px;
 margin-top: 10rpx;
}
.map-box{
 margin: 0 10px;
 border-bottom:1px solid #c3c3c3;
 height: 80rpx;
 line-height: 80rpx;
}
.map-box:last-child{border: none;}
.map-search-list{
 position: fixed;
 top: 80rpx;
 left: 0;
 width: 100%;
 z-index: 1000;
 background-color: #fff;
}

JS

const app = getApp();
const amap = app.data.amap;
const key = app.data.key;
Page({
 data: {
 isShow: false,
 tips: {},
 longitude: '',
 latitude: '',
 markers: []
 },
 onLoad() {
 var _this = this;
 wx.getLocation({
 success: function(res) {
 if (res && res.longitude){
 _this.setData({
 longitude: res.longitude,
 latitude: res.latitude,
 markers:[{
 id:0,
 longitude: res.longitude,
 latitude: res.latitude,
 iconPath: '../../src/images/ding.png',
 width:32,
 height:32
 }]
 })
 }
 }
 })
 },
 bindInput: function (e) {
 var _this = this;
 var keywords = e.detail.value;
 var myAmap = new amap.AMapWX({ key: key });
 myAmap.getInputtips({
 keywords: keywords,
 location: '',
 success: function (res) {
 if (res && res.tips) {
 _this.setData({
 isShow: true,
 tips: res.tips
 });
 }
 }
 })
 },
 bindSearch: function (e) {
 var keywords = e.target.dataset.keywords;
 var location = e.target.dataset.location.split(',');
 this.setData({
 isShow: false,
 longitude: location[0],
 latitude: location[1],
 markers: [{
 id: 0,
 longitude: location[0],
 latitude: location[1],
 iconPath: '../../src/images/ding.png',
 width: 32,
 height: 32,
 anchor: { x: .5, y: 1 },
 label: {
 content: keywords,
 color: 'blue',
 fontSize: 12,
 borderRadius: 5,
 bgColor: '#fff',
 padding: 3,
 x: 0,
 y: -50,
 textAlign: 'center'
 }
 }]
 })
 }
})

總結(jié)

1. 輸入框事件獲取關(guān)鍵字,通過關(guān)鍵字獲取展示列表;

2. 列表選擇事件,獲取對應的location,并通過map組件的 markers 屬性標記該坐標。

希望本文所述對大家微信小程序開發(fā)有所幫助。

聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

微信小程序map組件結(jié)合高德地圖API實現(xiàn)wx.chooseLocation功能示例

微信小程序map組件結(jié)合高德地圖API實現(xiàn)wx.chooseLocation功能示例:本文實例講述了微信小程序map組件結(jié)合高德地圖API實現(xiàn)wx.chooseLocation功能。分享給大家供大家參考,具體如下: 聲明 bug: 頁面搜索返回的列表在真機測試是會出現(xiàn)不顯示問題? 造成原因:在小程序map組件的同一區(qū)域,map組件的視圖層比普通的文本視圖層
推薦度:
  • 熱門焦點

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 赤壁市| 成安县| 天峻县| 大庆市| 鹤岗市| 页游| 三亚市| 宜兴市| 黔西县| 浦江县| 赫章县| 万全县| 松滋市| 武定县| 阿瓦提县| 全南县| 拉孜县| 彭水| 锡林浩特市| 东乡族自治县| 成武县| 达孜县| 阿克陶县| 花莲市| 太白县| 玉溪市| 洛南县| 临泽县| 石渠县| 旺苍县| 上蔡县| 上饶市| 卢龙县| 丹巴县| 东乡县| 黔西| 许昌县| 叶城县| 安丘市| 繁峙县| 扶沟县|