forked from brandonxiang/vueleaflet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Layout.vue
68 lines (59 loc) · 1.27 KB
/
Layout.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<template lang="html">
<div class="full">
<l-map :zoom="zoom" :center="center" :min-zoom="minZoom" :max-zoom="maxZoom"
:attributionControl="attributionControl" :zoomend="zoomend">
<l-tilelayer :url="url" :attribution="attribution"></l-tilelayer>
<l-marker :position="center" :title="title" :opacity="opacity" :draggable="draggable">
<l-tooltip content="a tooltip"></l-tooltip>
</l-marker>
<l-marker :position="marker" :title="title" :opacity="opacity" :draggable="false">
<l-popup content="a popup"></l-popup>
</l-marker>
</l-map>
<!--<l-map id="next">
</l-map>-->
</div>
</template>
<script>
import '../node_modules/leaflet/dist/leaflet.css';
export default {
data() {
return {
zoom: 13,
center: [51.505, -0.09],
marker: [51.500, 0.00],
minZoom: 8,
maxZoom: 15,
url: 'http://{s}.tile.osm.org/{z}/{x}/{y}.png',
attribution: 'vue-leaflet',
title: 'vue-leaflet',
opacity: 1,
draggable: true,
attributionControl: false,
};
},
methods: {
zoomend() {
console.log(1)
}
}
};
</script>
<style lang="css">
.full {
width: 100%;
height: 100%;
}
#map,
#next {
height: 100%;
}
body {
padding: 0;
margin: 0;
}
html,
body {
height: 100%;
}
</style>