47 lines
862 B
Vue
47 lines
862 B
Vue
<template>
|
|
<view class="mapView">
|
|
<map id="myMap" :longitude="longitude" :latitude="latitude" :markers="markers" class="map" show-location></map>
|
|
</view>
|
|
</template>
|
|
<script>
|
|
export default {
|
|
name: "map",
|
|
data(){
|
|
return {
|
|
longitude:'',
|
|
latitude:'',
|
|
markers:{},// 标点
|
|
id:''
|
|
}
|
|
},
|
|
onLoad(query){
|
|
console.log('query',query)
|
|
this.longitude = query.longitude
|
|
this.latitude = query.latitude
|
|
this.id=query.id
|
|
let markers = []
|
|
markers.push({
|
|
// iconPath: 'https://eshangtech.com/ShopICO/ahyd-BID/service/health.svg',
|
|
id: this.id,
|
|
latitude: this.latitude,
|
|
longitude: this.longitude
|
|
})
|
|
// }
|
|
this.markers = markers
|
|
}
|
|
}
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
.mapView{
|
|
width: 100vw;
|
|
height: 100vh;
|
|
.map{
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
</style>
|