I want to open two infowindows on the same marker. On 'click' event first infowindow should close (which I am showing already on map) and open the second infowindow. On closing the second infowindow, I'd like to open the first window.
Here is my code:
var infowindow = new google.maps.InfoWindow({
content: content,
marker:marker,
maxWidth: 300,
image:image,
id:vehicleNo
});
var openinfowindow = new google.maps.InfoWindow({
content: contentone,
marker:marker,
maxWidth: 300,
image:image,
id:vehicleNo
});
google.maps.event.addListener(marker,'click', (function(marker,content,infowindow){
return function() {
openinfowindow.close();
infowindow.setContent(content);
infowindow.open(map,marker);
};
})(marker,content,infowindow));
google.maps.event.addListener(infowindow,'closeclick',function(){
openinfowindow.setContent(contentone);
openinfowindow.open(map,marker);
});