Google Map shows only partially

后端 未结 7 1167
不思量自难忘°
不思量自难忘° 2020-12-11 01:19

The Google Map I have is only beeing rendered partially and is centered to the wrong point (it should center to the marker). See below:

7条回答
  •  一个人的身影
    2020-12-11 01:58

    Opening console doesn't re-executes any JS! The page size gets changed by it, Google map API then fires 'resize' event and loads the map again.

    I faced the same issue when setting the map centre manually. I solved it by the below code:

    google.maps.event.trigger(map, "center_changed");
    

提交回复
热议问题