Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a loading overlay onto google maps

Hi guys we have a google map v3 which loads in markers when dragged via ajax - I'm all ok with that - I'm just wondering how to add a loading bar on my map - I'm already using

container.style.filter = "alpha(opacity=60);";
                container.style.opacity = 0.6;  

and something else to stop dragging.

What's the best way to do that - if poss I would like to use some html and not an image.

Thanks Richard

like image 758
Richard Housham Avatar asked May 26 '26 16:05

Richard Housham


1 Answers

I got the same problem and solved it by adding a layer over the map (In my case, I just need the loading, and I don't have any other reason to add another plugin):

HTML:

<div id="holder" style="position: relative;">
    <div class="overlay standard hidden">&nbsp</div>
    <div id="map"></div>
</div>

CSS:

div#holder {
    position: relative;
}

.hidden {
    display: none;
}

div.overlay {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    opacity: 0.7;
    z-index: 1;
}

div.overlay.standard { background: #fff url(/image/loading.gif) no-repeat 50% 50%; }
like image 93
user1330271 Avatar answered May 28 '26 06:05

user1330271



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!