How to change Google Map logo? We might need slow down a little bit.
Apr 23, 2022
We still need respect Google, but sometimes it might be nice to customized the Google in a way we like.
window.google.maps.event.addListenerOnce(map, "tilesloaded", () => { setTimeout(() => { const mapLogoDom = document.querySelector("img[alt=Google]"); if (!mapLogoDom) return; mapLogoDom.src = mapLogo; mapLogoDom.style.display = "block"; }, 3);});
As you can see, I’m using setTimeout here to delay the logo update. That’s because `tilesloaded` actually fired before logo loading. Google map takes 3 milliseconds to load the logo, the speed isn’t too bad actually.