-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathbasemap.vue
More file actions
37 lines (34 loc) · 734 Bytes
/
basemap.vue
File metadata and controls
37 lines (34 loc) · 734 Bytes
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
<template>
<div id="map"></div>
</template>
<script>
import Map from 'ol/Map';
import View from 'ol/View';
import TileLayer from 'ol/layer/Tile';
import XYZ from 'ol/source/XYZ';
import 'ol/ol.css';
export default {
mounted() {
new Map({
target: 'map',
layers: [
new TileLayer({
source: new XYZ({
url: 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png'
})
})
],
view: new View({
projection: 'EPSG:4326',
center: [105, 36],
zoom: 4
})
});
}
}
</script>
<style>
#map {
height: 100%;
}
</style>