Bootstrap 2.1.0 and google maps

I can not get google maps working on bootstrap 2.1.0.

  • card does not fit
  • it is not centered

any clue?

Please do not reply

#map_canvas img { max-width: none; } 

because it is fixed in bootstrap 2.0.4

+4
source share
1 answer

I always give the absolute dimensions of the map canvas to display the map. For example, I use this code so that the map fills the entire display area of ​​the document:

 var wnd = $(window); var jMap = $("#map"); var map = new google.maps.Map(jMap[0], { zoom: 10, center: new google.maps.LatLng(50.50714570, 5.419846499999999), mapTypeId: google.maps.MapTypeId.ROADMAP }); function resize() { jMap.width(wnd.width()); jMap.height(wnd.height()); google.maps.event.trigger(map, "resize"); } wnd.resize(resize); resize(); // Initial resize 

Where map - div map identifier

0
source

All Articles