Search code examples
c#asp.netgoogle-mapseventsvisible

Google Map not displaying after clicking button


I have been trying to hide Google Maps on my site (which is inside a div). I used the following in a "send" Button event called: function showPoint()

document.getElementById('GMap1').style.display = 'block';

But nothing happens when I click the send button which is suppose to execute this event.

I was able to hide the map with:

<div id="GMap1" style="height: 300px; width:300px; visibility:hidden;"  ></div> 

Only problem is displaying it.


Solution

  • you must modify the visibility, not the display:

    document.getElementById('GMap1').style.visibility= 'visible';