<!-- 地图 -->
<map id="myMap" hidden="{{!showMap}}" show-location polyline="{{polyline}}" markers="{{markers}}" bindcontroltap="bindcontroltap" longitude="{{longitude}}" latitude="{{latitude}}"></map>

<view class="container">
  <view class="current-item">
    <view class="wrap">
      <view class="myPosition"><view class="t">起点</view>{{sname}}</view>
      <view class="address" style="padding-bottom:15rpx;">{{saddress}}</view>
      <view class="name"><view class="t">终点</view>{{name}}</view>
      <view class="address">{{address}}</view>
    </view>
    <!-- 方案 -->
    <view class="navType">
      <view class="navType-item {{indexCurrent==index?'navType-sel':''}}" data-idx="{{index}}" bindtap="changeNavType" wx:for="{{navType}}" wx:key='index'>
        <image class="navType-icon" src="{{item.icon}}" mode="widthFix"></image>
        <view class="navType-name">{{item.name}}</view>
      </view>
    </view>
  </view>

  <!-- 其他路线详情 -->
  <view class="navType-detail" hidden="{{!showDetail}}">
    <view class="navType-detail-title">
      <image src="../../images/gdmap/tip.png" mode="widthFix"></image> 路线详情</view>
    <view class="navType-title">
      <text wx:if="{{distance}}">全程约{{distance}}</text>
      <text wx:if="{{lights}}">，途径{{lights}}个路口/红绿灯</text>
      <text wx:if="{{duration}}">，预计{{duration}}到达</text>
      <text wx:if="{{cost}}">，打车约{{cost}}元</text>。
    </view>
    <view class="navType-detail-wrap">
      <view class="navType-detail-item start">从 {{sname}} 出发</view>
      <view class="navType-detail-item" wx:for="{{info.paths[0].steps}}" wx:key='index'>
        {{item.road}}
        <text>{{item.instruction}}</text>
      </view>
      <view class="navType-detail-item end">到达 {{name}}</view>
    </view>
  </view>

</view>

<!-- 公交路线 -->
<view class="transfer-list" hidden='{{!showBusPaths || transits.length == 0}}'>
  <view class="transfer-item" wx:for="{{transits}}" wx:key='index'>
    <view class="transfer-transport">
      <block wx:for="{{item.transport}}" wx:for-item="sport" wx:key='index'>{{sport}}</block>
    </view>
    <view class="route-info">
      约{{item.distance}} · {{item.duration}} ·
      <text wx:if="{{item.walking_distance.length>1}}">步行{{item.walking_distance}}</text>
      <text wx:if="{{item.cost != null}}"> · {{item.cost}}元</text>
    </view>
  </view>
</view>

<view hidden="{{showDetail || !showBusPaths || transits.length!=0}}" class="tip">
  暂无公交路线
</view>

<view style="height:200rpx;"></view>

<view class="bottom-bar" hidden='{{!showBusPaths || transits.length == 0}}'>
  <button class="navTap" bindtap="transferOpts">出行方案</button>
</view>

<view class="bottom-bar" hidden='{{!showNav}}'>
  <button class="navTap" bindtap="showNav">导航</button>
</view>
