ionic-team / ionic-team/capacitor-google-maps

Google Map not showing on IOS if the html element has border

Open
#124 5 comments 0 reactions 0 assignees View on GitHub
triage
Dominant language
TypeScript
Stars
32
Forks
47
PR merge metrics
No merged PRs in 30d

Description

## Bug Report

### Capacitor Version

```
💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 5.5.1
@capacitor/core: 5.5.1
@capacitor/android: 5.5.1
@capacitor/ios: 5.5.1

Installed Dependencies:

@capacitor/cli: 5.5.0
@capacitor/core: 5.5.0
@capacitor/android: 5.5.0
@capacitor/ios: 5.5.0

```

### Platform(s)

IOS

### Current Behavior

```
@ViewChild('citymap') mapRef!: ElementRef;
private newMap!: GoogleMap;

async createMap() {
try {

this.newMap = await GoogleMap.create({
id: 'citymap',
element: this.mapRef.nativeElement,
apiKey: 'API_KEY',
config: {
center: {
lat: 48.992128,
lng: 2.2779189,
},
zoom: 12,
},
});

console.log(this.mapRef.nativeElement); // not showing up at all on IOS
} catch (error) {
console.error('Error fetching or processing the map:', error); // error not explicit

}

ngAfterViewInit() {

this.platform.ready().then(() => {
console.log('platform is ready');

if (this.platform.is('ios')) {
this.createMap();
} else if (this.platform.is('android')) {
this.createMap();
} else {
console.log('inside else');
this.createMap();
}
});
}

```
### Expected Behavior

The map does show up in browser and Android, but not on IOS.
On the browser version, the console.log(this.mapRef.nativeElement) logs the DIV
`// all the divs here are visible`

On the IOS version, when inspecting with safari, the DIV in the DOM is empty
```

```
### Code Reproduction

### Other Technical Details

`npm --version` output: 10.2.3

`node --version` output:v20.10.0

`pod --version` output (iOS issues only):1.14.3

### Additional Context

I have installed a blank project also to isolate the issue, no luck there either.
I have deleted the ios folder, reinstall ios, no difference.
I have added transparency as it is sometimes a recommendation, but no change either.

Thank you very much for your help (it has been days)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.