google maps not displayed correctly unless refreshing

后端 未结 3 1589
天涯浪人
天涯浪人 2021-01-13 18:57

I am using JQuery mobile with the Google Map API. The map is not displayed properly unless I refresh the page and I don\'t understand why.

here is my map.html file:<

3条回答
  •  旧巷少年郎
    2021-01-13 19:18

    Try to add following code...

    $('#canvas-map').on('pageshow', function(){
        google.maps.event.trigger(canvas-map, "resize");
    });
    

    this will fire resize event and reload the map on your page.

提交回复
热议问题