Keep a Google Maps v3 Map hidden, show when needed

后端 未结 8 988
北海茫月
北海茫月 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:18

    Or you could just hide it like with css visablility or css opacity.

    $("#GoogleMap").css({ opacity: 0, zoom: 0 });
    initialize();
    
    google.maps.event.addListener(map,"idle", function(){ 
         $('#Loader').hide();
         $("#GoogleMap").css({ opacity: 1, zoom: 1 });
    }); 
    

提交回复
热议问题