actually im trying to make a webapp with jquery-mobile and google maps v3. i have a google map at the main page. On resizing with this page active开发者_如何学Python everything works. but on resizing in a subview called from the main page and then going back to the main page, there is just a little piece of gmap in the upper left corner. Then on resizing the main page again the map is fine.
i tried to trigger the map on 'pagebeforeshow'- and 'pageshow'-events with
google.maps.event.trigger($("#map_canvas"), 'resize')
but it doesn't solve my problem. the div for the map has the right size.
has anybody made the same experiences and has a solution?
thanks
damn, that's dumb.
instead of
google.maps.event.trigger($("#map_canvas"), 'resize')
it should be something like this
var map = new google.maps.Map(.........);
google.maps.event.trigger(map, 'resize')
works fine
精彩评论