<script lang="ts">
import {
GoogleMaps,
GoogleMap,
GoogleMapsEvent,
GoogleMapOptions,
Geocoder,
GeocoderResult,
Marker
} from '@ionic-native/google-maps';
import { defineComponent, ref } from "vue";
export default defineComponent({
.....
setup() {
// form values
const origin = ref<string>("");
const destination = ref<string>("");
const coordinates = ref<any>({});
const googleMap = ref<GoogleMap>();
const loadMap = () => {
Geocoder.geocode({
"position": {
"lat": coordinates.value.coords.latitude,
"lng": coordinates.value.coords.longitude
}
}).then((results: GeocoderResult[]) => {
if (results.length == 0) {
// Not found
return null;
}
let address: any = [
results[0].subThoroughfare || "",
results[0].thoroughfare || "",
results[0].locality || "",
results[0].adminArea || "",
results[0].postalCode || "",
results[0].country || ""].join(", ");
});
};
return {
....
// Data
origin,
destination,
...
// Methods
....
loadMap,
};
}
});
</script>
Hi, first of all. This is my first experience for using this cordova plugin (i am using capacitor v3).
This error came up, when i decided to use this plugin with Ionic 5 & Vue 3. I have this error, that i couldn't find out the solution.
Here's my package.json (Open this up)
Here's my Vue component (Open this up)
Sorry, i can't show you the full code, because. it's too long and it's not what i want to ask. But the issue what i am talking is about the error above this code. I could really use some help.