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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re loading markers using a KmlLayer object, then you can attach a listener to the event
metadata_changedwhich gets fired after the KmlLayer has loaded all the information.So you can have your custom loading icon display as soon as you initialize your map, then make the call for the markers using
new google.maps.KmlLayer(...). In the listener formetadata_changedyou can remove the custom loading icon, or hide it from displaying. So when the KmlLayer finishes loading, then it’ll run the code to remove your loading icon.You can attach listeners by going: