Hiding Google Maps when not needed

Hi

I am using google maps using JS e.g.
<div #mapElement class="map"></div>

I am also using the following

elements

      <div [hidden]=segment_selected_hidden_Configuration>
...
..
<div>

When i use <div #mapElement class="map"></div> in side this hidden element, google maps does not get displayed.

Is there a way to hide the map screen when not needed?