Commit 677b47ca authored by youjie's avatar youjie

no message

parent ee722422
......@@ -54,7 +54,8 @@
</div>
</div>
<div class="hotelDetails-Map">
<div :style="{height:'100%',width:'100%'}" id="mapContainer"></div>
<Map :obj="h"></Map>
<!-- <div :style="{height:'100%',width:'100%'}" id="mapContainer"></div> -->
</div>
</div>
<div class="hotelDetails-prompt">
......@@ -79,7 +80,9 @@
</div>
</template>
<script>
import Map from "../../../public/echoMap.vue";
export default {
components: { Map },
props: {
hotelId: {
type: Number,
......
......@@ -60,7 +60,8 @@
</div>
</div>
<div class="hotelDetails-Map">
<div :style="{height:'100%',width:'100%'}" :id="`mapContainer_${detailsObj.Id}`"></div>
<Map :obj="t"></Map>
<!-- <div :style="{height:'100%',width:'100%'}" :id="`mapContainer_${detailsObj.Id}`"></div> -->
</div>
</div>
<div class="hotelDetails-prompt">
......@@ -100,8 +101,10 @@
</div>
</template>
<script>
import Map from "../../../public/echoMap.vue";
export default {
props: ['detailsObj'],
components: { Map },
data() {
return {
map: null,
......
......@@ -982,7 +982,7 @@
</div>
</template>
<script>
import Map from "./components/Map.vue";
import Map from "../../public/Map.vue";
import DMCchooseImg from "../../commonPage/DMCchooseImg.vue";
export default {
components: {
......
<template>
<div>
<baidu-map v-bind:style="mapStyle" class="bm-view"
ak="L5Qw0GlbbCIMwgR4Uug3ogM40Imkd3CV"
:center="center" :zoom="zoom" :scroll-wheel-zoom="true"
@click="getClickInfo" @moving="syncCenterAndZoom" @moveend="syncCenterAndZoom" @zoomend="syncCenterAndZoom">
<bm-view style="width: 100%; height:400px;"></bm-view>
<bm-marker :position="{lng: center.lng, lat: center.lat}"
:dragging="true"
animation="BMAP_ANIMATION_BOUNCE">
</bm-marker>
<bm-control :offset="{width: '10px', height: '10px'}">
<bm-auto-complete v-model="keyword" :sugStyle="{zIndex: 999999}">
<input v-model="keyword" type="text" placeholder="请输入搜索关键字" class="serachinput">
</bm-auto-complete>
<button class="normalBtn" type="primary" @click="determineLngLat">
确定
</button>
</bm-control>
<bm-local-search :keyword="keyword" :auto-viewport="true"
style="width:0px;height:0px;overflow: hidden;"></bm-local-search>
</baidu-map>
</div>
</template>
<script>
import {BaiduMap, BmControl,
BmView, BmAutoComplete,
BmLocalSearch, BmMarker} from 'vue-baidu-map'
export default {
props: ["Address", "id", "type", "index"],
components: {
BaiduMap,
BmControl,
BmView,
BmAutoComplete,
BmLocalSearch,
BmMarker
},
data() {
return {
keyword: '',
mapStyle: {
width: '100%',
height: '100%'
},
center: {lng: 116.404, lat: 39.915},
zoom: 15,
}
},
watch: {
Address: {
handler(newValue,onldValue) {
this.keyword = newValue
},
immediate: true
},
},
mounted() {
this.keyword = this.Address
},
methods: {
getClickInfo (e) {
let that= this
var gc = new BMap.Geocoder();
gc.getLocation(e.point, function (rs) {
if(rs.addressComponents){
var addComp = rs.addressComponents;
let address_detail = addComp.province + addComp.city + addComp.district + addComp.street + addComp.streetNumber
that.keyword = address_detail
}
})
this.center.lng = e.point.lng
this.center.lat = e.point.lat
},
syncCenterAndZoom (e) {
const {lng, lat} = e.target.getCenter()
this.center.lng = lng
this.center.lat = lat
this.zoom = e.target.getZoom()
},
// 经纬度
determineLngLat(){
if(this.center.lng){
this.$emit("headCallBack", this.center, this.type, this.index, this.keyword);
this.$emit("refList");
}else{
this.Error("请搜索您需要选择的地址");
}
},
}
}
</script>
<style scoped>
.serachinput{
margin-left: 10px;
margin-top: 10px;
width: 350px;
height: 30px;
margin-right: 10px;
}
</style>
\ No newline at end of file
<template>
<div>
<baidu-map v-bind:style="mapStyle" class="bm-view"
ak="L5Qw0GlbbCIMwgR4Uug3ogM40Imkd3CV"
:center="center" :zoom="zoom" :scroll-wheel-zoom="true"
@click="getClickInfo" @moving="syncCenterAndZoom" @moveend="syncCenterAndZoom" @zoomend="syncCenterAndZoom">
<bm-view style="width: 100%; height:400px;"></bm-view>
<bm-marker :position="{lng: center.lng, lat: center.lat}"
:dragging="true"
animation="BMAP_ANIMATION_BOUNCE">
</bm-marker>
<bm-control :offset="{width: '10px', height: '10px'}">
<bm-auto-complete v-model="keyword" :sugStyle="{zIndex: 999999}">
<input v-model="keyword" type="text" placeholder="请输入搜索关键字" class="serachinput">
</bm-auto-complete>
<button class="normalBtn" type="primary" @click="determineLngLat">
确定
</button>
</bm-control>
<bm-local-search :keyword="keyword" :auto-viewport="true"
style="width:0px;height:0px;overflow: hidden;"></bm-local-search>
</baidu-map>
</div>
</template>
<script>
import {BaiduMap, BmControl,
BmView, BmAutoComplete,
BmLocalSearch, BmMarker} from 'vue-baidu-map'
export default {
props: ["Address", "id", "type", "index"],
components: {
BaiduMap,
BmControl,
BmView,
BmAutoComplete,
BmLocalSearch,
BmMarker
},
data() {
return {
keyword: '',
mapStyle: {
width: '100%',
height: '100%'
},
center: {lng: 116.404, lat: 39.915},
zoom: 15,
}
},
watch: {
Address: {
handler(newValue,onldValue) {
this.keyword = newValue
},
immediate: true
},
},
mounted() {
this.keyword = this.Address
},
methods: {
getClickInfo (e) {
let that= this
var gc = new BMap.Geocoder();
gc.getLocation(e.point, function (rs) {
if(rs.addressComponents){
var addComp = rs.addressComponents;
let address_detail = addComp.province + addComp.city + addComp.district + addComp.street + addComp.streetNumber
that.keyword = address_detail
}
})
this.center.lng = e.point.lng
this.center.lat = e.point.lat
},
syncCenterAndZoom (e) {
const {lng, lat} = e.target.getCenter()
this.center.lng = lng
this.center.lat = lat
this.zoom = e.target.getZoom()
},
// 经纬度
determineLngLat(){
if(this.center.lng){
this.$emit("headCallBack", this.center, this.type, this.index, this.keyword);
this.$emit("refList");
}else{
this.Error("请搜索您需要选择的地址");
}
},
}
}
</script>
<style scoped>
.serachinput{
margin-left: 10px;
margin-top: 10px;
width: 350px;
height: 30px;
margin-right: 10px;
}
</style>
\ No newline at end of file
<template>
<div>
<baidu-map v-bind:style="mapStyle" class="bm-view"
ak="L5Qw0GlbbCIMwgR4Uug3ogM40Imkd3CV"
:center="center" :zoom="zoom" :scroll-wheel-zoom="true"
@click="getClickInfo" @moving="syncCenterAndZoom" @moveend="syncCenterAndZoom" @zoomend="syncCenterAndZoom">
<bm-view style="width: 100%; height:400px;"></bm-view>
<bm-marker :position="{lng: center.lng, lat: center.lat}"
:dragging="true"
animation="BMAP_ANIMATION_BOUNCE">
</bm-marker>
<bm-local-search :keyword="keyword" :auto-viewport="true"
style="width:0px;height:0px;overflow: hidden;"></bm-local-search>
</baidu-map>
</div>
</template>
<script>
import {BaiduMap, BmControl,
BmView, BmAutoComplete,
BmLocalSearch, BmMarker} from 'vue-baidu-map'
export default {
props: ["obj"],
components: {
BaiduMap,
BmControl,
BmView,
BmAutoComplete,
BmLocalSearch,
BmMarker
},
data() {
return {
keyword: '',
mapStyle: {
width: '100%',
height: '100%'
},
center: {lng: 116.404, lat: 39.915},
zoom: 15,
}
},
watch: {
obj: {
handler(newValue,onldValue) {
this.center.lng = newValue.PlaceList[0].Lng
this.center.lat = newValue.PlaceList[0].Lat
},
immediate: true
},
},
mounted() {
this.center.lng = this.obj.PlaceList[0].Lng
this.center.lat = this.obj.PlaceList[0].Lat
this.keyword = this.obj.PlaceList[0].Address
},
methods: {
getClickInfo (e) {
let that= this
var gc = new BMap.Geocoder();
gc.getLocation(e.point, function (rs) {
if(rs.addressComponents){
var addComp = rs.addressComponents;
let address_detail = addComp.province + addComp.city + addComp.district + addComp.street + addComp.streetNumber
that.keyword = address_detail
}
})
this.center.lng = e.point.lng
this.center.lat = e.point.lat
},
syncCenterAndZoom (e) {
const {lng, lat} = e.target.getCenter()
this.center.lng = lng
this.center.lat = lat
this.zoom = e.target.getZoom()
},
// 经纬度
determineLngLat(){
return
if(this.center.lng){
this.$emit("headCallBack", this.center, this.type, this.index, this.keyword);
this.$emit("refList");
}else{
this.Error("请搜索您需要选择的地址");
}
},
}
}
</script>
<style scoped>
.serachinput{
margin-left: 10px;
margin-top: 10px;
width: 350px;
height: 30px;
margin-right: 10px;
}
</style>
\ No newline at end of file
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