File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,34 @@ Other events that emit [`ol.MapEvent`](http://openlayers.org/en/latest/apidoc/mo
76
76
77
77
## Methods
78
78
79
+ You have access to all Methods from the underlying source.
80
+ Check out [ the official OpenLayers docs] ( https://openlayers.org/en/latest/apidoc/module-ol_Map.html ) to see the available methods.
81
+
82
+ To access the source, you can use a ` ref() ` as shown below:
83
+
84
+ ``` vue
85
+ <template>
86
+ <ol-map ref="mapRef">
87
+ <!-- ... -->
88
+ </ol-map>
89
+ </template>
90
+
91
+ <script setup lang="ts">
92
+ import { ref, onMounted } from "vue";
93
+ import type Map from "ol/Map";
94
+
95
+ const mapRef = ref<{ map: Map }>(null);
96
+
97
+ onMounted(() => {
98
+ const map: Map = mapRef.value?.map;
99
+ // call your method on `map`
100
+ const size = map.getSize();
101
+ });
102
+ </script>
103
+ ```
104
+
105
+ Furthermore the following methods are directly exposed and can be use as describe above, using a ` ref="" ` .
106
+
79
107
### focus()
80
108
81
109
Triggers focus on map container.
You can’t perform that action at this time.
0 commit comments