File tree 5 files changed +87
-3
lines changed
5 files changed +87
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue3-openlayers" ,
3
- "version" : " 0.1.48 " ,
3
+ "version" : " 0.1.49 " ,
4
4
"description" : " Openlayers Wrapper for Vue3" ,
5
5
"repository" : {
6
6
"type" : " git" ,
Original file line number Diff line number Diff line change 7
7
8
8
<ol-layerswitcherimage-control />
9
9
10
+ <ol-zone-control :zones =" zones" :projection =" projection" :layer =" jawgLayer.tileLayer" v-if =" jawgLayer != null" >
11
+
12
+ </ol-zone-control >
13
+
10
14
<ol-tile-layer ref =" osmLayer" title =" OSM" >
11
15
<ol-source-osm />
12
16
</ol-tile-layer >
@@ -326,6 +330,18 @@ export default {
326
330
327
331
});
328
332
333
+ const zones = [{
334
+ title: " Turkey" ,
335
+ extent: [17.952 ,46.241 ,52.449 ,31.222 ]
336
+ },
337
+ {
338
+ title: " Cyprus" ,
339
+ extent: [31.2836 ,36.1623 ,35.5957 ,34.1823 ]
340
+ }, {
341
+ title: " Brazil" ,
342
+ extent: [- 120.32 ,22.76 ,17.67 ,- 47.52 ]
343
+ }]
344
+
329
345
return {
330
346
331
347
center,
@@ -358,7 +374,8 @@ export default {
358
374
starIcon,
359
375
changeDrawType,
360
376
path,
361
- animationPath
377
+ animationPath,
378
+ zones
362
379
}
363
380
},
364
381
}
Original file line number Diff line number Diff line change 40
40
41
41
.ol-collapsed : hover {
42
42
background-color : rgba (255 , 255 , 255 , 0 );
43
+ }
44
+
45
+ .ol-control .ol-mapzone {
46
+ top : 12.5em !important ;
47
+ }
48
+
49
+ .ol-control .ol-mapzone button {
50
+
51
+ margin-top : 0em !important ;
52
+ }
53
+
54
+ .ol-layerswitcher-image button {
55
+ background-color : transparent !important ;
56
+ }
57
+
58
+ .ol-mapzone > div p {
59
+ background-color : black !important ;
43
60
}
Original file line number Diff line number Diff line change
1
+ <template lang="">
2
+ <div v-if =" false" >
3
+
4
+ </div >
5
+ </template >
6
+
7
+ <script >
8
+ import Zone from ' ol-ext/control/MapZone' ;
9
+ import useControl from ' @/composables/useControl'
10
+
11
+ export default {
12
+ name: ' ol-zone-control' ,
13
+ setup (props ,context ) {
14
+ const {
15
+ control
16
+ } = useControl (Zone, props,context);
17
+ return {
18
+ control
19
+ }
20
+
21
+ },
22
+ props: {
23
+ className: {
24
+ type: String ,
25
+ },
26
+ zones: {
27
+ type: Array ,
28
+ },
29
+ layer: {
30
+ type: [Object ,Function ],
31
+ },
32
+ projection: {
33
+ type: String ,
34
+ default: ' EPSG:3857'
35
+ },
36
+ centerOnClick: {
37
+ type: Boolean ,
38
+ default: true
39
+ },
40
+
41
+ }
42
+ }
43
+ </script >
44
+
45
+ <style lang="">
46
+
47
+ </style >
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import PrintDialog from './PrintDialog.vue'
15
15
import VideoRecorderControl from './VideoRecorderControl.vue'
16
16
import LayerSwitcherControl from './LayerSwitcherControl.vue'
17
17
import LayerSwitcherImageControl from './LayerSwitcherImageControl.vue'
18
+ import ZoneControl from './ZoneControl.vue'
18
19
function install ( app ) {
19
20
20
21
if ( install . installed ) {
@@ -40,6 +41,7 @@ function install (app) {
40
41
app . component ( VideoRecorderControl . name , VideoRecorderControl )
41
42
app . component ( LayerSwitcherControl . name , LayerSwitcherControl )
42
43
app . component ( LayerSwitcherImageControl . name , LayerSwitcherImageControl )
44
+ app . component ( ZoneControl . name , ZoneControl )
43
45
}
44
46
45
47
export default install
@@ -61,5 +63,6 @@ function install (app) {
61
63
PrintDialog ,
62
64
VideoRecorderControl ,
63
65
LayerSwitcherControl ,
64
- LayerSwitcherImageControl
66
+ LayerSwitcherImageControl ,
67
+ ZoneControl
65
68
}
You can’t perform that action at this time.
0 commit comments