File tree Expand file tree Collapse file tree 2 files changed +25
-10
lines changed Expand file tree Collapse file tree 2 files changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ const props = withDefaults(
2828);
2929defineEmits <Emits >();
3030
31- const { layer } = useLayer (TileLayer , toRefs ({ ... props } ), [
31+ const { layer } = useLayer (TileLayer , toRefs (props ), [
3232 " change:useInterimTilesOnError" ,
3333 " change:preload" ,
3434]);
Original file line number Diff line number Diff line change 11<template >
22 <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 >
1125 </form >
1226 {{ selected }}
1327 <ol-map
2236 :projection =" projection"
2337 />
2438
25- <ol-tile-layer >
39+ <ol-tile-layer :opacity = " layerOpacity " >
2640 <ol-source-xyz :url =" selected" />
2741 </ol-tile-layer >
2842 </ol-map >
@@ -35,4 +49,5 @@ const center = ref([40, 40]);
3549const projection = ref (" EPSG:4326" );
3650const zoom = ref (8 );
3751const selected = ref (" https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png" );
52+ const layerOpacity = ref (1 );
3853 </script >
You can’t perform that action at this time.
0 commit comments