TypeError: Cannot read properties of undefined (reading 'map')
bstrasburg opened this issue · 4 comments
Describe the bug
Many times on refresh I get this error
To Reproduce
Copy your code from :
https://capacitorjs.com/docs/apis/google-maps#addmarkers
run in web and then refresh the page
Describe the bug Many times on refresh I get this error
To Reproduce Copy your code from : https://capacitorjs.com/docs/apis/google-maps#addmarkers
run in web and then refresh the page
First, please differentiate between '@capacitor-community/capacitor-googlemaps' and '@capacitor/google-maps'.
I was successfully add a marker with @capacitor-community/capacitor-googlemaps.
import { CapacitorGoogleMaps } from '@capacitor-community/google-maps';
const mymarker = await CapacitorGoogleMaps.addMarker({
mapId: document.getElementById("map").getAttribute("data-maps-id"),
position: {
latitude: position[0],
longitude: position[1],
},
preferences: {
title: 'My Mark',
snippet: 'My Location',
}
});
//get the marker's ID
console.log(JSON.parse(JSON.stringify(mymarker))['marker']['markerId']);
Regards,
Mujie
Im sorry, my issue is with @capacitor/google-maps. Do you know what the difference is between the 2? I might have to switch to the @capacitor-community/capacitor-googlemaps if I keep getting these errors.
Im sorry, my issue is with @capacitor/google-maps. Do you know what the difference is between the 2? I might have to switch to the @capacitor-community/capacitor-googlemaps if I keep getting these errors.
Previously I also used @capacitor/google-maps, but after experiencing some problems, I tried @capacitor-community/capacitor-googlemaps. Maybe you can try it with a simple project first to try this plugin.
Regards,
Mujie