-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.vue
49 lines (43 loc) · 1.16 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
<template>
<div>
<l-map
:center="[40.836566,29.514314]"
style="height: 400px; width: 100%"
:zoom="14"
>
<l-tile-layer ref="layerRef" :options="{maxNativeZoom:18,maxZoom:24}" :url="url"></l-tile-layer>
<l-polyline-offset
:lat-lngs="[[40.836566,29.514314],[40.846566,29.524314]]"
color="blue"
:weight="4"
:offset="8"
/>
<l-polyline
:lat-lngs="[[40.836566,29.514314],[40.846566,29.524314]]"
color="red"
/>
</l-map>
</div>
</template>
<script>
import LPolylineOffset from './dist/Vue2LeafletPolylineOffset.js';
import { LMap, LTileLayer, LPolyline } from 'vue2-leaflet';
import { Icon } from 'leaflet';
import 'leaflet/dist/leaflet.css';
// this part resolve an issue where the markers would not appear
delete Icon.Default.prototype._getIconUrl;
export default {
name: 'poly-offset-test',
components: {
LMap,
LPolylineOffset,
LTileLayer,
LPolyline,
},
data: function(){ return{
url: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
}},
}
</script>
<style>
</style>