diff --git a/app-starter/components/SampleModule.vue b/app-starter/components/SampleModule.vue
index 67836f08..95072024 100644
--- a/app-starter/components/SampleModule.vue
+++ b/app-starter/components/SampleModule.vue
@@ -30,7 +30,8 @@
// the module card is a the template for a typical Wegue module
import ModuleCard from '../../src/components/modulecore/ModuleCard';
// we import a so called "mixin" that helps us to interact with the map
-import { Mapable } from '../../src/mixins/Mapable';
+// import { Mapable } from '../../src/mixins/Mapable';
+import { useMap } from '../../src/composables/Map';
// an OpenLayers helper function to display coordinates
import { toStringXY } from 'ol/coordinate';
// an OpenLayer helper function to transform coordinate reference systems
@@ -39,7 +40,7 @@ import { transform } from 'ol/proj.js';
export default {
name: 'sample-module',
// make sure to register the 'Mapable' mixin
- mixins: [Mapable],
+ // mixins: [Mapable],
inheritAttrs: false,
components: {
'wgu-module-card': ModuleCard
@@ -48,12 +49,26 @@ export default {
icon: { type: String, required: false, default: 'md:star' }
},
// here we define variables that are used in the HTML above
+ setup () {
+ const { map, layers } = useMap();
+ return { map, layers };
+ },
data () {
return {
zoom: '',
center: ''
};
},
+ watch: {
+ map: {
+ handler (newMap) {
+ if (newMap) {
+ this.onMapBound();
+ }
+ },
+ immediate: true
+ }
+ },
methods: {
/**
* This function is called once the map is bound to the application
diff --git a/src/components/attributeTable/AttributeTable.vue b/src/components/attributeTable/AttributeTable.vue
index 2ee0a058..1128b95b 100644
--- a/src/components/attributeTable/AttributeTable.vue
+++ b/src/components/attributeTable/AttributeTable.vue
@@ -28,7 +28,8 @@
diff --git a/src/components/bglayerswitcher/BgLayerList.vue b/src/components/bglayerswitcher/BgLayerList.vue
index 504dfae3..9f41acd7 100644
--- a/src/components/bglayerswitcher/BgLayerList.vue
+++ b/src/components/bglayerswitcher/BgLayerList.vue
@@ -40,7 +40,8 @@
diff --git a/src/components/geocoder/Geocoder.vue b/src/components/geocoder/Geocoder.vue
index 9ec34a65..6866f1c5 100644
--- a/src/components/geocoder/Geocoder.vue
+++ b/src/components/geocoder/Geocoder.vue
@@ -35,7 +35,8 @@
diff --git a/src/components/maprecorder/MapRecorderWin.vue b/src/components/maprecorder/MapRecorderWin.vue
index 92a3904b..4f67c1ad 100644
--- a/src/components/maprecorder/MapRecorderWin.vue
+++ b/src/components/maprecorder/MapRecorderWin.vue
@@ -129,19 +129,24 @@