whitescreen creating map
See original GitHub issueDescribe the bug
!! This issue is related to the latest build v2.0.0-alpha.6 from the fork of @tafelnl !!
when you create the map, it is not initialized, although this was successful in the logs (see safari screenshot). The Maps API key is valid.
To Reproduce
Install latest version:
npm i git+https://github.com/DutchConcepts/capacitor-google-maps.git#v2.0.0-alpha.6
Code to initialize:
ngOnInit() {
setTimeout(() => {
this.initMap();
}, 5000);
}
public async initMap() {
await CapacitorGoogleMaps.initialize({
key: 'MAPS_API_KEY',
devicePixelRatio: window.devicePixelRatio, // this line is very important
});
const element = document.getElementById('container');
const boundingRect = element.getBoundingClientRect();
try {
//@ts-ignore
const 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),
},
});
// remove background, so map can be seen
element.style.background = 'transparent';
// finally set `data-maps-id` attribute for delegating touch events
element.setAttribute('data-maps-id', result.googleMap.mapId);
console.log('success');
} catch (e) {
console.log('error', e);
}
}
Screenshots
logs inside safari:
logs inside xcode:
result:
Additional context
- iPhone 11 Pro IOS 15.2
- XCode Version 13.2.1
- MacBook Pro M1 Monterey 12.1
- Ionic Angular
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Solved: map tour white screen - Esri Community
Solved: when I try to create a map tour story map, I get three wiggly dots, and then a white screen. It never...
Read more >[Help!] White Screen on Map Load? : r/OwlbearRodeo - Reddit
I tried to log on to my game today and after loading the basics of the page, the entire page turns white before...
Read more >Windows 10 Maps only shows blank screen with position dot
Recently I reset my machine (cleaned everything) and I found that I cannot use the map anymore. I can only see a position...
Read more >After enabling maps, you get a white screen instead of a map
On an iOS device, after enabling maps, you log in to a Maximo Anywhere app and click on the Map icon. Instead of...
Read more >Google Maps not showing and displays blank screen
1] Clear google.com Cookies · 2] Disable browser extensions · 3] Reset Google Chrome · 4] Use an alternative browser · 5] Use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@DwieDima set this in the folder.page.scss, is a workaround to solved your problem.
@tafelnl this branch need a lot more work, I uploaded my changes that I did in the main repo so you can take it as a reference to make the fixes. https://github.com/va2ron1/capacitor-googlemaps-native
@va2ron1 thank you, your snippet fixed it! @tafelnl now i found another issue: #132