Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps API 3 loading icon

Is there a way to have a loading icon while the map is loading markers? I am using google maps API 3 with javascript and cant find much information on this.

like image 702
shinjuo Avatar asked Jul 10 '26 16:07

shinjuo


1 Answers

This event is now called "status_changed" per the API docs: https://developers.google.com/maps/documentation/javascript/reference#KmlLayer

It can be used like this:

google.maps.event.addListener(kmlLayer, 'status_changed', function () {
    if (kmlLayer.getStatus() == google.maps.KmlLayerStatus.OK) {
        // Success
    }
    else {
        // Failure
    }
});
like image 127
Ben Avatar answered Jul 14 '26 01:07

Ben



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!