-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathapp.vue
51 lines (46 loc) · 956 Bytes
/
app.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
<template>
<div class="example">
<l-map
:zoom="initialZoom"
:center="initialLocation">
<l-protobuf
:url="tilesUrl"
:options="opts"/>
</l-map>
</div>
</template>
<script>
import L from 'leaflet'
import { LMap } from 'vue2-leaflet'
import LProtobuf from '../Vue2LeafletVectorGridProtobuf'
import vectorStyle from './style'
const vectorTileOptions = {
attribution: '© ESRI',
vectorTileLayerStyles: vectorStyle,
}
export default {
components: {
LMap,
LProtobuf
},
data () {
return {
initialLocation: L.latLng(0, 0),
initialZoom: 2,
opts: vectorTileOptions,
tilesUrl: "https://basemaps.arcgis.com/v1/arcgis/rest/services/World_Basemap/VectorTileServer/tile/{z}/{y}/{x}.pbf"
}
}
}
</script>
<style>
@import "https://unpkg.com/[email protected]/dist/leaflet.css";
html, body {
margin: 0;
height: 100%;
}
.example {
height: 100%;
width: 100%;
}
</style>