Commit c1186b6f authored by 黄媛媛's avatar 黄媛媛

修改酒店地图

parent 76180d54
......@@ -114,12 +114,12 @@
</div>
<div style="padding:20px">
<div class="f12">
<div style="margin-bottom:20px">
<div style="margin-bottom:20px;line-height:2">
{{dataDetail.prod_desc}}
</div>
<p class="f14 pfR" style="color:#000000;margin-bottom:15px" v-if="dataDetail.tour_list.length>0">行程列表</p>
<div v-for="(item,index) in dataDetail.tour_list" :key="index+100">
<p>{{item.tour_day}}</p>
<p style="margin-top:10px">{{item.tour_day}}</p>
<p style="padding:8px 0">说明{{item.tour_desc}}</p>
<div v-if="item.photo_url&&item.photo_url!=''">
<img style="width:100%;height: auto;display:block" :src="item.photo_url" alt="">
......
......@@ -67,17 +67,41 @@
},
// 地图实例
mapBuild(){
let lat = parseFloat(this.dataList[0].lat)
let lng = parseFloat(this.dataList[0].lng)
let center = {lng: lng, lat: lat}
//创建地图实例,zoom是缩放比例
this.map = new google.maps.Map(document.getElementById('map_canvas'), {
zoom: 7,
center: center,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
this.directionsDisplay.setMap(this.map);
this.calcRoute()
if(this.dataList.length>1){
let lat = parseFloat(this.dataList[0].lat)
let lng = parseFloat(this.dataList[0].lng)
let center = {lng: lng, lat: lat}
//创建地图实例,zoom是缩放比例
this.map = new google.maps.Map(document.getElementById('map_canvas'), {
zoom: 7,
center: center,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
this.directionsDisplay.setMap(this.map);
this.calcRoute()
}
else{
this.ptcenter = {
        lat: parseFloat(this.dataList[0].lat),
        lng: parseFloat(this.dataList[0].lng)
      }
this.ptstart = {
lat: parseFloat(this.dataList[0].lat),
        lng: parseFloat(this.dataList[0].lng)
}
      this.map = new google.maps.Map(document.getElementById('map_canvas'), {
        center: this.ptcenter,
        zoom: 15,
        mapTypeId: google.maps.MapTypeId.ROADMAP
      })
var markerStart = new google.maps.Marker({
position: this.ptstart
})
markerStart.setMap(this.map)
}
},
calcRoute: function() { // 创建路径规划
// 分解数据 获得起 止 以及中间数据
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment