-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The map does not appear (or is empty) #177
Comments
I tried with a new blank project and this is the result of the command ionic info:
|
I don't see any obvious mistake here. You do have node v14 installed, you could try and install v16 and see if it works then. It's also wise to take a look at the troubleshooting guide by Capacitor themselves: https://capacitorjs.com/docs/android/troubleshooting Otherwise I would kindly ask you to share a reproduction (as barebones as possible), so that I can take a look at it. |
@loicparent I don't see any mistakes, but make sure you have @capacitor-community/google-maps version 2.0.0.beta.x (latest 2.0.0.beta.4) Also, there're extra steps on iOS. Make sure you had done it. |
Thanks for your replies :) I just tried with the beta.4 instead of the beta.1 but I don't see any changes. The map doesn't appears and the error in the console is still visible. I have followed the installation documentation and so change the configuration in xCode to use the You can find here the basic reproduction of my code. (You'll just have to change the API key in the file |
@loicparent I didn't realize it but you're creating wrong the map. It should be something like this. The element parameter isn't implemented yet. ...
let result = await CapacitorGoogleMaps.createMap({
boundingRect: {
width: Math.round(boundingRect.width),
height: Math.round(boundingRect.height),
x: Math.round(boundingRect.x),
y: Math.round(boundingRect.y),
},
cameraPosition: {}
});
... Also two things not related to this plugin:
|
Hello @va2ron1, Thanks for your help! I just tried but I don't see any changes. The map doesn't appears and the error in the console is still visible. When I inspect the render in the simulator using the console, I see that the size of the map takes up all the space with the value 100%. I tried also with viewport value (vw, vh) but no changes too. So the map element stay empty with an error in the console. |
@loicparent This notes is from a repository that I cloned in order to see and fix your problem. I pushed the changes here Make sure of this:
|
@va2ron1 Thank you very much for helping out! Much appreciated. @loicparent Can you let us know if this solved it for you? |
Hello, Many thanks for your help @va2ron1! Ok so after comparing and testing, there are 2 things that was wrong. First, I didn't use the css variable to set transparency to the ion-content. So use the css variable instead of the property is ok: ion-content {
--background: transparent;
} Second, the console error related to the cloned element is due to the fact that I had the key let result = await CapacitorGoogleMaps.createMap({
boundingRect: {
width: Math.round(boundingRect.width),
height: Math.round(boundingRect.height),
x: Math.round(boundingRect.x),
y: Math.round(boundingRect.y),
},
cameraPosition: {
target: {
latitude: 33.6,
longitude: -117.9
}
}
}); So now, this is ok and I have updated the repository here. I have an additional question: Thanks again :) |
But please use the search function / discussions / Stack Overflow for these kind of questions so we can keep everything organized :) Closing this issue since it's solved now |
Describe the bug
The map is not shown in browser, simulator or native device.
I see an error in the console of the simulator:
Unhandled Promise Rejection: DataCloneError: The object can not be cloned.
from the functionpostToNative
in the main functionnativeBridge
.To Reproduce
Steps to reproduce the behavior:
@capacitor-community/google-maps
ionic cap run ios --open
and then, open the simulator.Expected behavior
The map should appears without error in the console.
Thanks for your help,
Loïc
Screenshots
HTML
SCSS
TypeScript Code
The text was updated successfully, but these errors were encountered: