Cordova-plugin-googlemaps: Map not load, white-screen only

Created on 2 May 2018  路  20Comments  路  Source: mapsplugin/cordova-plugin-googlemaps

I'm submitting a ...

  • [ ] question
  • [x] any problem or bug report
  • [ ] feature request

If you choose 'problem or bug report', please select OS:

  • [x] Android
  • [x] iOS

cordova information: (run $> cordova plugin list)

cordova-plugin-googlemaps 2.2.9 "cordova-plugin-googlemaps"

Current behavior:
Plugin version 2.2.9 has not allow me to load map in HTML DOM. Initially it throwing error "Uncaught (in promise) TypeError: Cannot read property 'size' of undefined" Please see attached file for it
screen shot 2018-05-03 at 12 58 08 am

I did simple following in code:

HTML:

<div id="googlemap">

JS:

var div = document.getElementById("googlemap");
 map = plugin.google.maps.Map.getMap(div);
not bug

All 20 comments

console.log(div) == null

And where should I add it?

Please insert console.log(div) after the var div= document.getElementById("googlemap");, then confirm the div is null or not null.
(I guess null)

If you can't solve the problem by yourself, please share your project files on github.

Hi, Thanks for your reply.

But i did debugg and checked that "DIV" should be not null or undefined or empty. But still getting error in "CordovaGoogleMaps.js" file. Please check my attached screenshot for all info and console for check value.

screen shot 2018-05-03 at 10 21 38 am

One more thing i noticed my elemid is not showing in self.domPositions[elemId]; so it throwing undefined.

As I said, if you can't solve the problem by yourself, please share your project files on github.

Can't share you my full project code. But i am trying to make sample app and regenerate issue then will send you code of github hope it will work for you.

But can you clear one thing: When i add plugin 2.2.8 without any code change map getting load, but in 2.2.9 it's not. SO did i missing any configurations on which i need to take care for version 2.2.9 ?

Hi,

Sharing you github link: https://github.com/naitikpatel1990/GoogleMapTest/tree/master

Which have whitescreen issue on map. Thanks for your help in advance.

Thanks, I briefly checked your code, but wherr do you define the size (demention) of the map div? There is no definition in index.css and style.css files.

Yes, I have one div inside that div i have map div. and map div has no css but parent div has.

Since the map div does not css size specification, the map div is 100% x 0px.

The maps plugin does not generate a map such a case.

I did size for map div like:

<div id="googlemap" style="height:500px;width:500px"></div>

Still giving me white screen. Can you tell me what i need to set in style so at least map can be visible ? or you can edit my given demo code to make it work and share with me that also will be helpful.

I'm extremely busy these days.

Ok, I am waiting here. Whenever you have time please revert back. Of course other plugin user also faced same issue. So it's good to solve it. Thank you.

Meanwhile I will also try to solve it.

Please keep this thread open.

Did you try very simple example code?
https://github.com/mapsplugin/cordova-plugin-googlemaps/blob/master/README.md#quick-demo

When you face any problem, you should solve the issue by your self as much as possible.
At this time, you should start with very simple code, then inspect your code one by one.

Please do your best before asking.

I did mke it work with map version 2.2.8 so I ask this question because I thought I miss something in 2.2.9 version to be configured.

Anyways will try simple example which you suggest and revert you.

After modifying <div id="googlemap"> to <div id="googlemap" style="width:500px;height:500px">, then just run it.

ping

Yes. Map is loading after add some CSS in map container.

Thank you man for your valuable input.

i got the same issue,
i had been tried the code from :
https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.3.0/hello-world/README.md
on browser is ok, but i got only logo google without map on android
Screenshot_2019-11-24-09-00-15-958_io cordova map

Was this page helpful?
0 / 5 - 0 ratings