Keep a Google Maps v3 Map hidden, show when needed

后端 未结 8 1005
北海茫月
北海茫月 2020-12-05 04:34

Is there a way of preventing a Google Maps (JS, v3) map being displayed from the get-go? I\'m doing some pre-processing and would like to show my \'Loading\' spinner until e

8条回答
  •  长情又很酷
    2020-12-05 05:13

    This works for me. I'm using the JQuery library.

    $(document).ready(function(){
        $('#Checkbox').click(function(){
            $('#googleMapDiv').toggle();
            initialize(); // initialize the map
        });
    });
    

提交回复
热议问题