开发者

google map crashes after resizing browser

开发者 https://www.devze.com 2023-03-19 15:39 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号