i have integrate a google map on my website but when i open inspect element map will work and when i close map will disappear. Please let me know what the problem
b
Place this code after marker is created or map is loaded:
google.maps.event.addListenerOnce(map, 'idle', function () {
google.maps.event.trigger(map, 'resize');
});
idle
event is fired when the map becomes idle after panning or zooming.
We are using resize
method after the map becomes idle means all the loading is completed. So code waits for the map idle event (when all processing has stopped on the map) to happen, then it executes the resize
method, this redraws the map to the correct dimensions.