Browse Source

地图搜索后对焦第一个

shibei
mk 2 years ago
parent
commit
9e9ff3d310
  1. 4
      miniprogram/subpages/knight/pages/knight/stageMap/index.js
  2. 2
      miniprogram/subpages/knight/pages/knight/stageMap/index.wxml

4
miniprogram/subpages/knight/pages/knight/stageMap/index.js

@ -403,7 +403,9 @@ Page({
// visible: true, // visible: true,
searchResult: result, searchResult: result,
markers:result.map(item=>({id:item.id,latitude:item.location.lat,longitude:item.location.lng,width:28,height:32,label:{content:item.stageName,color:'#f00',textAlign:'center'}})), markers:result.map(item=>({id:item.id,latitude:item.location.lat,longitude:item.location.lng,width:28,height:32,label:{content:item.stageName,color:'#f00',textAlign:'center'}})),
contentList:result.map(item=>({stageName:item.stageName,stageDescription:item.stageDescription})) contentList:result.map(item=>({stageName:item.stageName,stageDescription:item.stageDescription})),
'personalInfo.latitude': result[0].location.lat,
'personalInfo.longitude': result[0].location.lng,
}) })
} }
}, },

2
miniprogram/subpages/knight/pages/knight/stageMap/index.wxml

@ -6,7 +6,7 @@
<view class="serchButton" bindtap="goSearch">搜索</view> <view class="serchButton" bindtap="goSearch">搜索</view>
</view> </view>
<view class="mapBox" bindtap="goKnightMap"> <view class="mapBox" bindtap="goKnightMap">
<map id="myMap" bindtap="goKnightMap"longitude="{{personalInfo['longitude']}}" latitude="{{personalInfo['latitude']}}" markers="{{markers}}" scale="12" class="maMap" subkey="YP3BZ-D7EHJ-FUMFR-XC7XU-5IDI7-L2FI6"/> <map id="myMap" bindtap="goKnightMap" longitude="{{personalInfo['longitude']}}" latitude="{{personalInfo['latitude']}}" markers="{{markers}}" scale="12" class="maMap" subkey="YP3BZ-D7EHJ-FUMFR-XC7XU-5IDI7-L2FI6"/>
</view> </view>
<view class="textBox" wx:for="{{contentList}}" > <view class="textBox" wx:for="{{contentList}}" >
<view class="textBoxTitle"><view>{{item.stageName}}</view></view> <view class="textBoxTitle"><view>{{item.stageName}}</view></view>

Loading…
Cancel
Save