mapsplugin / cordova-plugin-googlemaps

Google Maps plugin for Cordova
Apache License 2.0
1.66k stars 916 forks source link

map disappears on domUpdate displays green screen on setDebuggable(true); #326

Closed barmmie closed 9 years ago

barmmie commented 9 years ago

Hi @wf9a5m75 ,

Thanks for the awesome plugin.

Been battling with an issue for a couple of days. When i start the app, the map displays normal.

When i try to hide a div and show another div Everytime i change/update the DOM map goes blank. A map.refreshLayout() doesn't help

When i set map.debuggable(true) and the map goes green instead like the image below i do not understand. The brown part is the hidden div i guess

screen shot 2014-12-04 at 10 36 59 pm

I can see that the appendchild & removechild events are being called properly.

The new dom also gets assigned a new pluginDomId. but the map just dissapears.

Can you please nudge me in the right direction.

wf9a5m75 commented 9 years ago

The green region means the browser region. It means the plugin does not do anything on the green region.

The brown? I don't know. It should be red. The red region means the plugin recognize the child element of the map div. If you touch on the red, the plugin passes the touch event to the browser, otherwise the plugin passes the touch event to the map view.

barmmie commented 9 years ago

@wf9a5m75 Thanks for the reply,

The app starts like this correctly,

screen shot 2014-12-04 at 10 56 53 pm

When i click Go to page Two, i hide the the "page one" div in red and show another div. Then this happens.

screen shot 2014-12-04 at 10 36 59 pm

The map goes off completely and there is no way of retrieving it. Is there something i'm missing

wf9a5m75 commented 9 years ago

How do you hide the page one div? Overlay the page two div above the page one div, or remove the page one div?

wf9a5m75 commented 9 years ago

The easiest way is remove the map when you leave the page one. Then when you came back to page one, call map.getMap() again.

wf9a5m75 commented 9 years ago

@barmmie Any updates?

barmmie commented 9 years ago

@wf9a5m75 Couldn't get the plugin to play nicely Settled for lesser alternative

Thanks for the help

wf9a5m75 commented 9 years ago

Sorry.