How can I make on google map info window to show on random pin every 3 seconds? Info window shows on a pin, then closes and after 3 seconds is shown on another random pin with the informations of that pin. It's a Wordpress website. Any suggestions?
First store all marker objects in an array eg:- markerArray[].
Fetch a marker object randomnly from markerArray and show infowindow using setTimout function.
var markerObj = markerArray[Math.floor(markerArray.length * Math.random())];
setInterval(function () {
// close current infowindow
infowindow.close();
// show new infowindow
infowindow.open(map, markerObj);
},3000);
Question is not clear..You are looking for code which refresh page every 3 seconds? You can use following script to refresh your page.
<meta http-equiv="refresh" content="3; URL=http://www.yourdomain.com/yoursite.html">