-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample.vue
52 lines (48 loc) · 1.31 KB
/
example.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
<template>
<v-map :zoom=14 :center="center">
<v-tilelayer url="http://{s}.tile.osm.org/{z}/{x}/{y}.png"></v-tilelayer>
<v-editablecirclemarker :latLng.sync="ll" :rad="rad" :options="{icon:icon}"></v-editablecirclemarker>
</v-map>
</template>
<script>
import { Vue, Component } from 'vue-property-decorator'
import * as Vue2Leaflet from 'vue2-leaflet'
import Vue2LeafletEditablecirclemarker from './Vue2LeafletEditablecirclemarker'
import iconUrl from 'leaflet/dist/images/marker-icon.png'
import shadowUrl from 'leaflet/dist/images/marker-shadow.png'
const x = -35.15;
const y = -58.2;
let llvar = Vue2Leaflet.L.latLng(x, y)
@Component({
components: {
'v-map': Vue2Leaflet.LMap,
'v-tilelayer': Vue2Leaflet.LTileLayer,
'v-editablecirclemarker': Vue2LeafletEditablecirclemarker
},
})
export default class Map extends Vue {
icon = Vue2Leaflet.L.divIcon({
className: 'markerAB markerA',
popupAnchor: [0, -40]
})
center = Vue2Leaflet.L.latLng(x, y)
rad = 200
get ll() {
return llvar
}
set ll(val) {
console.log('setll', val)
llvar = val
}
mounted () {
setTimeout(()=>this.rad=1000, 3000)
}
}
</script>
<style>
@import "~leaflet/dist/leaflet.css";
html, body {
height: 100%;
margin: 0;
}
</style>