Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redraw google maps on parent container resize

I've got a google map api v3 on a page and when enlarged to full window size it doesn't redraw itself. You can see the problem here

I've looked at what people say in similar questions and I found that everyone seems to be solving this problem with this line of code.

google.maps.event.trigger(map, 'resize');

I've tried it, but it didn't seem to help. Your feedback is much appreciated.

like image 788
CyberRobot Avatar asked Oct 10 '14 08:10

CyberRobot


1 Answers

Seems to work for me... (see here)

Basically, just adding google.maps.event.trigger(map, 'resize'); doesn't help, you call it on the map object you instantiated...

like image 81
reverse_engineer Avatar answered Sep 29 '22 22:09

reverse_engineer