| | |
| | | <cover-view v-for="(item,index) in markers" :key="index"> |
| | | <cover-view class="customCallout" :marker-id="item.id"> |
| | | <cover-image class="image" src="@/static/icon/ic_dingwei@2x.png" mode="widthFix"></cover-image> |
| | | <cover-view class="mm">{{rice * 1000}}米</cover-view> |
| | | <cover-view class="mm">{{rice > 1000 ? (rice / 1000).toFixed(1) + '千米' : rice + '米'}}</cover-view> |
| | | <cover-view class="h"></cover-view> |
| | | <cover-view class="dh">导航</cover-view> |
| | | </cover-view> |
| | |
| | | <view class="ditu_box"> |
| | | <view class="ditu_box_a"> |
| | | <text>{{info.title}}</text> |
| | | <text>距离{{rice * 1000}}m</text> |
| | | <text>距离{{rice > 1000 ? (rice / 1000).toFixed(1) + '千米' : rice + '米'}}</text> |
| | | </view> |
| | | <view class="ditu_box_b"> |
| | | {{info.addr}} |
| | |
| | | if (res.code === 200) { |
| | | this.markers = [] |
| | | res.data.forEach((item, index) => { |
| | | let num = distance(this.latitude, this.longitude, item.latitude, item.longitude) |
| | | this.markers.push({ |
| | | id: index, |
| | | width: 40, |
| | | height: 40, |
| | | distance: this.latitude && this.longitude ? distance(this.latitude, this.longitude, item.latitude, item.longitude) : '未知距离', |
| | | distance: this.latitude && this.longitude ? num : '未知距离', |
| | | latitude: item.latitude, |
| | | longitude: item.longitude, |
| | | title: item.name, |