Google maps in hidden div

后端 未结 5 851
余生分开走
余生分开走 2020-12-06 06:56

I have a page with two tabs. The first tab has photos and the second a google map. The problem is that the google map is not completely drawing because it is in a hidden div

5条回答
  •  执念已碎
    2020-12-06 07:19

    I've seen this before you need to resize the map:

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

    This is for V3:

    http://code.google.com/p/gmaps-api-issues/issues/detail?id=1448

    A little more info:

    https://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/251f20b769d116ea/ba3ca54f5e1352a2?pli=1

提交回复
热议问题