capacitor-community / google-maps

Capacitor Plugin using native Google Maps SDK for Android and iOS.

Home Page:https://capacitor-community.github.io/google-maps/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Map crashes app on ios

Timileyin105 opened this issue · comments

Describe the bug
A app works fine on android platform but in ios the app crashes whenever the map is about to be loaded
when app is lauched everthing works fine but when page with the map is opened it crahed
image
i have exc_bad_access
i have tried bot the latest version of xocode (14.3) and 14.1 still same

To Reproduce

1.create sample app for ios
2.run to see on simulator
3. See error

Screenshots
image

@tafelnl your help will be appreciated on this
Thanks

commented

Unfortunately I can't help without a minimal basic reproduction

hello @tafelnl

this is my code

just a simple map create throws the error on ios


//component.html

<div id="map" [style]="{height: mapHeight}" #map></div> 

//component.ts
   createMap() {
       if (Capacitor.getPlatform() === 'web') {
           return;
       }
       const { longitude, latitude } = this.cameraPosition;
       const element = this.map.nativeElement;
       const boundingRectEl = element.getBoundingClientRect();
       await CapacitorGoogleMaps.createMap({
           element: boundingRectEl,
           boundingRect: {
               width: Math.round(boundingRectEl.width),
               height: Math.round(boundingRectEl.height),
               x: Math.round(boundingRectEl.x),
               y: Math.round(boundingRectEl.y),
           },
           cameraPosition: {
               zoom: 14,
               target: {
                   latitude, longitude
               }
           },
           preferences: {
               liteMode: false,
               appearance: {
                   style: mapStyle,
                   isMyLocationDotShown: true,
                   type: this.mapService.getMapTypeInt()
               },
               controls: {
                   isCompassButtonEnabled: false,
                   isMyLocationButtonEnabled: true
               }
           }
       }).then(map => {
           this.mapService.currentMapId = map.googleMap.mapId;
           element.setAttribute("data-maps-id", map.googleMap.mapId);
       }, err => {
           console.log(err);
       })
   }

it works normal in android (Android studio) but ios(xcode emulator) i have error and also to archive peoject i have error

commented

Closing as stale