question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

whitescreen creating map

See original GitHub issue

Describe 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: Bildschirmfoto 2022-02-04 um 13 51 16

logs inside xcode: Bildschirmfoto 2022-02-04 um 15 22 27

result: RPReplay_Final1643979170

Additional context

  • iPhone 11 Pro IOS 15.2
  • XCode Version 13.2.1
  • MacBook Pro M1 Monterey 12.1
  • Ionic Angular

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
va2ron1commented, Feb 8, 2022

@DwieDima set this in the folder.page.scss, is a workaround to solved your problem.

ion-content {
  --background: transparent;
}

@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

1reaction
DwieDimacommented, Feb 9, 2022

@va2ron1 thank you, your snippet fixed it! @tafelnl now i found another issue: #132

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found