File tree 2 files changed +25
-10
lines changed
2 files changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ const props = withDefaults(
28
28
);
29
29
defineEmits <Emits >();
30
30
31
- const { layer } = useLayer (TileLayer , toRefs ({ ... props } ), [
31
+ const { layer } = useLayer (TileLayer , toRefs (props ), [
32
32
" change:useInterimTilesOnError" ,
33
33
" change:preload" ,
34
34
]);
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<form >
3
- <select v-model =" selected" class =" select-default" >
4
- <option value =" https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png" >
5
- OSM
6
- </option >
7
- <option value =" https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}" >
8
- GOOGLE
9
- </option >
10
- </select >
3
+ <fieldset >
4
+ <label for =" opacity-slider" >Layer Opacity</label >
5
+ <input
6
+ type =" range"
7
+ id =" opacity-slider"
8
+ min =" 0"
9
+ max =" 1"
10
+ step =" 0.1"
11
+ v-model.number =" layerOpacity"
12
+ />
13
+ <span class =" description" >{{ layerOpacity }}</span >
14
+ </fieldset >
15
+ <fieldset >
16
+ <select v-model =" selected" class =" select-default" >
17
+ <option value =" https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png" >
18
+ OSM
19
+ </option >
20
+ <option value =" https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}" >
21
+ GOOGLE
22
+ </option >
23
+ </select >
24
+ </fieldset >
11
25
</form >
12
26
{{ selected }}
13
27
<ol-map
22
36
:projection =" projection"
23
37
/>
24
38
25
- <ol-tile-layer >
39
+ <ol-tile-layer :opacity = " layerOpacity " >
26
40
<ol-source-xyz :url =" selected" />
27
41
</ol-tile-layer >
28
42
</ol-map >
@@ -35,4 +49,5 @@ const center = ref([40, 40]);
35
49
const projection = ref (" EPSG:4326" );
36
50
const zoom = ref (8 );
37
51
const selected = ref (" https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png" );
52
+ const layerOpacity = ref (1 );
38
53
</script >
You can’t perform that action at this time.
0 commit comments