0

I tried to add multiple google map marker. I have found the way of doing this from google map Documentation. Now I wanna add infoWindows for those markers. What is the way of doing this? any suggestion? this is what I tried.

var beaches = [
['Bondi Beach', -33.890542, 151.274856, 4],
['Coogee Beach', -33.923036, 151.259052, 5],
['Cronulla Beach', -34.028249, 151.157507, 3],
['Manly Beach', -33.80010128657071, 151.28747820854187, 2],
['Maroubra Beach', -33.950198, 151.259302, 1]
];

function setMarkers(map, locations) {
var image = {
url: 'js/pin_blue.png',
};
  var shape = {
  coords: [1, 1, 1, 20, 18, 20, 18 , 1],
  type: 'poly'
};
for (var i = 0; i < locations.length; i++) {
var beach = locations[i];
var myLatLng = new google.maps.LatLng(beach[1], beach[2]);
var marker = new google.maps.Marker({
    position: myLatLng,
    map: map,
    icon: image,
    shape: shape,
    title: beach[0],
    zIndex: beach[3]
});
}
}
JProgrammer
  • 13
  • 1
  • 1
  • 2

0 Answers0