| | |
| | | <script> |
| | | |
| | | export default { |
| | | props:["longitude","latitude"], |
| | | data () { |
| | | return { |
| | | map: "", |
| | |
| | | }, |
| | | mounted () { |
| | | let that = this |
| | | this.lng = 115.89886924863 |
| | | this.lat = 28.6780931500551 |
| | | |
| | | // this.lng = 115.89886924863 |
| | | // this.lat = 28.6780931500551 |
| | | this.lng = this.longitude |
| | | this.lat = this.latitude |
| | | this.initDate() |
| | | |
| | | this.map.pm.addControls({ |
| | |
| | | } |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * 地图初始化 |
| | | */ |
| | | initDate () { |
| | | this.map = this.$L.map("map", { |
| | | center: [this.lat, this.lng], // 地图中心 |
| | | zoom: 10, //缩放比列 |
| | | zoom: 15, //缩放比列 |
| | | zoomControl: false, //禁用 + - 按钮 |
| | | doubleClickZoom: false, // 禁用双击放大 |
| | | attributionControl: false // 移除右下角leaflet标识 |
| | |
| | | height: 100vh; |
| | | z-index: 1; |
| | | } |
| | | </style> |
| | | </style> |