Currently, I have a script set up to display a map with two markers. Whenever I hover over one of the markers, a popup tooltip appears with location information. My question is, how can I make the information appear by default without needing to hover over the marker?
google.maps.event.addDomListener(window, 'load', init);
var map;
function init() {
var mapOptions = {
center: new google.maps.LatLng(37.1370345, 74.3872165),
zoom: 3,
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL,
},
disableDoubleClickZoom: false,
mapTypeControl: false,
scaleControl: true,
scrollwheel: false,
streetViewControl: true,
draggable: true,
overviewMapControl: false,
mapTypeId: google.maps.MapTypeId.ROADMAP,
styles: [
...
],
}
var mapElement = document.getElementById('map1');
var map = new google.maps.Map(mapElement, mapOptions);
var locations = [
['Country 1', 39.690642467918366, 39.07426848448813],
['Country 2', 39.682790, 19.764394]
];
var infowindow = new google.maps.InfoWindow({
content: "Loading..."
});
var myIcon = new google.maps.MarkerImage("http://i.imgur.com/jRfjvrz.png", null, null, null, new google.maps.Size(46, 46));
for (i = 0; i < locations.length; i++) {
...
}
}