Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using Google Maps to add multiple windows to different pins located on the map.
var sContent =
'<h2>' + oLocation.title + '</h2>' +
'<br />' +
'<p>' +
oLocation.address1 + ' ' +
oLocation.address2 +
'<br />' +
oLocation.city +
'<br />' +
oLocation.province +
oLocation.zip +
'</p>';
infoWindow = new google.maps.InfoWindow({ content: sContent });
marker = new google.maps.Marker({
position: position,
map: map,
title: markers[i][0],
info: sContent
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
google.maps.event.addListener( marker, 'click', function() {
infoWindow.setContent( this.info );
infoWindow.open( map, this );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.