How to manually reload Google Map with JavaScript

后端 未结 3 598
情深已故
情深已故 2020-12-15 02:52

I am using this piece of code within a Bootstrap template. I am facing issues when loading images within a Bootstrap Tab content pane.

This is the JavaScript code wh

相关标签:
3条回答
  • 2020-12-15 03:01

    You can refresh with this:

    map.panBy(0, 0);
    
    0 讨论(0)
  • 2020-12-15 03:04
    map.setZoom(map.getZoom());
    

    For some reasons, resize trigger did not work for me, and this one worked.

    0 讨论(0)
  • 2020-12-15 03:19

    Yes, you can 'refresh' a Google Map like this:

    google.maps.event.trigger(map, 'resize');
    

    This basically sends a signal to your map to redraw it.

    Hope that helps!

    0 讨论(0)
提交回复
热议问题